NP Complere 2
NP Complere 2
NP Complere 2
651
652 CHAPTER 13. SOME N P-COMPLETE PROBLEMS
The subfamily
C = {{u1, u3}, {u5, u6}, {u2, u4}}
is an exact cover.
13.1. STATEMENTS OF THE PROBLEMS 655
v1
v8 v2
v19 v16
v9 v15
v7 v3
v4
v6 v5
v10 v14
v17
v18
u = u1, u2, . . . , un = v
n
)
xivi ≥ B,
i=1
)n
xiwi ≤ W.
i=1
Is this problem in N P?
is such an expression.
a11x1 + · · · + a1q xq = b1
.. ..
ai1x1 + · · · + aiq xq = bi
.. ..
ap1x1 + · · · + apq xq = bp
Ax = b.
680 CHAPTER 13. SOME N P-COMPLETE PROBLEMS
Example 13.2. If
F = {C1 = (x1 ∨ x2), C2 = (x1 ∨ x2 ∨ x3), C3 = (x2),
C4 = (x2 ∨ x3)},
U = {x1, x2, x3, C1, C2, C3, C4, p11, p12, p21, p22, p23, p31,
p41, p42},
T1,T = {x1, p21}, T2,T = {x2, p12, p41}, T3,F = {x3, p23},
{C1, p11}, {C2, p22}, {C3, p31}, {C4, p42}.
Cj = (Lj1 ∨ · · · ∨ Ljmj )
U = {xi | 1 ≤ i ≤ n} ∪ {Cj | 1 ≤ j ≤ ℓ}
∪ {pjk | 1 ≤ j ≤ ℓ, 1 ≤ k ≤ mj }
so we put
T1,T = {x1, p21}, T2,T = {x2, p12, p41}, T3,F = {x3, p23},
{C1, p11}, {C2, p22}, {C3, p31}, {C4, p42}
in C.
T1,T = {x1, p21}, T2,T = {x2, p12, p41}, T3,F = {x3, p23},
{C1, p11}, {C2, p22}, {C3, p31}, {C4, p42},
a b
u v w
d c
a b
d c
Either all three edges (c1, d1), (c2, d2), (c3, d3) are tra-
versed or the edge (a, b) is traversed, and these possi-
bilities are mutually exclusive.
a b
⊕ ⊕
d1 c3
⊕
c1 d3
d2 c2
u4 S0
u3
⊕ ⊕ S1
u2 ⊕
⊕
S2
u1 ⊕
u0 S3
Figure 13.10: The directed graph constructed from the data (U, F ) of Example 13.4
short (S0, S1), long (S1, S2), short (S2, S3), (S3, u0),
(u0, u1)3, (u1, u2)3, (u2, u3)1, (u3, u4)1, (u4, S0).
short (S0, S1), long (S1, S2), short (S2, S3), (S3, u0),
(u0, u1)3, (u1, u2)3, (u2, u3)1, (u3, u4)1, (u4, S0)
that we encountered earlier.
13.2. PROOFS OF N P-COMPLETENESS 695
x1 x1 x1 x1
x2 x3 x2 x3 x2 x3 x2 x3
Figure 13.12: The graph constructed from the clauses of Example 13.5
700 CHAPTER 13. SOME N P-COMPLETE PROBLEMS
(6) Clique
In our example
a1 = 0011
a2 = 0111
a3 = 1100.
For example,
C = {S1 = {u3, u4}, S3 = {u1, u2}}
is an exact cover and
a1 + a3 = 0011 + 1100 = 1111.
This time,
a1 + a2 + a3 + a4 = 001011 + 001101 + 001111
+ 011000
= 014223 ̸= 111111,
so {S1, S2, S3, S4} is not a solution. However
/
In testing whether i∈I ai = K for some subset I ⊆
{1, . . . , m}, we use arithmetic in base m.
13.2. PROOFS OF N P-COMPLETENESS 711
S = (0 + 1)(0 + 1) · · · (0 + 1) .
0 12 3
n
R = R1 + · · · + Rp,
⎧
⎨0 if xj is a literal of Ci
Rij = 1 if xj is a literal of Ci
⎩
(0 + 1) if xj does not occur in Ci.
13.2. PROOFS OF N P-COMPLETENESS 715
{y ∈ Σ∗ | x; y ∈ L′}
is a composite!
By definition,
coN P = {L | L ∈ N P},
P ⊆ coN P,
Of course, P ⊆ N P ∩ coN P.
√
Remark: If N ≤ M < N , the above problem is
equivalent to asking whether N is prime.
724 CHAPTER 13. SOME N P-COMPLETE PROBLEMS
P ⊆ N P ⊆ EX P,
where the left inclusion and the right inclusion are both
open problems, but we know that at least one of these
two inclusions is strict.
P ⊆ N P ⊆ EX P ⊆ N EX P.