Dijkstra's algorithm
Previous: Algorithm
Dijkstra’s algorithm can be seen as a variation of Breadth-first search made to work on graphs with weighted edges. The only real modification to the algorithm is to set up a priority queue instead of a regular queue so at each node, it will look for the next shortest path.