09.09.2014 Views

algorithms

algorithms

algorithms

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2n − m pets will be left unmatched (you can check that this number is sure to be positive,<br />

because we have at most three occurrences of every variable, and at least two literals in every<br />

clause). But this is easy to fix: Add 2n − m new boy-girl couples that are “generic animallovers,”<br />

and match them by triples with all the pets!<br />

3D MATCHING−→ZOE<br />

Recall that in ZOE we are given an m × n matrix A with 0 − 1 entries, and we must find a 0 − 1<br />

vector x = (x 1 , . . . , x n ) such that the m equations<br />

Ax = 1<br />

are satisfied, where by 1 we denote the column vector of all 1’s. How can we express the 3D<br />

MATCHING problem in this framework?<br />

ZOE and ILP are very useful problems precisely because they provide a format in which<br />

many combinatorial problems can be expressed. In such a formulation we think of the 0 − 1<br />

variables as describing a solution, and we write equations expressing the constraints of the<br />

problem.<br />

For example, here is how we express an instance of 3D MATCHING (m boys, m girls, m<br />

pets, and n boy-girl-pet triples) in the language of ZOE. We have 0 − 1 variables x 1 , . . . , x n ,<br />

one per triple, where x i = 1 means that the ith triple is chosen for the matching, and x i = 0<br />

means that it is not chosen.<br />

Now all we have to do is write equations stating that the solution described by the x i ’s is<br />

a legitimate matching. For each boy (or girl, or pet), suppose that the triples containing him<br />

(or her, or it) are those numbered j 1 , j 2 , . . . , j k ; the appropriate equation is then<br />

x j1 + x j2 + · · · + x jk = 1,<br />

which states that exactly one of these triples must be included in the matching. For example,<br />

here is the A matrix for an instance of 3D MATCHING we saw earlier.<br />

Al<br />

Bob<br />

Chet<br />

Alice<br />

Beatrice<br />

Carol<br />

⎛<br />

⎞<br />

1 0 0 0 0<br />

0 0 0 1 1<br />

0 1 1 0 0<br />

1 0 0 0 1<br />

A =<br />

0 1 0 0 0<br />

0 0 1 1 0<br />

⎜1 0 0 0 1<br />

⎟<br />

⎝0 0 1 1 0⎠<br />

0 1 0 0 0<br />

Armadillo<br />

Bobcat<br />

Canary<br />

The five columns of A correspond to the five triples, while the nine rows are for Al, Bob, Chet,<br />

Alice, Beatrice, Carol, Armadillo, Bobcat, and Canary, respectively.<br />

It is straightforward to argue that solutions to the two instances translate back and forth.<br />

253

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!