CS 310 Unit 20 Single Source Shortest Paths

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

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

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

View Full Document

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

View Full Document

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.

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) • Dijkstra’s 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

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online