Lecture 24 CSE 331 Oct 29, 2018.

Slides:



Advertisements
Similar presentations
Precedence Constrained Scheduling Abhiram Ranade Dept. of CSE IIT Bombay.
Advertisements

Lecture 13 CSE 331 Oct 2, Announcements Please turn in your HW 3 Graded HW2, solutions to HW 3, HW 4 at the END of the class Maybe extra lectures.
CSE 780 Algorithms Advanced Algorithms SSSP Dijkstra’s algorithm SSSP in DAGs.
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 39 CSE 331 Dec 9, Announcements Please fill in the online feedback form Sample final has been posted Graded HW 9 on Friday.
Dijkstra’s Algorithm Slide Courtesy: Uwash, UT 1.
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 13 CSE 331 Oct 2, Announcements Mid term in < 2 weeks Graded HW2 at the END of the class.
Lecture 11 CSE 331 Sep 25, Homeworks Please hand in your HW 2 now HW 3 and graded HW 1 at the end of class.
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
Prof. Swarat Chaudhuri COMP 482: Design and Analysis of Algorithms Spring 2012 Lecture 10.
CSE 331: Review. Main Steps in Algorithm Design Problem Statement Algorithm Real world problem Problem Definition Precise mathematical def “Implementation”
Introduction to Algorithms Jiafen Liu Sept
Lecture 38 CSE 331 Dec 2, Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.
Lecture 23 CSE 331 Oct 24, Reminder 2 points for Piazza participation 3 points for mini-project.
CSE 421 Algorithms Richard Anderson Lecture 8 Optimal Caching Dijkstra’s algorithm.
Lecture 12 CSE 331 Sep 28, Upcoming Important Dates Tuesday Oct 8 (~1.5 weeks) Mini Project group compositions Monday Oct 12 (2 weeks) Quiz 1 Monday.
Graph Algorithms BFS, DFS, Dijkstra’s.
Lecture 23 CSE 331 Oct 26, 2016.
Lecture 21 CSE 331 Oct 21, 2016.
Lecture 24 CSE 331 Oct 28, 2016.
Lecture 24 CSE 331 Oct 27, 2017.
Lecture 21 CSE 331 Oct 20, 2017.
Autumn 2016 Lecture 9 Dijkstra’s algorithm
Algorithms (2IL15) – Lecture 5 SINGLE-SOURCE SHORTEST PATHS
Autumn 2015 Lecture 9 Dijkstra’s algorithm
Lecture 13 CSE 331 Oct 1, 2012.
Lecture 24 CSE 331 Oct 25, 2013.
Richard Anderson Lecture 9 Dijkstra’s algorithm
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.
Richard Anderson Lecture 9 Dijkstra’s algorithm
Advanced Algorithms Analysis and Design
Lecture 26 CSE 331 Nov 2, 2012.
Lecture 13 Algorithm Analysis
Lecture 13 Algorithm Analysis
Lecture 22 CSE 331 Oct 24, 2016.
Lecture 13 Algorithm Analysis
Lecture 12 CSE 331 Sep 28, 2012.
Lecture 12 CSE 331 Sep 26, 2011.
Slide Courtesy: Uwash, UT
Lecture 25 CSE 331 Oct 27, 2014.
Lecture 13 Algorithm Analysis
Lecture 22 CSE 331 Oct 15, 2014.
Lecture 11 CSE 331 Sep 23, 2011.
Lecture 11 CSE 331 Sep 19, 2014.
Chapter 24: Single-Source Shortest Paths
Lecture 24 CSE 331 Oct 24, 2014.
Weighted Graphs & Shortest Paths
Lecture 11 CSE 331 Sep 21, 2017.
Autumn 2016 Lecture 10 Minimum Spanning Trees
Lecture 12 CSE 331 Sep 22, 2014.
Advanced Algorithms Analysis and Design
Slide Courtesy: Uwash, UT
Lecture 23 CSE 331 Oct 24, 2011.
Winter 2019 Lecture 9 Dijkstra’s algorithm
Lecture 26 CSE 331 Nov 1, 2010.
Chapter 24: Single-Source Shortest Paths
CSE 417: Algorithms and Computational Complexity
Lecture 11 CSE 331 Sep 22, 2016.
Lecture 25 CSE 331 Oct 28, 2011.
Winter 2019 Lecture 10 Minimum Spanning Trees
Lecture 15 CSE 331 Oct 4, 2010.
Single-Source Shortest Path & Minimum Spanning Trees
Data Structures and Algorithm Analysis Lecture 8
Lecture 36 CSE 331 Nov 22, 2013.
Autumn 2019 Lecture 9 Dijkstra’s algorithm
Presentation transcript:

Lecture 24 CSE 331 Oct 29, 2018

Mini Project video due in 1 week

Peer Evaluation Survey Some more details by Tuesday

HW 5 grading delayed (more) New plan to get it done by tonight

Re-grade deadlines

Mid-term temp grades

One-on-one meeting slots

Shortest Path Problem http://xkcd.com/85/

Another more important application Is BGP a known acronym for you? Routing uses shortest path algorithm

Shortest Path problem s 100 Input: Directed graph G=(V,E) w 15 5 s u w 100 Input: Directed graph G=(V,E) Edge lengths, le for e in E “start” vertex s in V 15 5 s u w 5 s u Output: Length of shortest paths from s to all nodes in V

Dijkstra’s shortest path algorithm E. W. Dijkstra (1930-2002)

Towards Dijkstra’s algo: part ek Determine d(t) one by one s d(s) = 0 u x y

Towards Dijkstra’s algo: part do Determine d(t) one by one s Let u be a neighbor of s with smallest l(s,u) 3 4 100 u x y d(u) = l(s,u)   Not making any claim on other vertices

Towards Dijkstra’s algo: part teen Determine d(t) one by one R Assume we know d(v) for evert v in R s u x y w Compute an upper bound d’(w) for every w not in R d(w)   d(u) + l(u,w) d(w) d(x) + l(x,w)   d’(w) = min e=(u,w) in E, u in R d(u)+le d(w) d(y) + l(y,w)  

Dijkstra’s shortest path algorithm 1 d’(w) = min e=(u,w) in E, u in R d(u)+le 1 2 4 3 y 4 3 u d(s) = 0 d(u) = 1 s x 2 4 d(w) = 2 d(x) = 2 d(y) = 3 d(z) = 4 w z 5 4 2 s w Input: Directed G=(V,E), le ≥ 0, s in V u R = {s}, d(s) =0 Shortest paths x While there is a x not in R with (u,x) in E, u in R z y Pick w that minimizes d’(w) Add w to R d(w) = d’(w)

Couple of remarks The Dijkstra’s algo does not explicitly compute the shortest paths Can maintain “shortest path tree” separately Dijkstra’s algorithm does not work with negative weights Left as an exercise

Rest of Today’s agenda Prove the correctness of Dijkstra’s Algorithm Runtime analysis of Dijkstra’s Algorithm