Exercise: The Bellman-Ford Algorithm

Test your understanding of the Bellman-Ford algorithm.

We'll cover the following

The task at hand

Given the digraph in the playground below, select a vertex you want to serve as the source vertex. Now, grab a paper and a pen and figure out the shortest paths found by the Bellman-Ford algorithm from the highlighted source vertex to all other vertices.

You may verify your solution by clicking the “Run Bellman-Ford” button.

Note:

  • You can also experiment on a different digraph using these instructions.instructions
  • If you choose to add a new edge, its weight will be generated randomly.
  • If the automatically generated labels overlap with vertices or edges, you may view them more clearly by dragging the vertices of the given digraph (after selecting the “Drag vertices” checkbox).

Get hands-on with 1200+ tech skills courses.