Lecture 25 CSE 331 Oct 28, 2011.

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.
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.
Lecture 27 CSE 331 Nov 3, Combining groups Groups can unofficially combine in the lectures.
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
Lecture 27 CSE 331 Nov 6, Homework related stuff Solutions to HW 7 and HW 8 at the END of the lecture Turn in HW 7.
Minimum Spanning Trees
9/10/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 8 Greedy Graph.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
Minimum spanning trees (MST) Def: A spanning tree of a graph G is an acyclic subset of edges of G connecting all vertices in G. A sub-forest of G is an.
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
Minimum Spanning Trees CSE 373 Data Structures Lecture 21.
Minimum Spanning Trees
Graph Algorithms BFS, DFS, Dijkstra’s.
Lecture 26 CSE 331 Nov 2, 2016.
Lecture 22 Minimum Spanning Tree
Lecture 23 CSE 331 Oct 26, 2016.
Autumn 2016 Lecture 11 Minimum Spanning Trees (Part II)
Graph Algorithm.
Lecture 15 CSE 331 Oct 5, 2012.
Minimum-Cost Spanning Tree
Lecture 21 CSE 331 Oct 21, 2016.
Minimum Spanning Trees
Minimum Spanning Tree.
Lecture 24 CSE 331 Oct 28, 2016.
Lecture 24 CSE 331 Oct 27, 2017.
Autumn 2015 Lecture 11 Minimum Spanning Trees (Part II)
Lecture 21 CSE 331 Oct 20, 2017.
Minimum-Cost Spanning Tree
Lecture 24 CSE 331 Oct 25, 2013.
Lecture 26 CSE 331 Nov 1, 2017.
Chapter 23 Minimum Spanning Tree
Lecture 22 CSE 331 Oct 23, 2017.
Lecture 23 CSE 331 Oct 25, 2017.
Lecture 24 CSE 331 Oct 29, 2012.
Lecture 23 CSE 331 Oct 24, 2011.
Lecture 26 CSE 331 Nov 2, 2012.
Lecture 22 CSE 331 Oct 24, 2016.
Autumn 2015 Lecture 10 Minimum Spanning Trees
Lecture 37 CSE 331 Nov 30, 2011.
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
Lecture 22 CSE 331 Oct 15, 2014.
Lecture 18 CSE 331 Oct 9, 2017.
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
CSE 373: Data Structures and Algorithms
Lecture 24 CSE 331 Oct 24, 2014.
Lecture 36 CSE 331 Nov 30, 2012.
Autumn 2016 Lecture 10 Minimum Spanning Trees
Lecture 23 CSE 331 Oct 24, 2011.
Lecture 26 CSE 331 Nov 1, 2010.
Minimum spanning trees
Prim’s algorithm for minimum spanning trees
Winter 2019 Lecture 10 Minimum Spanning Trees
CSE 373: Data Structures and Algorithms
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Minimum-Cost Spanning Tree
Lecture 27 CSE 331 Nov 1, 2013.
Lecture 36 CSE 331 Nov 22, 2013.
More Graphs Lecture 19 CS2110 – Fall 2009.
Lecture 24 CSE 331 Oct 29, 2018.
Presentation transcript:

Lecture 25 CSE 331 Oct 28, 2011

HW 6 due today I will not take any HW after 1:15pm Q1, Q2 and Q3 in separate piles I will not take any HW after 1:15pm

Other HW related stuff HW 5 will be available for pickup from Monday Solutions to HW 6 at the end of the lecture HW 7 has been posted (link on the blog)

Dijkstra’s shortest path algorithm d’(v) = min e=(u,v) in E, u in S d(u)+le Input: Directed G=(V,E), le ≥ 0, s in V S = {s}, d(s) =0 While there is a v not in S with (u,v) in E, u in S At most n iterations Pick w that minimizes d’(w) Add w to S d(w) = d’(w) O(m) time O(mn) time bound is trivial O(m log n) time implementation is possible

Reading Assignment Sec 4.4 of [KT]

Building a fiber network Lay down fibers to connect n locations All n locations should be connected Laying down a fiber costs money What is the cheapest way to lay down the fibers?

Today’s agenda Minimum Spanning Tree (MST) Problem Greedy algorithm(s) for MST problem

HW 6 due today I will not take any HW after 1:15pm Q1, Q2 and Q3 in separate piles I will not take any HW after 1:15pm

Kruskal’s Algorithm Input: G=(V,E), ce> 0 for every e in E T = Ø Sort edges in increasing order of their cost Joseph B. Kruskal 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 2 1 3 51 50 0.5 Robert Prim 2 0.5 Input: G=(V,E), ce> 0 for every e in E 1 50 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

Reverse-Delete Algorithm 2 1 3 51 50 0.5 Input: G=(V,E), ce> 0 for every e in E 2 0.5 T = E 1 3 50 Sort edges in decreasing order of their cost 51 Consider edges in sorted order If an edge can be removed T without disconnecting T then remove it

(Old) History of MST algorithms 1920: Otakar Borůvka 1930: Vojtěch Jarník Same algo! 1956: Kruskal 1957: Prim 1959: Dijkstra