Update Floyd Warshall shortest path algorithm