Presentation is loading. Please wait.

Presentation is loading. Please wait.

Minimum Spanning Trees Easy. Terms Node Node Edge Edge Cut Cut Cut respects a set of edges Cut respects a set of edges Light Edge Light Edge Minimum Spanning.

Similar presentations


Presentation on theme: "Minimum Spanning Trees Easy. Terms Node Node Edge Edge Cut Cut Cut respects a set of edges Cut respects a set of edges Light Edge Light Edge Minimum Spanning."— Presentation transcript:

1 Minimum Spanning Trees Easy

2 Terms Node Node Edge Edge Cut Cut Cut respects a set of edges Cut respects a set of edges Light Edge Light Edge Minimum Spanning Tree Minimum Spanning Tree

3 Generic Algorithm 1. Start with an empty set of edges. 2. Continuously add only edges that are part of a minimum spanning tree 3. Stop when we have a minimum spanning tree.

4 Kruskal’s Algorithm 1. Find the smallest edge in the graph. 2. If it connects two unconnected sets, add it. 3. Repeat for each edge. What are the optimal data structures? What are the optimal data structures? O( E lg V) O( E lg V) E = # edges E = # edges V = # nodes (vertices) V = # nodes (vertices)

5

6 Prim’s Algorithm 1. Start with a set of 1 nodes: V and empty set of edges A 2. Pick a light edge and add it to A. 3. Repeat until all nodes are in V. Best Data Structures? Best Data Structures? O(E lg V) or O(E+V lg V) O(E lg V) or O(E+V lg V)

7

8 Other Algorithms Bor ů vka's algorithm, O( E lg V ) Bor ů vka's algorithm, O( E lg V ) Bernard Chazelle, O( E α(V)) Bernard Chazelle, O( E α(V)) Randomized, expected O(E) Randomized, expected O(E) Karger, Klein, and Tarjan

9 Distributed MST LAN 1 LAN 2 LAN 3 B1 B2 B3 B4


Download ppt "Minimum Spanning Trees Easy. Terms Node Node Edge Edge Cut Cut Cut respects a set of edges Cut respects a set of edges Light Edge Light Edge Minimum Spanning."

Similar presentations


Ads by Google