Graphs II: Basic Algorithms :

Print this page
  • Graph Representation of the road map: The intersections between the roads are denoted as vertices and road joining them as edge in the graph representation of the given road map.
  • Single Source Shortest Path problem: Given a graph G = (V, E), we want to find the shortest path from given source to every vertex in the graph.
  • The problem is solved efficiently by Dijkstra using greedy strategy. The algorithm is known as Dijkstra's algorithm.
  • The method works by maintaining a set S of vertices for which shortest path from source v0 is found. Initially, S is empty and shortest distance to each vertex from source is infinity.
  • The algorithm repeatedly selects a vertex vi in V - S to which path form source is shorter than other vertices in V-S, adds to S, and estimates the shortest distance to other vertices from vi.
Prev