MST BoruvkasAlgorithm
MST BoruvkasAlgorithm
Graph Algorithms
Minimum Spanning Tree
A minimum spanning tree is a tree formed
from a subset of the edges in a given
undirected graph, with two properties:
1. It spans the graph, i.e., it includes every
Source: http://www.cs.nthu.edu.tw/~wkhon/algo09/lectures/lecture26.pdf
Example of Minimum Spanning Tree
Problem Statement
Kruskal’s algorithm :
Prim’s algorithm:
History
Boruvka 1926–O(m log n)
Kruskal 1956- O ( m log n)
Prim 1957- O ( m log n)
Yao 1975 – O ( m log log n)
Cheriton and Tarjan 1976 – O ( m log log n)
Fredman and Tarjan 1987 –O (m (m, n))
Gabow 1986 – O(m log (m, n))
Chazelle 1995 – O ( m ( m, n))
Minimum Spanning Forest
A forest F is an acyclic subgraph of G that
consists of a collection of disjoint trees in G;
treat isolated vertices in F as tree of size 1.
A spanning forest is a forest whose trees are
spanning trees for the connected component
of the graph G.
A spanning forest is a spanning tree if and
only if the graph is connected.
A Minimum Spanning Forest is a forest
with minimum weight.
Boruvka
For each vertex of G(V,E), select the minimum-
weight edge incident to the vertex. Contract all
the selected edges, replacing by a single vertex
each connected component defined by the
selected edges and deleting all resulting isolated
vertices, loops (edges both of whose endpoints
are the same), and all but the lowest-weight edge
among each set of multiple edges. Call this new
graph after contraction as G’.
This is called a Boruvka phase.
Apply recursively Boruvka phase on G’.
Example
A G
3 2.1 3.2 1.5
2.2 5.1
B C H I
B H I
H I
2.2
2.3 4 5 2.5 2.6
2.4 3.3
B,D E L J
4.1
1.3 1.2 2.7
F 1.4 K
After Contraction
A,C G
5.1 3.2 1.5
H I
2.2
2.3 4 5 2.5 2.6
1.3 3.3
B,D E,F L J
4.1
2.7
1.4 K
After Contraction
A,C G,H
5.1 1.5
I
4
2.2
2.3 2.5 2.6
1.3 3.3
B,D E,F L J
4.1
2.7
1.4 K
After Contraction
A,C G,H,I
5.1
4
2.2
2.3 2.5
1.3 3.3
B,D E,F L J
4.1
2.7
1.4 K
After Contraction
A,C G,H,I,J
5.1
2.2 2.7
2.3 3.3
2.2 2.7
2.3
2.2 2.7
2.3
2.2 2.7
2.3
1.3
B,D E,F L,K
4.1
2.2 2.7
2.3
1.3
B,D E,F L,K
4.1
2.7
1.3
E,F L,K
4.1
A G
3 2.1 3.2 1.5
2.2 5.1
B C H I
1 3.1 5 2.5
2.3 4
2.4 3.3
D E L J
4.1
1.3 1.2 1.4 2.7
F K
MST
Edges selected = {AC, BD, EF, GH, GI,
GJ, LK, BC, DF, JK,EL}
A G
2.1 3.2 1.5
2.2 C
B H I
1 2.5
D E L J
4.1
1.3 1.2 1.4 2.7
F K
Boruvka
Claim: The graph G’ obtained after one Bouruvka
Phase has at most vertices.