The Floyd-Warshall algorithm