1 / 9

Minimum Spanning Trees

Minimum Spanning Trees. Standard ST1 Construct a minimum spanning tree for weighted and unweighted graphs. Minimizing costs. Suppose you want to supply a set of houses (say, in a new subdivision) with: electric power water sewage lines telephone lines

lynettet
Download Presentation

Minimum Spanning Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Minimum Spanning Trees Standard ST1 Construct a minimum spanning tree for weighted and unweighted graphs

  2. Minimizing costs • Suppose you want to supply a set of houses (say, in a new subdivision) with: • electric power • water • sewage lines • telephone lines • To keep costs down, you could connect these houses with a spanning tree (of, for example, power lines) • However, the houses are not all equal distances apart • To reduce costs even further, you could connect the houses with a minimum-cost spanning tree

  3. 16 16 A B A B 6 6 21 11 11 5 5 19 F C F C 14 33 10 18 18 E D E D A connected, undirected graph A minimum-cost spanning tree Minimum-cost spanning trees • Suppose you have a connected undirected graph with a weight (or cost) associated with each edge • The cost of a spanning tree would be the sum of the costs of its edges • A minimum-cost spanning tree is a spanning tree that has the lowest cost

  4. Kruskal’s algorithm • An algorithm for finding a graph's minimum spanning tree. • Sort the edges of a graph in order from smallest to largest. • Repeatedly add edges that bridge separate components until the graph is fully connected. • By sorting the weights for each edge largest to smallest, the algorithm can also be used to find a maximum spanning tree.

  5. Use Kruskal’s algorithm to construct a minimum spanning tree.

  6. The minimum spanning tree uses the edges 27+30+40+40+42 = 179

  7. Use Kruskal’s algorithm to construct a minimum spanning tree.

  8. The minimum spanning tree uses the edges 1+1+2+2+2+2+3+5 = 18

  9. The End

More Related