CS 310 Unit 20 Single Source Shortest Paths

CS 310 Unit 20 Single Source Shortest Paths - CS 310 Unit...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: CS 310 Unit 20 Single Source Shortest Paths Furman Haddix Ph.D. Assistant Professor Minnesota State University, Mankato Spring 2008 Single Source Shortest Paths Objectives Introduction to Single Source Shortest Paths (SSSP) SSSP in Directed Acyclic Graph (DAG) Dijkstras Algorithm Bellman-Ford Algorithm Text 24.1, 24.2, 24.3 Introduction to Single Source Shortest Paths For single source shortest paths problems we consider a weighted graph, G(V, E) with a weight function w(E) = the set of real numbers Although shortest paths can be defined in multiple ways, we limit ourselves here to the path between two vertices for which the sum of the weights for the edges traversed is minimal For individual algorithms we may impose further limitations on the graph: Directed Acyclic Non-negative or positive weights For all algorithms, we require that the graph have no negative weight cycles This would lead to repeated traversals of the negative weight cycle with each traversal yielding a shorter Related Problems Related problems solvable with the single source algorithms: Single source shortest path in an unweighted graph Recall that the breadth-first search algorithm provides a single source shortest path in an unweighted directed (or undirected graph) Single-destination shortest path reverse direction of each edge Single-pair shortest path no asymptotically better solution than single source exists for this problem All-pairs shortest path Unit 21 addresses this problem better solutions exist than iterating single source algorithms SSSP Concepts Cycles Some algorithms can deal with zero-weight or positive-weight cycles. Shortest paths For some applications, computing the shortest distance is not enough, we need to preserve the route; this is facilitated by maintaining a predecessor or parent subgraph. SSSP Tools Relaxation There are two cases: There is no path between two vertices (s, v) There is a path between two vertices (s, v) and this path has a shortest-path weight (s, v) The algorithms herein are based on the following approach: find a path and its weight d.v by relaxation (successively testing each possible subpath) determine if there is a smaller d.v when all (feasible) possibilities have been tested d.v = (s, v) Triangle inequality For any edge (u, v) E, (s, v) (s, u) + w(u, v) Predecessor subgraph The predecessor subgraph is a shortest-paths tree rooted at s if d.v = (s, v) for v V Overview of three algorithms...
View Full Document

Page1 / 68

CS 310 Unit 20 Single Source Shortest Paths - CS 310 Unit...

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

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