For each variable x in φ, ask whether there is a path from x to ¬x and a path from ¬x to x in Gφ.
If this happens for some x, return false. Otherwise, return true.
procedure test2SAT: Input: propositional formula φ in 2-CNF Output: true if φ is satisfiable and false otherwise from φ construct Gφ for all variables x in φ do { if Gφ contains a path from x to ¬x and a path from ¬x to x then return false; } return true;
In this way, the satisfiability of φ is decided by repeated calls to graph reachability.