6.006 Intro to Algorithms
Recitation 14
March 30, 2011
Shortest Paths
In the past, we were able to use breadthfirst 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:
•
Singlesource shortestpaths problem:
Find a shortest path from a source vertex to each
other vertex in the graph (BellmanFord, Dijkstra)
•
Singledestination shortestpaths problem:
Find a shortest path to a destination vertex
from each other vertex in the graph (BellmanFord/Dijkstra on reversed graph)
•
Singlepair shortestpath problem:
Find a shortest path between a vertex
u
and a vertex
v
in a graph (BellmanFord, 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.
 Spring '11
 byrns
 Math, Graph Theory, Shortest path problem, shortest path, Dijkstra

Click to edit the document details