Chapter 15 Graph Theory 2008 Pearson AddisonWesley All

  • Slides: 23
Download presentation
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved

Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley. All rights reserved

Chapter 15: Graph Theory 15. 1 15. 2 15. 3 15. 4 Basic Concepts

Chapter 15: Graph Theory 15. 1 15. 2 15. 3 15. 4 Basic Concepts Euler Circuits Hamilton Circuits and Algorithms Trees and Minimum Spanning Trees 2 © 2008 Pearson Addison-Wesley. All rights reserved

Chapter 1 Section 15 -1 Basic Concepts © 2008 Pearson Addison-Wesley. All rights reserved

Chapter 1 Section 15 -1 Basic Concepts © 2008 Pearson Addison-Wesley. All rights reserved

Basic Concepts • • Graphs Walks, Paths, and Circuits Complete Graphs and Subgraphs Graph

Basic Concepts • • Graphs Walks, Paths, and Circuits Complete Graphs and Subgraphs Graph Coloring 4 © 2008 Pearson Addison-Wesley. All rights reserved

Simple Graphs in which there is no more than one edge between any two

Simple Graphs in which there is no more than one edge between any two vertices and in which no edge goes from vertex to the same vertex are called simple. Simple Not simple 5 © 2008 Pearson Addison-Wesley. All rights reserved

Degree of the Vertex The number of edges joined to a vertex is called

Degree of the Vertex The number of edges joined to a vertex is called the degree of the vertex. D A C B A has degree 0, B has degree 1, C has degree 2 and D has degree 3. 6 © 2008 Pearson Addison-Wesley. All rights reserved

Isomorphic Graphs Two graphs are isomorphic if there is a one-to-one matching between vertices

Isomorphic Graphs Two graphs are isomorphic if there is a one-to-one matching between vertices of the two graphs with the property that whenever there is an edge between two vertices of either one of the graphs, there is an edge between the corresponding vertices of the other graph. 7 © 2008 Pearson Addison-Wesley. All rights reserved

Connected and Disconnected Graphs A graph is connected if one can move from each

Connected and Disconnected Graphs A graph is connected if one can move from each vertex of the graph to every other vertex of the graph along edges of the graph. If not, the graph is disconnected. The connected pieces of a graph are called the components of the graph. 8 © 2008 Pearson Addison-Wesley. All rights reserved

Example: Isomorphic Graphs Are the two graphs isomorphic? Solution Yes, and corresponding vertices are

Example: Isomorphic Graphs Are the two graphs isomorphic? Solution Yes, and corresponding vertices are labeled below. A D B C B A D C 9 © 2008 Pearson Addison-Wesley. All rights reserved

Sum of Degrees Theorem In any graph, the sum of the degrees of the

Sum of Degrees Theorem In any graph, the sum of the degrees of the vertices equals twice the number of edges. 10 © 2008 Pearson Addison-Wesley. All rights reserved

Example: Sum of Degrees A graph has exactly four vertices, each of degree 3.

Example: Sum of Degrees A graph has exactly four vertices, each of degree 3. How many edges does this graph have? Solution The sum of degrees of the vertices is 12. By theorem, this number is twice the number of edges, so the number of edges is 12/2 = 6. 11 © 2008 Pearson Addison-Wesley. All rights reserved

Walk A walk in a graph is a sequence of vertices, each linked to

Walk A walk in a graph is a sequence of vertices, each linked to the next vertex by a specified edge of the graph. 12 © 2008 Pearson Addison-Wesley. All rights reserved

Path A path in a graph is a walk that uses no edge more

Path A path in a graph is a walk that uses no edge more than once. 13 © 2008 Pearson Addison-Wesley. All rights reserved

Circuit A circuit in a graph is a path that begins and ends at

Circuit A circuit in a graph is a path that begins and ends at the same vertex. 14 © 2008 Pearson Addison-Wesley. All rights reserved

Venn Diagram of Walks, Paths, and Circuits 15 © 2008 Pearson Addison-Wesley. All rights

Venn Diagram of Walks, Paths, and Circuits 15 © 2008 Pearson Addison-Wesley. All rights reserved

Example: Classifying Walks Using the graph, classify each sequence as a walk, a path

Example: Classifying Walks Using the graph, classify each sequence as a walk, a path or a circuit. A E B D C 16 © 2008 Pearson Addison-Wesley. All rights reserved

Example: Classifying Walks A Solution E B D C Walk Path Circuit a) No

Example: Classifying Walks A Solution E B D C Walk Path Circuit a) No No No b) Yes Yes c) Yes No No d) Yes No No 17 © 2008 Pearson Addison-Wesley. All rights reserved

Complete Graph A complete graph is a graph in which there is exactly one

Complete Graph A complete graph is a graph in which there is exactly one edge going from each vertex to each other vertex in the graph. 18 © 2008 Pearson Addison-Wesley. All rights reserved

Example: Complete Graph Draw a complete graph with four vertices. Solution Answers may vary,

Example: Complete Graph Draw a complete graph with four vertices. Solution Answers may vary, but one solution is shown below. 19 © 2008 Pearson Addison-Wesley. All rights reserved

Subgraph A graph consisting of some of the vertices of the original graph and

Subgraph A graph consisting of some of the vertices of the original graph and some the original edges between those vertices is called a subgraph. 20 © 2008 Pearson Addison-Wesley. All rights reserved

Coloring and Chromatic Number A coloring for a graph is a coloring of the

Coloring and Chromatic Number A coloring for a graph is a coloring of the vertices in such a way that the vertices joined by an edge have different colors. The chromatic number of a graph is the least number of colors needed to make a coloring. 21 © 2008 Pearson Addison-Wesley. All rights reserved

Coloring a Graph Step 1: Choose a vertex with highest degree, and color it.

Coloring a Graph Step 1: Choose a vertex with highest degree, and color it. Use the same color to color as many vertices as you can without coloring vertices joined by an edge of the same color. Step 2: Choose a new color, and repeat what you did in Step 1 for vertices not already colored. Step 3: Repeat Step 1 until all vertices are colored. 22 © 2008 Pearson Addison-Wesley. All rights reserved

Example: Coloring a Graph Color the graph below and give its chromatic number. Solution

Example: Coloring a Graph Color the graph below and give its chromatic number. Solution Its chromatic number is 3. 23 © 2008 Pearson Addison-Wesley. All rights reserved