{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

09 - Dijkstra's Shortest Path Algorithm

09 - Dijkstra's Shortest Path Algorithm - Part II Graph...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Part II: Graph Algorithms Lecture 9: Dijkstra’s Shortest Path Algorithm Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Objective and Outline Objective : Discuss a third graph problem: single-source shortest parths Reference : Section 24.3 of CLRS Outline : The single-source shortest paths problem Dijkstra’s algorithm Example Correctness Running time Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 2
Shortest Path Problem for Weighted Graphs Let G = ( V , E ) be a weighted digraph, with weight function w : E R mapping edges to real-valued weights If e = ( u , v ), we write w ( u , v ) for w ( e ). Definition The length of a path p = v 0 , v 1 , ..., v k is the sum of the weights of its constituent edges: length( p ) = k i =1 w ( v i - 1 , v i ) . Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Distance Definition The distance from u to v , denoted δ ( u , v ), is the length of the minimum length path if there is a path from u to v ; and is otherwise. Example length( a , b , c , e ) = 6; distance from a to e is 6 Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 4
Single-Source Shortest-Paths Problem Definition (Single-source shortest-paths problem) Given a digraph with non-negative edge weights G = ( V , E ) and a designated source vertex , s V , determine the distance and a shortest path from the source vertex to every vertex in the digraph. Question How do you design an efficient algorithm for this problem? Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Outline The single-source shortest paths problem Dijkstra’s algorithm Example Correctness Running time Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 6
The Rough Idea of Dijkstra’s Algorithm Maintain d [ v ] and S : d [ v ] is an estimate of the length δ ( s , v ) of the shortest path for each vertex v . S V is a subset of vertices for which we know the true distance , that is d [ v ] = δ ( s , v ). Initially S = d [ s ] = 0 and d [ v ] = for all others vertices v . One by one we select vertices from V \ S to add to S . Questions to answer at each step: 1 Which vertex do we select? 2 How do we update the distance estimates after a vertex is added to S ? Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Selection of vertex Question How does the algorithm select which vertex among the vertices of V \ S to process next?
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern