Graphs II: Basic Algorithms :

Print this page
 
       

Single Source Shortest Path

  • A traveler wishes to find a shortest distance between New Delhi and Visakhapatnam, in a road map of India in which distance between pair of adjacent road intersections are marked in kilometers.

  • One possible solution is to find all possible routes between New Delhi and Visakhapatnam, and find the distance of each route and take the shortest.
  • There are many possible routes between given cities. It is difficult to enumerate all of them.
  • Some of these routes are not worth considering. For example, route through Cinnai, since it is about 800KM out of the way.
  • The problem can be solved efficiently, by modeling the given road map as a graph and find the shortest route between given pair of cites as suitable (single source shortest paths) graph problem.
Prev