An implication graph is a directed graph where each node is assigned either true or false and any edge u -> v
implies that if u is true then v is true
.
I know a straightforward O(n^2)
algorithm to find an assignment in a general implication graph and O(n)
algorithms for some special cases (like the implication graph arising from a 2-SAT problem).
So I was wondering if there is an O(n)
algorithm find assignment of any implication graph?