One step of the algorithm

Report a typo

Given below is a directed weighted graph:

Directed weighted graph

Assume that we are applying the Floyd-Warshall algorithm to the graph and already set the initial distances. What distances need to be updated? Find all of them and print to the field below.

The expected output format is the following:

0 1 2
2 3 4

Each line corresponds to one update. The first two numbers represent a pair of nodes between which the distance needs to be updated, the third number is a new distance.

Enter a short text
___

Create a free account to access the full topic