allPairsShortestPaths

Executes the Floyd-Warshall algorithm on the graph to compute the shortest paths between all pairs of nodes.

This function calculates the shortest path distances for every pair of nodes in the graph and stores the results in the allDistances property. The algorithm works with some negative weights, but it assumes that the graph does not contain negative weight cycles.

The results can be retrieved using the distanceFromUtoV(u: T, v: T) function, which provides the shortest distance between any two nodes.

If the graph has no edges, a warning is printed to the standard error stream and nothing is computed (this function does not throw). Results from a previous run (if any) are kept. If there are none, a later call to distanceFromUtoV will throw.