Presentation is loading. Please wait.

Presentation is loading. Please wait.

Section 13.4 Trees.

Similar presentations


Presentation on theme: "Section 13.4 Trees."— Presentation transcript:

1 Section 13.4 Trees

2 What You Will Learn Upon completion of this section, you will be able to: Use trees to represent real-life problems. Solve problems involving minimum-cost spanning trees.

3 Tree A tree is a connected graph in which each edge is a bridge.

4 Examples Trees Not Trees

5 Spanning Tree A spanning tree is a tree that is created from another graph by removing edges while still maintaining a path to each vertex.

6 Example 3: A Spanning Tree Problem
Kutztown University is considering adding awnings above its sidewalks to help shelter students from the snow and rain while they walk between some of the buildings on campus. A diagram of the buildings and the connecting sidewalks where the awnings are to be added is on the next slide.

7 Example 3: A Spanning Tree Problem

8 Example 3: A Spanning Tree Problem
Originally, the president of the university wished to have awnings placed over all the sidewalks shown, but that was found to be too costly. Instead, the president has proposed to place just enough awnings over a select number of sidewalks so that, by moving from building to building, students would still

9 Example 3: A Spanning Tree Problem
be able to reach any location shown without being exposed to the elements. a) Represent all the buildings and sidewalks shown with a graph. b) Create three different spanning trees from this graph that would satisfy the president’s proposal.

10 Example 3: A Spanning Tree Problem
Solution a) Using letters to represent the building names, vertices to represent the buildings, and edges to represent the sidewalks between buildings, we generate this graph.

11 Example 3: A Spanning Tree Problem
Solution b) To create a spanning tree we remove nonbridge edges until a tree is created.

12 Example 3: A Spanning Tree Problem
Solution b) Here are two more possibilities.

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

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

15 Kruskal’s Algorithm 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.

16 Example 7: Colorado Bicycle Paths
The Colorado Park and Recreation Association wishes to build bicycle trails that connect the cities of Aurora, Boulder, Denver, Englewood, and Golden. The approximate distances, in miles, between these cities are given in the table on the next slide.

17 Example 7: Colorado Bicycle Paths

18 Example 7: Colorado Bicycle Paths
a) Use Kruskal’s algorithm to determine the minimum-cost spanning tree that would link each city and create the shortest total distance for the bicycle trails. b) If the cost of building the bicycle trails is $5500 per mile, determine the cost of building the bicycle trails determined in part (a).

19 Example 7: Colorado Bicycle Paths
Solution a) Draw five labeled vertices that represent the five cities. Note that the exact location and distance between vertices does not need to be drawn to scale.

20 Example 7: Colorado Bicycle Paths
Solution The shortest distance listed in the tables I between Denver and Englewood, 8 miles and the next shortest distance is Aurora and Denver, 9 miles. Thus, we include edges DE and AD, respectively.

21 Example 7: Colorado Bicycle Paths
Solution The next shortest distance, without creating a circuit, between Denver and Golden, so we include edge DG.

22 Example 7: Colorado Bicycle Paths
Solution Next, we include the distance between Boulder and Golden, because edge BG does not create any circuits.

23 Example 7: Colorado Bicycle Paths
Solution b.) We can see that there are , or 59 miles of bicycle trails needed. At a cost of $5500 per mile, the cost to create these trails is $5500 × 59, or $324,500.


Download ppt "Section 13.4 Trees."

Similar presentations


Ads by Google