Algorithm visualizer
Pick an algorithm, enter your own numbers or use a preset, then step through the run. The pseudocode and the explanation follow each step.
Settle the closest unsettled node, then try to shorten the distances of its neighbours. Works when no weight is negative.
Precondition: Edge weights must be 0 or more.
Make one edge heavier so the shortest path changes. Predict the new distances before running it.
Step 1 of 19
empty
Set dist[0] = 0. Every other node starts at ∞.