Exercise: Floyd-Warshall Algorithm

Test your understanding of the Floyd-Warshall algorithm.

We'll cover the following

The task at hand

Grab a paper and a pen, and figure out how to use the Floyd-Warshall algorithm to find the lengths of shortest paths between all pairs of vertices in the given digraph.

You can verify your solution by clicking the “Run Floyd-Warshall” 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 1400+ tech skills courses.