My own Dijkstra's Algorithm implementation.