Added some optimizations to dijkstra's shortest path implementation
Added some optimizations to dijkstra's shortest path implementation