Circuit satisfiability problem explained

In theoretical computer science, the circuit satisfiability problem (also known as CIRCUIT-SAT, CircuitSAT, CSAT, etc.) is the decision problem of determining whether a given Boolean circuit has an assignment of its inputs that makes the output true.[1] In other words, it asks whether the inputs to a given Boolean circuit can be consistently set to 1 or 0 such that the circuit outputs 1. If that is the case, the circuit is called satisfiable. Otherwise, the circuit is called unsatisfiable. In the figure to the right, the left circuit can be satisfied by setting both inputs to be 1, but the right circuit is unsatisfiable.

CircuitSAT is closely related to Boolean satisfiability problem (SAT), and likewise, has been proven to be NP-complete.[2] It is a prototypical NP-complete problem; the Cook–Levin theorem is sometimes proved on CircuitSAT instead of on the SAT, and then CircuitSAT can be reduced to the other satisfiability problems to prove their NP-completeness.[3] The satisfiability of a circuit containing

m

arbitrary binary gates can be decided in time

O(20.4058m)

.[4]

Proof of NP-completeness

Given a circuit and a satisfying set of inputs, one can compute the output of each gate in constant time. Hence, the output of the circuit is verifiable in polynomial time. Thus Circuit SAT belongs to complexity class NP. To show NP-hardness, it is possible to construct a reduction from 3SAT to Circuit SAT.

Suppose the original 3SAT formula has variables

x1,x2,...,xn

, and operators (AND, OR, NOT)

y1,y2,...,yk

. Design a circuit such that it has an input corresponding to every variable and a gate corresponding to every operator. Connect the gates according to the 3SAT formula. For instance, if the 3SAT formula is

(lnotx1\landx2)\lorx3,

the circuit will have 3 inputs, one AND, one OR, and one NOT gate. The input corresponding to

x1

will be inverted before sending to an AND gate with

x2,

and the output of the AND gate will be sent to an OR gate with

x3.

Notice that the 3SAT formula is equivalent to the circuit designed above, hence their output is same for same input. Hence, If the 3SAT formula has a satisfying assignment, then the corresponding circuit will output 1, and vice versa. So, this is a valid reduction, and Circuit SAT is NP-hard.

This completes the proof that Circuit SAT is NP-Complete.

Restricted variants and related problems

Planar Circuit SAT

Assume that we are given a planar Boolean circuit (i.e. a Boolean circuit whose underlying graph is planar) containing only NAND gates with exactly two inputs. Planar Circuit SAT is the decision problem of determining whether this circuit has an assignment of its inputs that makes the output true. This problem is NP-complete. Moreover, if the restrictions are changed so that any gate in the circuit is a NOR gate, the resulting problem remains NP-complete.[5]

Circuit UNSAT

Circuit UNSAT is the decision problem of determining whether a given Boolean circuit outputs false for all possible assignments of its inputs. This is the complement of the Circuit SAT problem, and is therefore Co-NP-complete.

Reduction from CircuitSAT

Reduction from CircuitSAT or its variants can be used to show NP-hardness of certain problems, and provides us with an alternative to dual-rail and binary logic reductions. The gadgets that such a reduction needs to construct are:

Minesweeper Inference Problem

This problem asks whether it is possible to locate all the bombs given a Minesweeper board. It has been proven to be CoNP-Complete via a reduction from Circuit UNSAT problem.[6] The gadgets constructed for this reduction are: wire, split, AND and NOT gates and terminator.[7] There are three crucial observations regarding these gadgets. First, the split gadget can also be used as the NOT gadget and the turn gadget. Second, constructing AND and NOT gadgets is sufficient, because together they can simulate the universal NAND gate. Finally, since three NANDs can be composed intersection-free to implement an XOR, and since XOR is enough to build a crossover,[8] this gives us the needed crossover gadget.

The Tseytin transformation

See main article: Tseytin transformation. The Tseytin transformation is a straightforward reduction from Circuit-SAT to SAT. The transformation is easy to describe if the circuit is wholly constructed out of 2-input NAND gates (a functionally-complete set of Boolean operators): assign every net in the circuit a variable, then for each NAND gate, construct the conjunctive normal form clauses (v1v3) ∧ (v2v3) ∧ (¬v1 ∨ ¬v2 ∨ ¬v3), where v1 and v2 are the inputs to the NAND gate and v3 is the output. These clauses completely describe the relationship between the three variables. Conjoining the clauses from all the gates with an additional clause constraining the circuit's output variable to be true completes the reduction; an assignment of the variables satisfying all of the constraints exists if and only if the original circuit is satisfiable, and any solution is a solution to the original problem of finding inputs that make the circuit output 1.[9] The converse—that SAT is reducible to Circuit-SAT—follows trivially by rewriting the Boolean formula as a circuit and solving it.

See also

Notes and References

  1. Web site: Lecture 7: NP-Complete Problems. July 5, 2000. David Mix Barrington and Alexis Maciel.
  2. Web site: Notes for Lecture 23: NP-completeness of Circuit-SAT. Luca Trevisan. November 29, 2001. February 4, 2012. December 26, 2011. https://web.archive.org/web/20111226032218/http://www.cs.berkeley.edu/~luca/cs170/notes/lecture22.pdf. dead.
  3. See also, for example, the informal proof given in Scott Aaronson's lecture notes from his course Quantum Computing Since Democritus.
  4. Web site: An O(2^) upper bound for Circuit SAT. Sergey Nurk. December 1, 2009.
  5. Web site: Algorithmic Lower Bounds: Fun With Hardness Proofs at MIT.
  6. Scott. Allan. Stege. Ulrike. van Rooij. Iris. 2011-12-01. Minesweeper May Not Be NP-Complete but Is Hard Nonetheless. The Mathematical Intelligencer. en. 33. 4. 5–17. 10.1007/s00283-011-9256-x. 122506352 . 1866-7414.
  7. Minesweeper is NP-complete . Kaye. Richard . The Mathematical Intelligencer . 22 . 2 . 9 - 15 . Mar 2000 . 10.1007/BF03025367. 122435790.
  8. see and
  9. Web site: Algorithms for Satisfiability in Combinational Circuits Based on Backtrack Search and Recursive Learning. Marques-Silva, João P. and Luís Guerra e Silva. 1999. dead. https://web.archive.org/web/20220702105658/http://vinci.inesc.pt/~lgs/docs/iwls99.pdf. 2022-07-02.