{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture12 - CS 473 Algorithms Chandra Chekuri...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 473: Algorithms Chandra Chekuri [email protected] 3228 Siebel Center University of Illinois, Urbana-Champaign Fall 2009 Chekuri CS473ug
Background image of page 1

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

View Full Document Right Arrow Icon
Part I All Pairs Shortest Paths Chekuri CS473ug
Background image of page 2
Shortest Path Problems Shortest Path Problems Input A (undirected or directed) graph G = ( V , E ) with edge lengths (or costs). For edge e = ( u , v ), ( e ) = ( u , v ) is its length. Given nodes s , t find shortest path from s to t . Given node s find shortest path from s to all other nodes. Find shortest paths for all pairs of nodes. Chekuri CS473ug
Background image of page 3

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

View Full Document Right Arrow Icon
Single-Source Shortest Paths Single-Source Shortest Path Problems Input A (undirected or directed) graph G = ( V , E ) with edge lengths. For edge e = ( u , v ), ( e ) = ( u , v ) is its length. Given nodes s , t find shortest path from s to t . Given node s find shortest path from s to all other nodes. Chekuri CS473ug
Background image of page 4
Single-Source Shortest Paths Single-Source Shortest Path Problems Input A (undirected or directed) graph G = ( V , E ) with edge lengths. For edge e = ( u , v ), ( e ) = ( u , v ) is its length. Given nodes s , t find shortest path from s to t . Given node s find shortest path from s to all other nodes. Dijkstra’s algorithm for non-negative edge lengths. Running time: O (( m + n ) log n ) with heaps and O ( m + n log n ) with advanced priority queues. Bellman-Ford algorithm for arbitrary edge lengths. Running time: O ( nm ). Chekuri CS473ug
Background image of page 5

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

View Full Document Right Arrow Icon
All-Pairs Shortest Paths All-Pairs Shortest Path Problem Input A (undirected or directed) graph G = ( V , E ) with edge lengths. For edge e = ( u , v ), ( e ) = ( u , v ) is its length. Find shortest paths for all pairs of nodes. Chekuri CS473ug
Background image of page 6
All-Pairs Shortest Paths All-Pairs Shortest Path Problem Input A (undirected or directed) graph G = ( V , E ) with edge lengths. For edge e = ( u , v ), ( e ) = ( u , v ) is its length. Find shortest paths for all pairs of nodes. Apply single-source algorithms n times, once for each vertex. Non-negative lengths. O ( nm log n ) with heaps and O ( nm + n 2 log n ) using advanced priority queues. Arbitrary edge lengths: O ( n 2 m ). Chekuri CS473ug
Background image of page 7

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

View Full Document Right Arrow Icon
All-Pairs Shortest Paths All-Pairs Shortest Path Problem Input A (undirected or directed) graph G = ( V , E ) with edge lengths. For edge e = ( u , v ), ( e ) = ( u , v ) is its length. Find shortest paths for all pairs of nodes. Apply single-source algorithms n times, once for each vertex. Non-negative lengths. O ( nm log n ) with heaps and O ( nm + n 2 log n ) using advanced priority queues. Arbitrary edge lengths: O ( n 2 m ). Can we do better? Chekuri CS473ug
Background image of page 8
Shortest Paths and Recursion Can we compute the shortest path distance from s to t recursively? What are the smaller sub-problems? Chekuri CS473ug
Background image of page 9

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

View Full Document Right Arrow Icon
Shortest Paths and Recursion Can we compute the shortest path distance from s to t recursively? What are the smaller sub-problems? Lemma Let G be a directed graph with arbitrary edge lengths. If s = v 0 v 1 v 2 . . . v k is a shortest path from s to v k then for 1 i < k: s = v 0 v 1 v 2 . . . v i is a shortest path from s to v i Chekuri CS473ug
Background image of page 10
Shortest Paths and Recursion Can we compute the shortest path distance from s to t recursively?
Background image of page 11

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

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}