guess the next step: Dijkstra's shortest paths
Before each step plays, guess what it does. The page then shows the step as the run takes it and says why, the same sentence the watch page says there.
Step 1 of 19
Question 1 of 17
Step 1 of 19
Step 2 of 19
Step 3 of 19
Step 4 of 19
Step 5 of 19
Step 6 of 19
Step 7 of 19
Question 1 of 17
Question 1 of 17
Right.
You guessed: The nearest place not settled yet is 0 away.
What the run did:
Of the places with a distance and not settled yet, A is the nearest, at 0. Settle it: any other way to A would go through a place at least as far away.
Question 1 of 17
Not this time.
You guessed: The nearest place not settled yet is 1 away.
What the run did:
Of the places with a distance and not settled yet, A is the nearest, at 0. Settle it: any other way to A would go through a place at least as far away.
Question 1 of 17
Not this time.
You guessed: The nearest place not settled yet is 2 away.
What the run did:
Of the places with a distance and not settled yet, A is the nearest, at 0. Settle it: any other way to A would go through a place at least as far away.
Question 2 of 17
Question 2 of 17
Right.
You guessed: Through A, the way to B is shorter than any found before, so write it.
What the run did:
The road from A to B is 7 long, so through A it is 7 to B, shorter than any way found before. Write 7 at B.
Question 2 of 17
Not this time.
You guessed: Through A, the way to B is no shorter, so keep what is written.
What the run did:
The road from A to B is 7 long, so through A it is 7 to B, shorter than any way found before. Write 7 at B.
Question 3 of 17
Question 3 of 17
Right.
You guessed: Through A, the way to E is shorter than any found before, so write it.
What the run did:
The road from A to E is 2 long, so through A it is 2 to E, shorter than any way found before. Write 2 at E.
Question 3 of 17
Not this time.
You guessed: Through A, the way to E is no shorter, so keep what is written.
What the run did:
The road from A to E is 2 long, so through A it is 2 to E, shorter than any way found before. Write 2 at E.
Question 4 of 17
Question 4 of 17
Not this time.
You guessed: The nearest place not settled yet is 1 away.
What the run did:
Of the places with a distance and not settled yet, E is the nearest, at 2. Settle it: any other way to E would go through a place at least as far away.
Question 4 of 17
Right.
You guessed: The nearest place not settled yet is 2 away.
What the run did:
Of the places with a distance and not settled yet, E is the nearest, at 2. Settle it: any other way to E would go through a place at least as far away.
Question 4 of 17
Not this time.
You guessed: The nearest place not settled yet is 3 away.
What the run did:
Of the places with a distance and not settled yet, E is the nearest, at 2. Settle it: any other way to E would go through a place at least as far away.
Question 5 of 17
Question 5 of 17
Right.
You guessed: Through E, the way to F is shorter than any found before, so write it.
What the run did:
The road from E to F is 2 long, so through E it is 4 to F, shorter than any way found before. Write 4 at F.
Question 5 of 17
Not this time.
You guessed: Through E, the way to F is no shorter, so keep what is written.
What the run did:
The road from E to F is 2 long, so through E it is 4 to F, shorter than any way found before. Write 4 at F.
Question 6 of 17
Question 6 of 17
Right.
You guessed: The nearest place not settled yet is 4 away.
What the run did:
Of the places with a distance and not settled yet, F is the nearest, at 4. Settle it: any other way to F would go through a place at least as far away.
Question 6 of 17
Not this time.
You guessed: The nearest place not settled yet is 5 away.
What the run did:
Of the places with a distance and not settled yet, F is the nearest, at 4. Settle it: any other way to F would go through a place at least as far away.
Question 6 of 17
Not this time.
You guessed: The nearest place not settled yet is 6 away.
What the run did:
Of the places with a distance and not settled yet, F is the nearest, at 4. Settle it: any other way to F would go through a place at least as far away.