Floyd-Warshall: negative cycle detection.