Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Warshall's Algorithm

Graph Algorithm

Warshall's algorithm is a dynamic programming method for computing the transitive closure of a directed graph or binary relation, determining for every pair of vertices whether a path exists between them regardless of length. It works by considering each vertex in turn as a possible intermediate stop and updating a boolean reachability matrix so that reachability through the current intermediate vertex is folded into the record for every pair, continuing until every vertex has served as an intermediate and the matrix reflects full transitive closure. Stephen Warshall published the algorithm in January 1962 in a paper titled "A Theorem on Boolean Matrices," working with logical conjunction and disjunction rather than arithmetic; Robert Floyd published a closely related algorithm the same year that applies the identical recurrence to weighted graphs using ordinary addition and minimum instead of the boolean operations, extending the same technique to compute shortest paths rather than mere reachability. Because of this shared structure, the shortest path version is now generally known as the Floyd-Warshall algorithm, while Warshall's own boolean version remains the standard reference for computing transitive closure directly.

Facts
Time Complexity
Time Complexity (category)
Cubic Time -- O(n^3) 1
Classification
Design Technique
Dynamic Programming 1
Connections

Credited To

Source Floyd-Warshall Algorithm (Wikipedia)

In Field

Source Wikipedia, Floyd-Warshall algorithm

Uses Design Technique

Sources
1. Warshall's Algorithm (Wikipedia)
  • Wikipedia infobox: time complexity cubic
    cubic
  • History and naming
    The Floyd-Warshall algorithm is an example of dynamic programming, and was published in its currently recognized form by Robert Floyd in 1962.
  • In Group: Shortest Path Algorithms, Lead
    is an algorithm for finding shortest paths in a directed weighted graph
View the Source
Floyd-Warshall Algorithm (Wikipedia)
Credited To: Robert W. Floyd, Lead
Quote, Credited To: Robert W. Floyd, Lead
was published in its currently recognized form by Robert Floyd in 1962
View the Source
Wikipedia, Floyd-Warshall algorithm
In Field: Algorithms and Complexity Theory, Lead paragraphView the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.