{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# lecture12 - CS 473 Algorithms Chandra Chekuri...

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

CS 473: Algorithms Chandra Chekuri [email protected] 3228 Siebel Center University of Illinois, Urbana-Champaign Fall 2009 Chekuri CS473ug

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

View Full Document
Part I All Pairs Shortest Paths Chekuri CS473ug
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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
Shortest Paths and Recursion Can we compute the shortest path distance from s to t recursively? What are the smaller sub-problems? Chekuri CS473ug

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

View Full Document
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
Shortest Paths and Recursion Can we compute the shortest path distance from s to t recursively?

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}