1 / 10

Lecture 23

Lecture 23. CSE 331 Oct 25, 2017. Graded pitch. PAY ATTENTION TO THE COMMENTS. 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. s. s. 100.

ruthrandall
Télécharger la présentation

Lecture 23

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 23 CSE 331 Oct 25, 2017

  2. Graded pitch PAY ATTENTION TO THE COMMENTS

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

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

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

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

  7. Dijkstra’s shortest path algorithm 1 d’(w) = min e=(u,w) in E, u in Rd(u)+le 3 3 y 4 u 1 1 1 d(s) = 0 d(u) = 1 4 s x 4 2 d(w) = 2 d(x) = 2 2 2 d(y) = 3 d(z) = 4 2 w z 5 4 3 2 s Input: Directed G=(V,E), le ≥ 0, s in V w 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 Pick w that minimizes d’(w) Add w to R z y d(w) = d’(w)

  8. 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

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

  10. Reading Assignment Sec 4.4 of [KT]

More Related