Floyd-Warshall
Floyd-Warshall computes shortest paths between every pair of vertices using dynamic programming. It incrementally allows each vertex k to serve as an intermediate point and updates dist[i][j] using dist[i][k] + dist[k][j]. It supports negative edges but not negative cycles if meaningful shortest paths are required.
Time: O(V³).
Space: O(V²).
Supports negative edges.
dist[v][v] < 0 after processing indicates a negative cycle.
Useful when all-pairs distances are required and V is moderate.