Find Minimum
Spanning Tree(for connected undirected graph)
Tree : connected
graph without cycle
u,v , a path from u to v.
Spanning Tree : edges connect all vertice of G
Lemma
V1 V2 V3 V4 = V
e = (V,W) minimum edge,v Vi ,w Vi
MST include e
proof :
(T - {e'})
e
is spanning
tree of Lower cost.
Kruskal's algorithm
vV , {v}
a
component;
W(e1) W(e2) .......W(eN)
repeat
for i = 1 to N do
add minial edge
across
if add ei Not form
cycle
2
components;
add ei
Until 1
component remains
Prim's algorithm
V1 = visited
V2 = unvisited
e = (v , w)
= minimal edge visited vertex
fringe vertex
Priority - First - Search implementation : Priority = Shortest length to tr