Dijkstra's algorithm

Dijkstra's algorithm is a greedy algorithm for calculating the single source shortest path for a graph. It can also be used to calculate the shortest path spanning tree.

Algorithm
The algorithm is as follows, starting from source $$S$$:
 * 1) Set distance to $$S$$ to 0.
 * 2) While there is a node to be relaxed
 * 3) Find the node V that is the closest to S that is not relaxed.
 * 4) Relax V - Adjust all adjacent vertices