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 A, how many roads does the run look along?

643A0BCG
the answer, and why

the answer is D

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? F>C 7 means a road from F to C, 7 long, and the letter after the semicolon is the start.

the answer, and why

the answer is C

The run looks along 6 roads on C>F 4, F>B 3, F>A 6; C, the most of the four.

if you chose another

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

new numbersthe test page's numbers