Discrete Mathematical Structures: Theory and Applications Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications
Learning Objectives Learn the basic properties of graph theory Learn about walks, trails, paths, circuits, and cycles in a graph Explore how graphs are represented in computer memory Learn about Euler and Hamilton circuits Learn about isomorphism of graphs Explore various graph algorithms Examine planar graphs and graph coloring Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation The Königsberg bridge problem is as follows: Starting at one land area, is it possible to walk across all of the bridges exactly once and return to the starting land area? In 1736, Euler represented the Königsberg bridge problem as a graph, as shown in Figure 10.1(b), and answered the question in the negative. Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Consider the following problem related to an old children’s game. Using a pencil, can each of the diagrams in Figure 10.2 be traced, satisfying the following conditions? The tracing must start at point A and come back to point A. While tracing the figure, the pencil cannot be lifted from the figure. A line cannot be traced twice. As in geometry, each of points A, B, and C is called a vertex of the graph and the line joining two vertices is called an edge. Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Suppose there are three houses, which are to be connected to three services — water, telephone, and electricity — by means of underground pipelines. The services are to be connected subject to the following condition: The pipes must be laid so that they do not cross each other. Consider three distinct points, A, B, C, as three houses and three other distinct points, W , T, and E, which represent the water source, the telephone connection point, and the electricity connection point. Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Try to join W , T, and E with each of A, B, and C by drawing lines (they may not be straight lines) so that no two lines intersect each other (see Figure 10.3). This is known as the three utilities problem. Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Graph Definitions and Notation Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Walks, Paths, and Cycles Discrete Mathematical Structures: Theory and Applications
Matrix Representation of a Graph Discrete Mathematical Structures: Theory and Applications
Matrix Representation of a Graph Discrete Mathematical Structures: Theory and Applications
Matrix Representation of a Graph Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Matrix Representation of a Graph Discrete Mathematical Structures: Theory and Applications
Matrix Representation of a Graph Discrete Mathematical Structures: Theory and Applications
Matrix Representation of a Graph Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits Definition 10.4.9 Example 10.4.10 An open trail in a graph is called an Euler trail if it contains all the edges and all the vertices. Example 10.4.10 This is a connected graph. It has a vertex of odd degree. Thus, this graph has no Euler circuit, but the trail (v2, e7, v6, e5, v5, e4, v4, e3, v3, e2, v2, e1, v1, e6, v6) contains all the edges of G. Hence, this is an Euler trail. Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits This diagram in Figure 10.63 is a connected graph with 20 vertices. Each Vertex represents a famous city. It follows that the game is equivalent to finding a cycle in the graph in Figure 10.63 that contains each vertex exactly once except for the starting and ending vertices, which appear twice, making a Hamiltonian Cycle. Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits Discrete Mathematical Structures: Theory and Applications
Special Circuits During a certain soccer tournament with 4 teams, each team has played against all the others exactly once and there were no ties. All the teams can be listed in order so that each has defeated the team next on the list. Let the teams be denoted by v1, v2, v3, and v4 and let the matches correspond to the vertices and the arcs of a directed graph, respectively, in such a way that the initial and terminal vertices of an arc correspond to the winner and loser, respectively, of the corresponding match. v2 → v1 → v3 → v4 is a Hamiltonian directed path. Discrete Mathematical Structures: Theory and Applications
Isomorphism Discrete Mathematical Structures: Theory and Applications
Isomorphism In Figure 10.77, v1 and v2 are the end vertices of edge e1 in G1 and f(v1) = u1 and f(v2) = u3 are end vertices of edge h(e1) = f2 in G2. Also, f(v3) = u4 and f(v1) = u1 are the end vertices of edge f4 = h(e2) in G2 and v3 and v1 are end vertices of edge e2 in G1. Similarly, for other vertices, any two vertices vi and vj are end vertices of some edge ek in G1 if and only if f(vi) and f(vj) are end vertices of edge h(ek) in G2. G1 is therefore isomorphic to G2 Discrete Mathematical Structures: Theory and Applications
Isomorphism Discrete Mathematical Structures: Theory and Applications
Isomorphism Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Graphs can be used to show how different chemicals are related or to show airline routes. They can also be used to show the highway structure of a city, state, or country. The edges connecting two vertices can be assigned a nonnegative real number, called the weight of the edge. If the graph represents a highway structure, the weight can represent the distance between two places, or the travel time from one place to another. Such graphs are called weighted graphs. Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Discrete Mathematical Structures: Theory and Applications
Graph Algorithms Discrete Mathematical Structures: Theory and Applications
Graph Algorithms To guide the breadth-first topological ordering, use a data structure called a queue. Formally, a queue is a data structure in which elements are added at one end, called the rear of the queue, and removed from the other end, called the front of the queue. Items are processed in the order they arrive. When the immediate predecessor count of a vertex becomes 0, it is placed next in the queue. The vertex at the front of the queue is removed and placed in the topological order. It follows that when a vertex, say v, is placed in the queue, either all of its predecessors are already placed in the topological order or they are in the queue. Because vertex v is placed at the end of the queue before it is placed in the topological order, all of its predecessors are placed in the topological order. Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring A graph is a planar graph if and only if it has a pictorial representation in a plane which is a plane graph. This pictorial representation of a planar graph G as a plane graph is called a planar representation of G. Let G denote the plane graph in Figure 10.111. Graph G, in Figure 10.111, divides the plane into different regions, called the faces of G. Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Planar Graphs and Graph Coloring Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications
Discrete Mathematical Structures: Theory and Applications