130 likes | 265 Views
Analysis of Algorithms. Minimum Spanning Trees. Uri Zwick February 2014. Find a minimum spanning tree. 11. 16. 22. 17. 5. 8. 1. 13. 3. 18. 30. 12. 25. 9. 2. 15. Kruskal’s algorithm. 11. 16. 22. 17. 5. 8. 1. 13. 3. 18. 30. 12. 25. 9. 2. 15. Prim’s algorithm.
E N D
Analysis of Algorithms Minimum Spanning Trees Uri Zwick February 2014
Find a minimum spanning tree 11 16 22 17 5 8 1 13 3 18 30 12 25 9 2 15
Kruskal’s algorithm 11 16 22 17 5 8 1 13 3 18 30 12 25 9 2 15
Prim’s algorithm 11 16 22 17 5 8 1 13 3 18 30 12 25 9 2 15
Boruvka’s algorithm 11 16 22 17 5 8 1 13 3 18 30 12 25 9 2 15
MST verification 11 16 22 17 5 8 1 13 3 18 30 12 25 9 2 15
Comparison-based MST algorithms Deterministic Rand.
Assume for simplicity that all edge weights are distinct The MST is then unique
Cut rule S VS The lightest edge in a cut is contained in the MST
Cycle rule C The heaviest edge on a cycle is not contained in the MST
Cuts andcycles The intersection between a cut and a cycle is of even size
Fundamental cycles Tree + non-tree edge unique cycle The removal of any tree edge on the cyclegenerates a new tree
Cut rule - proof S VS w' w w < w' The lightest edge in a cut is contained in the MST