Skip to content

Bellman-Ford shortest paths

networks

Level 3 of 3

Also called Bellman-Ford algorithm and Single-source shortest paths with negative lengths.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from bellman-ford shortest paths's own run on the numbers shown.

choose one

question 1

On this line from E, how many roads does the run look along?

573E0FGH
the answer, and why

the answer is B

Round 1 looks along all 3 roads and round 2 along all 3 again, finding nothing shorter.

if you chose another

  • That is round 1 alone. A round must make nothing shorter before the run stops.
  • That is the same line backwards.
  • That is n×mn \times m, the ceiling on any map of 4 places and 3 roads.

new numbersthe test page's numbers

question 2

On which map does the run look along the most roads? G>D 6 means a road from G to D, 6 long, and the letter after the semicolon is the start.

the answer, and why

the answer is D

The run looks along 8 roads on G>F -3, G>C 6, E>F 2, C>D 2, B>G -5; G, the most of the four.

if you chose another

  • That map has 6 roads looked along, fewer than 8.
  • That map has 6 roads looked along, fewer than 8.
  • That map has 2 roads looked along, fewer than 8.

new numbersthe test page's numbers