1
CSE 421
Algorithms
Richard Anderson
Lecture 10
Minimum Spanning Trees
Minimum Spanning Tree
a
b
c
s
e
g
f
9
2
13
6
4
11
5
7
20
14
t
u
v
15
10
1
8
12
16
22
17
3
Undirected Graph
G=(V,E) with edge
weights
Greedy Algorithms for Minimum
Spanning Tree
•[
P
r
im
]
Extend a tree by
including the cheapest
out going edge
• [Kruskal]
Add the
cheapest edge that joins
disjoint components
• [ReverseDelete]
Delete
the most expensive edge
that does not disconnect
the graph
4
11
5
7
20
8
22
a
b
c
d
e
Why do the greedy algorithms
work?
• For simplicity, assume all edge costs are
distinct
Edge inclusion lemma
• Let S be a subset of V, and suppose e =
(u, v) is the minimum cost edge of E, with
u in S and v in VS
• e is in every minimum spanning tree of G
– Or equivalently, if e is not in T, then T is not a
minimum spanning tree
SV

S
e
Proof
• Suppose T is a spanning tree that does not contain e
• Add e to T, this creates a cycle
• The cycle must have some edge e
1
= (u
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '06
 RichardAnderson
 Algorithms, Graph Theory, Spanning tree, Kruskal, minimum cost edge

Click to edit the document details