The Dijkstra shortest path algorithm implemented in JavaScript.