Dijkstra shortest path calculator

Compute shortest directed paths for up to 64 nodes and 512 nonnegative integer-weight edges.

Enter values

Start with the example below, or enter your own values.

How it works

Settle the nearest unsettled node, then relax its outgoing edges. Supply edges as u,v,weight separated by semicolons.

Try an example

Node count: 4; Directed edges: 0,1,2;0,2,5;1,2,1;2,3,4;1,3,10; Start node: 0; End node: 3. The form starts with these values; change them to explore your own case.

Example result: Distance = 7

  1. Settle node 0, distance 0.
  2. Settle node 1, distance 2.
  3. Settle node 2, distance 3.
  4. Settle node 3, distance 7.

Learn more in Algorithm reasoning and step visualizers.

Results are calculated locally. Floating-point tools provide numerical approximations, not formal proof certificates.