Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees.

Similar presentations


Presentation on theme: "Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees."— Presentation transcript:

1 Graph Theory Trees

2 WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees

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

4 Examples Graphs that are trees. Graph that are not trees.

5 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

6 Minimum-cost spanning tree A minimum cost spanning tree is the least expensive spanning tree of all spanning trees under consideration.

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

8 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

9 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

10 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

11 Determine a spanning tree for the graph shown below. a. c. b. d.

12 Determine a spanning tree for the graph shown below. a. c. b. d.

13 Determine the minimum-cost spanning tree for the following weighted graph.

14 a. c. b. d.

15 a. c. b. d.

16 Kathleen is planning on installing a new computer network at her small business. Her current system has computers already in place as shown in the figure below. The numbers are shown in feet.

17 Determine the minimum- cost spanning tree that reaches each computer. a. c. b. d.

18 Determine the minimum- cost spanning tree that reaches each computer. a. c. b. d.

19 If the new networking system materials cost $2.20 per foot, what is the cost of installing the system a.$79.20 b.$83.60 c.$85.80 d.$112.20

20 If the new networking system materials cost $2.20 per foot, what is the cost of installing the system a.$79.20 b.$83.60 c.$85.80 d.$112.20


Download ppt "Graph Theory Trees. WHAT YOU WILL LEARN Trees, spanning trees, and minimum-cost spanning trees."

Similar presentations


Ads by Google