Skip to content

Dijkstra's shortest paths

networks

Level 2 of 3

Also called Dijkstra's algorithm and Single-source shortest paths.

Finds the shortest way from one place to another along roads of different lengths. Settle places nearest first; each time a place is settled, see whether going through it makes the way to its neighbours any shorter.

roads looked along
0
places weighed up
0

step 1 of 1

Examples

Tap a spot to put your pen down there, then tap a spot next to it to draw a road. Keep tapping to draw on.

Places stand in two rows, A to D above and E to H below. A road joins two places next to each other (one road across each square), with its length from 1 to 99: A-B 4. Separate roads with commas, then a semicolon, where to start and where to reach: A-B 4, B-F 2; A F.