Floyd Warshall with internal path reconstruction