Analysis of Algorithms Minimum Spanning Trees Uri Zwick February 2014 1 Find a minimum spanning tree 11 16 22 5 17 8 1 13 18 12 3 30 25 9 2 15 2 Kruskal’s algorithm 11 16 22 5 17 8 1 13 18 12 3 30 25 9 2 15 3 Prim’s algorithm 11 16 22 5 17 8 1 13 18 12 3 30 25 9 2 15 4 Boruvka’s algorithm 11 16 22 5 17 8 1 13 18 12 3 30 25 9 2 15 5 MST verification 11 16 22 5 17 8 1 13 18 12 3 30 25 9 2 15 6 Comparison-based MST algorithms Running time Kruskal (1956) Prim (1957) Boruvka (1926) Gabow-GalilSpencer-Tarjan (1986) Chazelle (2000) Karger-Klein-Tarjan (1995) O(m logn) O(m + n logn) O(m logn) O(m log (m,n)) Deterministic Algorithm O(m (m,n)) Rand. O(m + n) Assume for simplicity that all edge weights are distinct The MST is then unique S Cut rule 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 and cycles 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 cycle generates a new tree Cut rule - proof S VS w' w w < w' The lightest edge in a cut is contained in the MST
© Copyright 2024 Paperzz