Reduction: 3SAT → 3D Matching
Consider the following set of four triples, each represented by a triangular node joining a boy, girl, and pet:
The two boys and the two girls are not involved in any other triples. The any matching must contain either the two triples or the two triples . Therefore the “gadget” has two possible states.
So therefore if we want to transform an instance of 3SAT to one of 3D MATCHING, we start by creating a copy of the gadget for each variable . Call the resulting nodes and so on, the intended interpretation is boy is matched with girl if , and with girl if
Then we create triples that mimic clauses, for each clause (say , introduce a new boy and a new girl , they will be involved in three triples, one for each literal in the clause, and the pets in three triples must reflect the three ways where the clause can be satisfied
-
- Have triple
- If is taken, then the possible assignment of the gadget representing is only TRUE
- If is false, then is taken, and and cannot be accommodated with this triplet
-
-
We need to make sure that every occurrence of a literal in a clause there is a different pet to match with and .
By an earlier reduction we can assume that no literal appears more than twice, so each variable gadget has enough pets, two for negated occurrences and two for unnegated.
Complete?
- For any matching we can recover a satisfying truth assignment by looking at each variable gadget
- For each clause the pet the corresponds to one of its satisfying literals
One last problem remained:
- In the matching defined at the end, some pets may be left unmatched.
- Exactly pets.
- Easy to fix: Add new boy-girl couples that are “generic animal-lovers”