This preview shows pages 1–7. Sign up to view the full content.
CSE 421
Algorithms
Richard Anderson
Lecture 10
Minimum Spanning Trees
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 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
•
[Prim]
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
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 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
S
V  S
e
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 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
, v
1
) with u
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 02/25/2012 for the course CSE 421 taught by Professor Richardanderson during the Fall '06 term at University of Washington.
 Fall '06
 RichardAnderson
 Algorithms

Click to edit the document details