720 likes | 918 Views
Minimum Spanning Trees. GHS Algorithm. Weighted Graph. (MST). Minimum weight spanning tree. The sum of the weights is minimized. For MST :. is minimized. Spanning tree fragment:. Any sub-tree of a MST. Minimum weight outgoing edge. (MWOE).
E N D
Minimum Spanning Trees GHS Algorithm
(MST) Minimum weight spanning tree The sum of the weights is minimized For MST : is minimized
Spanning tree fragment: Any sub-tree of a MST
Minimum weight outgoing edge (MWOE) The adjacent edge to the fragment with the smallest weight that does not create a cycle
Two important properties for building MST The union of a fragment and the MWOE is a fragment Property 1: Property 2: If the weights are unique then the MST is unique
The union of a fragment and the MWOE is a fragment Property 1: Proof: Basic idea Examine if the new fragment is part of a MST
Fragment MWOE Spanning tree If then is fragment
Fragment MWOE Spanning tree If then is fragment
Fragment MWOE Spanning tree then add to If and delete
Fragment MWOE Spanning tree then add to If and delete
Fragment MWOE Spanning tree Since otherwise, wouldn’t be MST
Fragment MWOE Spanning tree thus is fragment END OF PROOF
Property 2: If the weights are unique then the MST is unique Proof: Basic Idea: Suppose there are two MST Then there is another MST of smaller weight Contradiction!
Take the smallest weight edge not in intersection
Cycle in RED MST Not in BLUE MST (since blue tree is acyclic)
Cycle in RED MST Since is not in intersection, (the weight of is the smallest)
Cycle in RED MST Delete and add in RED MST We obtain a new tree with smaller weight Contradiction! END OF PROOF
Prim’s Algorithm Start with a node as an initial fragment Repeat Augment fragment with the MWOE Until no other edge can be added to (Assume unique IDs)
Fragment MWOE
Fragment MWOE
Fragment MWOE
Theorem: Prim’s algorithm gives an MST Proof: Use Property 1 repeatedly END OF PROOF
Kruskal’s Algorithm Initially, each node is a fragment Repeat Find the smallest MWOE of all fragments Merge the two fragments adjacent to Until there is one fragment (Assume unique IDs)
Theorem: Kruskal’s algorithm gives an MST Proof: Use Properties 1 and 2 repeatedly Property 2 guarantees that the merged trees are fragments END OF PROOF
GHS Algorithm Distributed version of Kruskal’s Algorithm Initially, each node is a fragment (A Synchronous Phase) Repeat in parallel: Each fragment finds its MWOE Merge fragments adjacent to MWOE’s Until there is one fragment
Phase 0: Initially, every node is a fragment Every node is a root of a fragment
Phase 1: Merge the fragments Root Root Root Root symmetric MWOE Asymmetric MWOE The new root is adjacent to a symmetric MWOE
Phase 2: Merge the fragments Root Root
Phase 3: New fragment FINAL MST
Rules for selecting a Root in fragment Fragment 2 Fragment 1 root root MWOE
Rules for selecting a Root in fragment Merged Fragment root Higher ID Node on MWOE
Rules for selecting a Root in fragment root root root root root root root Merging more than 2 fragments
Rules for selecting a Root in fragment Merged Fragment Root Higher ID Node on symmetric MWOE asymmetric