Overview
Warshall's algorithm updates a reachability matrix so entry (i, j) becomes true when vertex j can be reached from vertex i through any allowed intermediate vertex.
Computes transitive closure by repeatedly allowing each vertex as an intermediate step.
Compact metadata for implementation and discovery.
Warshall's algorithm updates a reachability matrix so entry (i, j) becomes true when vertex j can be reached from vertex i through any allowed intermediate vertex.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n log n)
Worst
O(n^2)
Space
O(n)
Show updating reachability through each intermediate vertex in turn on a small transitive closure example.
Warshall's algorithm is the Boolean reachability version of the Floyd-Warshall dynamic-programming pattern.
What each reference supports for this entry.
Textbook support for Warshall's Algorithm's algorithm family, complexity framing, and standard implementation concepts.
Open sourceAlgorithm catalog support for Warshall's Algorithm in the graph, flow, matching, and combinatorial optimization benchmark area.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Warshall computes all implied reachability; transitive reduction removes edges implied by other paths.
Both use the same intermediate-vertex dynamic-programming loop structure.