4.3 Some Natural NP-Complete Problems 105
4.3.1.1 The NP-Completeness of CSAT
Recall that (bounded fan-in) Boolean circuits are directed acyclic graphs with
internal vertices, called
gates, labeled by Boolean operations (of arity either 2
or 1), and external vertices called
terminals that are associated with either
inputs or outputs. When setting the inputs of such a circuit, all internal nodes
are assigned values in the natural way, and this yields a value to the output(s),
called an evaluation of the circuit on the given input. The evaluation of circuit
C on input z is denoted C(z). We focus on circuits with a single output, and
let
CSAT denote the set of satisfiable Boolean circuits; that is, a circuit C is in
CSAT if there exists an input z such that C(z) = 1. We also consider the related
relation R
CSAT
={(C, z):C(z) = 1}.
Theorem 4.5 (NP-completeness of CSAT): The set (resp., relation)
CSAT
(resp., R
CSAT
) is NP-complete (resp., PC-complete).
Proof: It is easy to see that
CSAT ∈ NP (resp., R
CSAT
∈ PC). Thus, we turn
to showing that these problems are NP-hard. We will focus on the decision
version (but also discuss the search version).
We will present (again, but for the last time in this book) a generic reduction,
where here we reduce any NP-problem to CSAT. The reduction is based on
the observation, mentioned in Section 1.4.1 (see also Exercise 1.15), that the
computation of polynomial-time algorithms can be emulated by polynomial-
size circuits. We start with a description of the basic idea.
In the current context, we wish to emulate the computation of a fixed machine
M on input (x,y), where x is fixed and y varies (but |y|=poly(|x|) and the
total number of steps of M(x,y) is polynomial in |x|+|y|). Thus, x will be
“hard-wired” into the circuit, whereas y will serve as the input to the circuit.
The circuit itself, denoted C
x
, will consists of “layers” such that each layer will
represent an instantaneous configuration of the machine M, and the relation
between consecutive configurations in a computation of this machine will be
captured by (“uniform”) local gadgets in the circuit. The number of layers will
depend on |x| as well as on the polynomial that upper-bounds the running
time of M, and an additional gadget will be used to detect whether the last
configuration is accepting. Thus, only the first layer of the circuit C
x
(which
will represent an initial configuration with input prefixed by x) will depend on x.
(See Figure 4.1.) The punch line is that determining whether, for a given x, there
exists a y ∈{0, 1}
poly(|x|)
such that M(x,y) = 1 (in a given number of steps)
will be reduced to whether there exists a y such that C
x
(y) = 1. Performing
this reduction for any machine M
R
that corresponds to any R ∈ PC (as in the
proof of Theorem 4.3), we establish the fact that
CSAT is NP-complete. Details
follow.