Professional Documents
Culture Documents
CSE 5311
Lecture 20 Minimum Spanning Tree
a 1
3 -3
d e f
0
A := ∅;
while A not complete tree do
find a safe edge (u, v);
A := A ∪ {(u, v)}
od
a
5
b 7 c
a light edge crossing cut
(could be more than one)
1 -3
11 3
⇐cut partitions vertices into
d
0
e
2
f disjoint sets, S and V – S.
Not in tree
a/0 5 b/∞ 7 c/∞
11 3 1 -3 Q=a b c d e f
0 ∞ ∞
d/∞ e/∞ f/∞
0 2
11 3 1 -3 Q=b d c e f
5 11 ∞ ∞
d/11 e/∞ f/∞
0 2
11 3 1 -3 Q=e c d f
3 7 11 ∞
d/11 e/3 f/∞
0 2
11 3 1 -3 Q=d c f
0 1 2
d/0 e/3 f/2
0 2
11 3 1 -3 Q=c f
1 2
d/0 e/3 f/2
0 2
11 3 1 -3 Q=f
-3
d/0 e/3 f/-3
0 2
11 3 1 -3 Q=∅
d/0 e/3 f/-3
0 2
3 1 -3
• T’ is an MST: We have
w(T’) = w(T) - w(x,y) + w(u,v)
Since (u,v) is a light edge crossing the cut, we have w(u,v) ≤
w(x,y). Thus w(T’) ≤ w(T). So T’ is also a minimum
spanning tree.
• A ∪ {(u,v)} ⊆ T’: Remember that (x, y) is not in A. Thus
A ⊆ T - {(x, y)}, and thus
A ∪ {(u,v)} ⊆ T - {(x, y)} ∪ {(u,v)} = T’