Algorithm Implementation/Graphs/Shortest path

In JavaScript: The above example is using a binary heap as a priority queue to ensure the running complexity: