Algorithm Design
Algorithm Design
Algorithm Design
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
482<br />
Chapter 8 NP and Computational IntractabiliW<br />
But this doesn’t help us establish the NP-completeness of B-Dimensional<br />
Matching, since these reductions simply show that B-Dimensional Matching<br />
can be reduced to some very hard problems. What we need to show is the other<br />
direction: that a known NP-complete problem can be reduced to 3-Dimensional<br />
Matching.<br />
(8.20) 3,Dimensional Matching is NP-complete. ~<br />
Proof. Not surprisingly, it is easy to prove that B-Dimensional Matching is in<br />
:N~P. Given a collection of triples T C X x Y x Z, a certificate that there is a<br />
solution could be a collection of triples T’ ~ T. In polynomial time, one could<br />
verify that each element in X U Y u Z belongs to exactly one of the triples in T’.<br />
For the reduction, we again return all the way to B-SAT. This is perhaps a<br />
little more curious than in the case of Hamiltonian Cycle, since B-Dimensional<br />
Matching is so closely related to both Set Packing and Set Cover; but in,fact the<br />
partitioning requirement is very hard to encode using either of these problems.<br />
Thus, consider an arbitrary instance of B-SAT, with n variables xl ..... Xn<br />
and k clauses C1 ..... C k. We will show how to solve it, given the ~ability to<br />
detect perfect three-dimensional matchings.<br />
The overall strategy in this reduction will be similar (at a very high level)<br />
to the approach we followed in the reduction from 3-SAT to Hamiltonian Cycle.<br />
We will first design gadgets that encode the independent choices involved in<br />
the truth assignment to each variable; we will then add gadgets that encode<br />
the constraints imposed by the clauses. In performing this construction, we<br />
will initially describe all the elements in the 3-Dimensional Matching instance<br />
simply as "elements;’ without trying to specify for each one whether it comes<br />
from X, Y, or Z. At the end, we wil! observe that they naturally decompose<br />
into these three sets.<br />
Here is the basic gadget associated with variable xi. We define elements<br />
Ai ={ail, ai2 ..... ai,2k} that constitute the core of the gadget; we define<br />
2k,<br />
elements Bi = {bn<br />
bi,xk<br />
..... } at the tips of the gadget. For eachj = 1, 2 .....<br />
we define a triple tij = (aij, aij+l, bij), where we interpret addition modulo 2k.<br />
Three of these gadgets are pictured in Figure 8.9. In gadget i, we wil! call a<br />
triple tij even if j is even, and odd if j is odd. In an analogous way, we will<br />
refer to a tip bi~ as being either even or odd.<br />
These will be the only triples that contain the elements in Ai, so we<br />
can already say something about how they must be covered in any perfect<br />
matching: we must either use al! the even triples in gadget i, or all the odd<br />
triples in gadget i. This will be our basic way of encoding the idea that xi can<br />
Clause 1<br />
rips<br />
Variable 1 Variable 2<br />
Figure 8.9 The reduction from 3-SAT to 3-Dimensional Matching.<br />
8.6 Partitioning Problems<br />
I~<br />
be set to either 0 or 1; if we select all the even triples, this will represent setting<br />
x i = 0, and if we select all the odd triples, this wil! represent setting xi = 1.<br />
Here is another way to view the odd/even decision, in terms of the tips of<br />
the gadget. If we decide to use the even triples, we cover the even tips of the<br />
gadget and leave the odd tips flee. If we decide to use the odd triples, we cover<br />
the odd tips of the gadget and leave the even tips flee. Thus our decision of<br />
how to set x i can be viewed as follows: Leaving the odd tips flee corresponds<br />
to 0, while leaving the even tips flee corresponds to 1. This will actually be the<br />
more useful way to think about things in the remainder of the construction.<br />
So far we can make this even/odd choice independently for each of the n<br />
variable gadgets. We now add elements to model the clauses and to constrain<br />
the assignments we can choose. As in the proof of (8.17), let:s consider the<br />
example of a clause<br />
C1..~- X1V’~2 V X 3.<br />
In the language of three-dimensional matchings, it tells us, "The matching on<br />
the cores of the gadgets should leave the even tips of the first gadget flee; or it<br />
should leave the odd tips of the second gadget flee; or it should leave the even<br />
tips of the third gadget free." So we add a clause gadget that does precisely<br />
he clause elements can only be ~<br />
arched if some variable gadget |<br />
eaves the corresponding tip flee..)<br />
Variable 3<br />
483