rec14 - 6.006 Intro to Algorithms Recitation 14 March 30,...

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

View Full Document Right Arrow Icon
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) All-pairs shortest-paths problem:
Background image of page 1

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

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

This note was uploaded on 11/11/2011 for the course MATH 180 taught by Professor Byrns during the Spring '11 term at Montgomery College.

Page1 / 3

rec14 - 6.006 Intro to Algorithms Recitation 14 March 30,...

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

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