Lecture 27 CSE 331 Nov 6, 2009. Homework related stuff Solutions to HW 7 and HW 8 at the END of the lecture Turn in HW 7.

Slides:



Advertisements
Similar presentations
7.3 Kruskal’s Algorithm. Kruskal’s Algorithm was developed by JOSEPH KRUSKAL.
Advertisements

Lecture 26 CSE 331 Nov 4, The week of Nov 16 Jeff will be out of town for a conference Recitations and office hour cancelled for that week Two extra.
CSE 421 Algorithms Richard Anderson Dijkstra’s algorithm.
Lecture 28 CSE 331 Nov 9, Flu and HW 6 Graded HW 6 at the END of the lecture If you have the flu, please stay home Contact me BEFORE you miss a.
DAST 2005 Tirgul 14 (and more) sample questions. DAST 2005 (reminder?) Kruskal’s MST Algorithm.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Minimum Spanning Trees CIS 606 Spring Problem A town has a set of houses and a set of roads. A road connects 2 and only 2 houses. A road connecting.
CSE 326: Data Structures Spanning Trees Ben Lerner Summer 2007.
CSE 421 Algorithms Richard Anderson Lecture 10 Minimum Spanning Trees.
Lecture 24 CSE 331 Oct 30, Homework stuff Please turn in your HW 6 Graded HW 5 and HW 7 at the END of the lecture.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 10 Instructor: Paul Beame.
Lecture 27 CSE 331 Nov 3, Combining groups Groups can unofficially combine in the lectures.
T,  e  T c(e) = 50 G = (V, E), c(e) Minimum Spanning Tree.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
Minimum Spanning Trees
Lecture 25 CSE 331 Nov 2, Adding teeth to group talk Form groups of size at most six (6) Pick a group leader I will ask group leader(s) to come.
Lecture 28 CSE 331 Nov 5, HW 7 due today Q1 in one pile and Q 2+3 in another I will not take any HW after 1:15pm.
Lecture 30 CSE 331 Nov 10, Online Office Hours
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
1.1 Data Structure and Algorithm Lecture 13 Minimum Spanning Trees Topics Reference: Introduction to Algorithm by Cormen Chapter 13: Minimum Spanning Trees.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms: Minimum.
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
Dijkstra’s Algorithm. Announcements Assignment #2 Due Tonight Exams Graded Assignment #3 Posted.
Lecture 19 Greedy Algorithms Minimum Spanning Tree Problem.
Minimum- Spanning Trees
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 11.
Data Structures & Algorithms Graphs Richard Newman based on book by R. Sedgewick and slides by S. Sahni.
Kruskal’s Algorithm for Computing MSTs Section 9.2.
Minimum Spanning Trees
May 12th – Minimum Spanning Trees
Minimum Spanning Tree Chapter 13.6.
Minimum Spanning Trees
Lecture 26 CSE 331 Nov 2, 2016.
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Data Structures & Algorithms Graphs
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Minimum Spanning Tree.
Minimum Spanning Trees
Minimum Spanning Tree.
Lecture 24 CSE 331 Oct 28, 2016.
Lecture 24 CSE 331 Oct 27, 2017.
Chapter 7: Greedy Algorithms
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Lecture 24 CSE 331 Oct 25, 2013.
Lecture 26 CSE 331 Nov 1, 2017.
Chapter 23 Minimum Spanning Tree
Hannah Tang and Brian Tjaden Summer Quarter 2002
Lecture 26 CSE 331 Nov 2, 2012.
Autumn 2015 Lecture 10 Minimum Spanning Trees
MA/CSSE 473 Day 33 Student Questions Change to HW 13
Lecture 27 CSE 331 Oct 31, 2014.
Lecture 25 CSE 331 Oct 28, 2013.
Lecture 25 CSE 331 Oct 27, 2014.
Lecture 28 CSE 331 Nov 7, 2012.
Lecture 27 CSE 331 Nov 2, 2010.
Richard Anderson Lecture 10 Minimum Spanning Trees
CSE 373: Data Structures and Algorithms
Lecture 24 CSE 331 Oct 24, 2014.
Autumn 2016 Lecture 10 Minimum Spanning Trees
Minimum spanning trees
Minimum Spanning Trees (MSTs)
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Lecture 25 CSE 331 Oct 28, 2011.
Prim’s algorithm for minimum spanning trees
Winter 2019 Lecture 10 Minimum Spanning Trees
CSE 373: Data Structures and Algorithms
Lecture 14 Minimum Spanning Tree (cont’d)
Lecture 27 CSE 331 Nov 1, 2013.
Autumn 2019 Lecture 11 Minimum Spanning Trees (Part II)
Presentation transcript:

Lecture 27 CSE 331 Nov 6, 2009

Homework related stuff Solutions to HW 7 and HW 8 at the END of the lecture Turn in HW 7

Kruskal’s Algorithm Joseph B. Kruskal Input: G=(V,E), c e > 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

Prim’s algorithm Similar to Dijkstra’s algorithm Input: G=(V,E), c e > 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

Crucial Lemma for MSTs S S V \ S Cheapest crossing edge is in all MSTs Condition: S and V\S are non-empty Assumption: All edge costs are distinct

S S V \ S Optimality of Kruskal’s Algorithm Input: G=(V,E), c e > 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 S S Nodes connected to red in (V,T) S is non-empty V\S is non-empty First crossing edge considered

Kruskal’s algo outputs MST Group talk time!

Is (V,T) a spanning tree? No cycles by design Just need to show that (V,T) is connected S’ V \ S’ No edges here G is disconnected!

Crucial Lemma for MSTs S S V \ S Cheapest crossing edge is in all MSTs Condition: S and V\S are non-empty

Optimality of Prim’s algorithm Input: G=(V,E), c e > 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 S is already defined for us! S not Ø By induction, show that (S,T) is a tree

Prove the Crucial Lemma S S V \ S Cheapest crossing edge is in all MSTs Condition: S and V\S are non-empty