Dijkstra's Algorithm

This page list information about Dijkstra's Algorithm

Algorithm Steps

  1. Set the distance to the source vertex as 0, and to all other vertices as infinity.
  2. Select the unvisited vertex with the smallest known distance.
  3. For each neighbor of that vertex, update its distance if a shorter path is found through the current vertex.
  4. Mark the current vertex as visited (its shortest distance is now final).
  5. Continue until all vertices have been visited or no shorter paths remain.

Diagram

More Information

Wikipedia