Warshall’s algorithm can be used to construct the Transitive closure of directed graphs ()
so O(n3)
https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm
http://en.wikipedia.org/wiki/Transitive_closure
64.3k questions
77.9k answers
244k comments
80.0k users