Dijkstras Algorithm - Shortest Paths With Dijkstras Algorithm
Dijkstras Algorithm - Shortest Paths With Dijkstras Algorithm
Dijkstra's Algorithm
117
Dijkstra's Algorithm allows you to calculate the shortest path between one node (you pick which one) and every
other node in the graph. You'll nd a description of the algorithm at the end of this page, but, let's study the
6
algorithm with an explained example! Let's calculate the shortest path between node C and the other nodes in
our graph:
During the algorithm execution, we'll mark every node with its minimum distance to node C (our selected node).
For node C, this distance is 0. For the rest of nodes, as we still don't know that minimum distance, it starts
being in nity (∞):
We use cookies to analyze our site tra c and improve the quality of our services.
You can edit your cookie options at any time. Find out more.
ACCEPT
https://www.codingame.com/playgrounds/1608/shortest-paths-with-dijkstras-algorithm/dijkstras-algorithm 1/1