Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.

Similar presentations


Presentation on theme: "Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND."— Presentation transcript:

1 Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND

2 Copyright © 2009 Pearson Education, Inc. Chapter 14 Section 4 - Slide 2 Chapter 14 Graph Theory

3 Chapter 14 Section 4 - Slide 3 Copyright © 2009 Pearson Education, Inc. WHAT YOU WILL LEARN Graphs, paths and circuits The Königsberg bridge problem Euler paths and Euler circuits Hamilton paths and Hamilton circuits Traveling salesman problem Brute force method

4 Chapter 14 Section 4 - Slide 4 Copyright © 2009 Pearson Education, Inc. WHAT YOU WILL LEARN Nearest neighbor method Trees, spanning trees, and minimum-cost spanning trees

5 Copyright © 2009 Pearson Education, Inc. Chapter 14 Section 4 - Slide 5 Section 4 Trees

6 Chapter 14 Section 4 - Slide 6 Copyright © 2009 Pearson Education, Inc. Definitions A tree is a connected graph in which each edge is a bridge. A spanning tree is a tree that is created from another graph by removing edges while still maintaining a path to each vertex.

7 Chapter 14 Section 4 - Slide 7 Copyright © 2009 Pearson Education, Inc. Examples Graphs that are trees. Graph that are not trees.

8 Chapter 14 Section 4 - Slide 8 Copyright © 2009 Pearson Education, Inc. Example: Determining Spanning Trees Determine two different spanning trees for the graph shown. A B C E FH D G A B C EFH D G A B C EFH D G

9 Chapter 14 Section 4 - Slide 9 Copyright © 2009 Pearson Education, Inc. Minimum-cost spanning tree A minimum cost spanning tree is the least expensive spanning tree of all spanning trees under consideration.

10 Chapter 14 Section 4 - Slide 10 Copyright © 2009 Pearson Education, Inc. Kruskal’s Algorithm To construct the minimum-cost spanning tree from a weighted graph: 1. Select the lowest-cost edge on the graph. 2. Select the next lowest-cost edge that does not form a circuit with the first edge. 3. Select the next lowest-cost edge that does not form a circuit with the previously selected edges. 4. Continue selecting the lowest-cost edges that do not form circuits with the previously selected edges. 5. When a spanning tree is complete, you have the minimum-cost spanning tree.

11 Chapter 14 Section 4 - Slide 11 Copyright © 2009 Pearson Education, Inc. Example: Kruskal’s Algorithm Use Kruskal’s algorithm to determine the minimum spanning tree for the weighted graph shown. The numbers along the edges represent dollars. A B C G D E F 12 11 10 5 22 14 4 17 22 18

12 Chapter 14 Section 4 - Slide 12 Copyright © 2009 Pearson Education, Inc. Solution Pick the lowest-cost edge of the graph, edge CD which is $4. Next we select the next lowest-cost edge that does not form a circuit; we select edge CG which is $5. A B C G D E F 12 11 10 5 22 14 4 17 22 18

13 Chapter 14 Section 4 - Slide 13 Copyright © 2009 Pearson Education, Inc. Solution (continued) Continue selecting edges, being careful not to form a circuit. The total cost would be $12 + $10 + $5 + $14 +$18 + $4 = $63. A B C G D E F 12 11 10 5 22 14 4 17 22 18


Download ppt "Chapter 14 Section 4 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND."

Similar presentations


Ads by Google