guess the next step: Bellman-Ford 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 5
Question 1 of 3
Step 1 of 5
Step 2 of 5
Step 3 of 5
Step 4 of 5
Question 1 of 3
Question 1 of 3
Right.
You guessed: Look along every road in a round.
What the run did:
Round 1: look along every road from a place with a distance, in letter order.
Question 1 of 3
Not this time.
You guessed: This round made nothing shorter, so every distance is final.
What the run did:
Round 1: look along every road from a place with a distance, in letter order.
Question 1 of 3
Not this time.
You guessed: That was the last round needed, so look along every road once more.
What the run did:
Round 1: look along every road from a place with a distance, in letter order.
Question 2 of 3
Question 2 of 3
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 -9 long, so through A it is -9 to B, shorter than any way found before. Write -9 at B.
Question 2 of 3
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 -9 long, so through A it is -9 to B, shorter than any way found before. Write -9 at B.
Question 3 of 3
Question 3 of 3
Not this time.
You guessed: Look along every road in a round.
What the run did:
That was round 1, the last one needed. Look along every road once more: any that still makes a way shorter is on, or past, a loop that keeps getting shorter.
That is every question on this run: 0 of 3 right.
Question 3 of 3
Not this time.
You guessed: This round made nothing shorter, so every distance is final.
What the run did:
That was round 1, the last one needed. Look along every road once more: any that still makes a way shorter is on, or past, a loop that keeps getting shorter.
That is every question on this run: 0 of 3 right.
Question 3 of 3
Right.
You guessed: That was the last round needed, so look along every road once more.
What the run did:
That was round 1, the last one needed. Look along every road once more: any that still makes a way shorter is on, or past, a loop that keeps getting shorter.
That is every question on this run: 1 of 3 right.