{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# rec14 - 6.006 Intro to Algorithms Recitation 14 Shortest...

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

6.006 Intro to Algorithms Recitation 14 March 30, 2011 Shortest Paths In the past, we were able to use breadth-first search to find the shortest paths between a source vertex to all other vertices in some graph G . We weighed each edges equally so the shortest path between two vertices was the one that contained the fewest edges. Now, we introduce edge weights so the cost of traveling through edges can differ from edge to edge. The shortest path between two vertices is defined to be the path whose sum of edge weights is the least. BFS will not work on weighted graphs since the path with the fewest edges may not be the shortest if the edges it contains are expensive. There are several variants on the shortest paths problem and the algorithms that we will go over that correspond to solving each problem are in parentheses: Single-source shortest-paths problem: Find a shortest path from a source vertex to each other vertex in the graph (Bellman-Ford, Dijkstra) Single-destination shortest-paths problem: Find a shortest path to a destination vertex from each other vertex in the graph (Bellman-Ford/Dijkstra on reversed graph) Single-pair shortest-path problem: Find a shortest path between a vertex u and a vertex v in a graph (Bellman-Ford, Dijkstra)

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 ]}