Download presentation
Presentation is loading. Please wait.
1
CS200: Algorithm Analysis
2
GREEDY CHOICE PROPERTY
A locally optimal greedy solution => a globally optimal solution. Problem : Minimum Weight Spanning Tree (MST) Revolves around the idea of spanning trees. Undirected, connected graph G = (V,E). Weight function w : E–>R.
3
MST
4
Example MST
5
Example MST
6
Another MST Example
7
w(T) = S(w(u,v) is minimized).
What we want is a MST T : w(T) = S(w(u,v) is minimized). (u,v) in T 1. Optimal substructure: optimal tree has optimal sub-trees.
8
Optimal Substructure
9
Optimal Substructure
10
Optimal Substructure
11
Optimal Substructure
12
Claim: T1 is MST of G1 = (V1,E1), the sub-graph of G with vertices in T1. (V1= vertices in T1, E1 = {(u,v) in E : (u,v) in V1}). T2 is MST of G2 (description similar to above)
13
Proof of Optimal Substructure
14
Proof of Optimal Substructure
15
Proof of Optimal Substructure
16
Hallmark of Greedy Algorithms
17
Hallmark of Greedy Algorithms
18
Proof of Theorem
19
Proof of Theorem
20
Proof of Theorem
21
Proof of Theorem
22
Proof of Theorem
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.