Floyd-Warshall E-Graph algorithm