Example implementation of dijkstra in Python. Dijkstra's algorithm finds the shortest path from a source node to all other nodes in a weighted graph with non-negative edge weights by using a greedy approach. It has a time complexity of O((V + E) log V). V is the number of vertices, and e is the number of edges.
python dijkstra.pySee screenshot.png for a sample run.