Dijkstra shortest path algorithm.

We start with the source node. Perform the relax operation on adjacent vertices and and pick the node with with minimum cost. Make it final and perform relax operation on adjacent vertices. Do the procedure recursively till you get the shortest path to all nodes.

Leave a comment