09 - Dijkstra's Shortest Path Algorithm

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

Info iconThis preview shows pages 1–8. 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
Background image of page 1

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

View Full DocumentRight 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
Background image of page 2
Shortest Path Problem for Weighted Graphs Let G = ( V , E ) be a weighted digraph, with weight function w : E 7→ 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 = h v 0 , v 1 , ..., v k i is the sum of the weights of its constituent edges: length( p ) = k X i =1 w ( v i - 1 , v i ) . Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Background image of page 3

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

View Full DocumentRight 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( h a , b , c , e i ) = 6; distance from a to e is 6 Lecture 9: Dijkstra’s Shortest Path Algorithm Part II: Graph Algorithms
Background 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
Background image of page 5

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

View Full DocumentRight 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
Background image of page 6
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
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/18/2009 for the course COMP 271 taught by Professor Arya during the Spring '07 term at HKUST.

Page1 / 28

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

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online