The transitive closure of a graph is defined e. g. here: http://mathworld.wolfram.com/TransitiveClosure.html
It is easily possible in O(n^3), where n is the number of vertices. I was wondering if it can be done in time O(n^2).
Thanks in advance
The transitive closure of a graph is defined e. g. here: http://mathworld.wolfram.com/TransitiveClosure.html
It is easily possible in O(n^3), where n is the number of vertices. I was wondering if it can be done in time O(n^2).
Thanks in advance
Nope. I don't think there is a O(n2) algorithm for it. I would expect if such an algorithm existed, you could solve all pair shortest paths problem in O(n2) too, which is not the case. The asymptotically fastest algorithm I can think of is an implementation of Dijkstra's shortest path algorithm with a Fibonacci heap (O(n2log n) in not very dense graphs).
Hmm. I found an algorithm that computes the transitive closure in O(n^2) EXPECTED run time.
Given that this:
Can you come up with an O(kn^2 + m) transitive closure/reduction algorithm, where k is the number of missing/extra edges in the transitive closure/reduction?
Is still considered an open question by people who think about these sorts of things more than we do, I'd say "I don't know".
(But if you solve it and want a PhD, I know that algorithm.)