2SAT is NL-complete #
The satisfiable formulas in conjunctive normal form with at most two literals per clause
(Cslib.Complexity.TwoSAT, encoded by Cslib.Complexity.encCNF) are complete for
nondeterministic logarithmic space under logspace many-one reductions
Papadimitriou, Theorem 16.3 (Cslib.Complexity.TwoSAT.logSpaceComplete).
The classes are the library's native ones, as for directed connectivity
(Cslib.Complexity.STCON.logSpaceComplete).
- Membership (
Cslib.Complexity.TwoSAT.mem_NL): the complement ofTwoSATis inNL(Cslib.Complexity.TwoSAT.compl_mem_NL), by a nondeterministic counter program looking for a clause that is empty or too wide, or for a variablexwith a path fromxto¬xand one back in the implication graph (Cslib.Complexity.TwoSAT.accepts_decider_iff). ThenTwoSATis inNLby the Immerman–Szelepcsényi theoremCslib.Complexity.NL_eq_coNLSipser, Section 8.6, proved for these native classes by Erik Demaine's inductive-counting construction. - Hardness (
Cslib.Complexity.TwoSAT.logSpaceHard): the complement of directed connectivity reduces toTwoSAT(Cslib.Complexity.TwoSAT.logSpaceReducible_compl_STCON) by a formula whose variables are the vertices (Cslib.Complexity.TwoSAT.reachabilityFormula), and the complement of directed connectivity isNL-complete (Cslib.Complexity.STCON.compl_logSpaceComplete), again byNL = coNL.
Main results #
Cslib.Complexity.TwoSAT.compl_mem_NL: the complement ofTwoSATis inNL.Cslib.Complexity.TwoSAT.mem_NL:TwoSAT ∈ NL.Cslib.Complexity.TwoSAT.logSpaceReducible_compl_STCON: the complement of directed connectivity reduces toTwoSATin logarithmic space.Cslib.Complexity.TwoSAT.logSpaceHard: every problem inNLreduces toTwoSATin logarithmic space.Cslib.Complexity.TwoSAT.logSpaceComplete:TwoSATisNL-complete.
References #
TwoSAT is in NL, from its complement by the Immerman–Szelepcsényi theorem
NL = coNL Sipser, Section 8.6.
The complement of directed s–t connectivity reduces to TwoSAT in logarithmic
space Papadimitriou, Theorem 16.3.
TwoSAT is NL-hard under logspace many-one reductions: every problem in NL reduces
to the complement of directed connectivity, which reduces to TwoSAT.
TwoSAT is NL-complete under logspace many-one reductions
Papadimitriou, Theorem 16.3.