chapter 10: graph theory discrete mathematical structures: theory and applications

83
Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

Upload: abigail-golden

Post on 17-Jan-2016

266 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

Chapter 10: Graph Theory

Discrete Mathematical Structures:

Theory and Applications

Page 2: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 2

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

Page 3: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 3

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.

Page 4: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 4

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?

1. The tracing must start at point A and come back to point A.

2. While tracing the figure, the pencil cannot be lifted from the figure.

3. 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.

Page 5: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 5

Graph Definitions and Notation

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.

Suppose there are three houses, which are to be connected to three services — water, telephone, and electricity — by means of underground pipelines.

Page 6: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 6

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.

Page 7: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 7

Graph Definitions and Notation

Page 8: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 8

Graph Definitions and Notation

Page 9: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 9

Graph Definitions and Notation

Page 10: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 10

Graph Definitions and Notation

Page 11: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 11

Graph Definitions and Notation

Page 12: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 12

Graph Definitions and Notation

Page 13: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 13

Graph Definitions and Notation

Page 14: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 14

Graph Definitions and Notation

Page 15: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 15

Graph Definitions and Notation

Page 16: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 16

Graph Definitions and Notation

Page 17: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 17

Graph Definitions and Notation

Page 18: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 18

Graph Definitions and Notation

Page 19: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 19

Graph Definitions and Notation

Page 20: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 20

Walks, Paths, and Cycles

Page 21: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 21

Walks, Paths, and Cycles

Page 22: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 22

Walks, Paths, and Cycles

Page 23: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 23

Walks, Paths, and Cycles

Page 24: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 24

Walks, Paths, and Cycles

Page 25: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 25

Walks, Paths, and Cycles

Page 26: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 26

Walks, Paths, and Cycles

Page 27: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 27

Walks, Paths, and Cycles

Page 28: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 28

Walks, Paths, and Cycles

Page 29: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 29

Walks, Paths, and Cycles

Page 30: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 30

Matrix Representation of a Graph

Page 31: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 31

Matrix Representation of a Graph

Page 32: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 32

Matrix Representation of a Graph

Page 33: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 33

Page 34: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 34

Page 35: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 35

Matrix Representation of a Graph

Page 36: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 36

Matrix Representation of a Graph

Page 37: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 37

Matrix Representation of a Graph

Page 38: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 38

Special Circuits

Page 39: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 39

Special Circuits

Page 40: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 40

Special Circuits

Page 41: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 41

Special Circuits

Page 42: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 42

Special Circuits

Definition 10.4.9

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.

Page 43: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 43

Special Circuits

Page 44: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 44

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.

Page 45: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 45

Special Circuits

Page 46: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 46

Special Circuits

Page 47: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 47

Special Circuits

Page 48: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 48

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.

Page 49: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 49

Isomorphism

Page 50: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 50

Isomorphism

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

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.

Page 51: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 51

Isomorphism

Page 52: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 52

Isomorphism

Page 53: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 53

Page 54: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 54

Page 55: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 55

Page 56: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 56

Page 57: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 57

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.

Page 58: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 58

Graph Algorithms

Page 59: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 59

Graph Algorithms

Page 60: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 60

Graph Algorithms

Page 61: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 61

Graph Algorithms

Page 62: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 62

Page 63: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 63

Page 64: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 64

Page 65: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 65

Graph Algorithms

Page 66: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 66

Graph Algorithms

Page 67: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 67

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.

Page 68: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 68

Page 69: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 69

Planar Graphs and Graph Coloring

Page 70: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 70

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.

Page 71: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 71

Planar Graphs and Graph Coloring

Page 72: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 72

Planar Graphs and Graph Coloring

Page 73: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 73

Planar Graphs and Graph Coloring

Page 74: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 74

Planar Graphs and Graph Coloring

Page 75: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 75

Planar Graphs and Graph Coloring

Page 76: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 76

Page 77: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 77

Page 78: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 78

Page 79: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 79

Planar Graphs and Graph Coloring

Page 80: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 80

Planar Graphs and Graph Coloring

Page 81: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 81

Page 82: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 82

Page 83: Chapter 10: Graph Theory Discrete Mathematical Structures: Theory and Applications

10

Discrete Mathematical Structures: Theory and Applications 83