lecture 26 - university at buffalo
TRANSCRIPT
![Page 1: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/1.jpg)
Lecture 26
CSE 331Nov 2, 2018
![Page 2: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/2.jpg)
Have fun at UB Hacking!
![Page 3: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/3.jpg)
As will your TAs….
![Page 4: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/4.jpg)
HW 7 is out
Once you understand what Q2 is asking, it’ll be easy
![Page 5: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/5.jpg)
HW 6 Solutions
At the END of the lecture
![Page 6: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/6.jpg)
Video due Monday
![Page 7: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/7.jpg)
Peer evaluation due Wed 11:59pm
![Page 8: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/8.jpg)
Kruskal’s Algorithm
Joseph B. Kruskal
Input: G=(V,E), ce> 0 for every e in E
T = Ø
Sort edges in increasing order of their cost
Consider edges in sorted order
If an edge can be added to T without adding a cycle then add it to T
![Page 9: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/9.jpg)
Prim’s algorithmSimilar to Dijkstra�s algorithm
Input: G=(V,E), ce> 0 for every e in E
S = {s}, T = Ø
While S is not the same as V
Among edges e= (u,w) with u in S and w not in S, pick one with minimum cost
Add w to S, e to T
![Page 10: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/10.jpg)
(Old) History of MST algorithms
1920: Otakar Borůvka 1930: Vojtěch Jarník
1956: Kruskal
1957: Prim 1959: Dijkstra
Same algo!
![Page 11: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/11.jpg)
Some modern Algo Researchers
![Page 12: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/12.jpg)
Can you guess the common link?
![Page 13: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/13.jpg)
Cut Property Lemma for MSTs
S V \ S
Cheapest crossing edge is in all MSTs
Condition: S and V\S are non-empty
Assumption: All edge costs are distinct
![Page 14: Lecture 26 - University at Buffalo](https://reader033.vdocument.in/reader033/viewer/2022060120/6292cca826aa68594f0fc264/html5/thumbnails/14.jpg)
Today’s agenda
Prove correctness of Prim’s+Kruskal�s algorithm using Cut Property Lemma
Prove Cut Property Lemma