A shortest Graph Traversal algorithm on a Graph.

Algorithm

  • Given a Weighted Graph
  • Given a list of all nodes
  • Creating a empty list representing the distance from root node to each of the other nodes. Set all distances to infinity Algorithm repeats until finised:
  1. Visit all Neighbour nodes, and update the distance by adding current node distance and the weighted edge and comparing if its smaller than the current distance
  2. Set current node to the neighbour with the smallest distance, and cross it out in unvisited node