Documentation

CslibFrontier.Computability.Complexity.Problems.ThreeExactCover

Exact Cover by 3-sets #

An instance of 3-Exact Cover (3XC) is a sequence C of sets of exactly three elements; it is a yes-instance when some sub-collection of C covers every element of the union of C exactly once (Cslib.Complexity.ThreeExactCover). Goldreich's Proposition 2.25 says that 3XC is NP-complete Goldreich, Section 2.3.3. Sets are lists of three distinct natural numbers, and instances are encoded by the set-list encoding encNatSetList of Set Cover, with binary element labels.

Membership in NP selects the sets of the cover (Cslib.Complexity.ThreeExactCover_mem_NP). Hardness is a reduction from positive exact-one satisfiability with exactly three distinct variables per clause and at most three occurrences per variable (Cslib.Complexity.PositiveOneInExactThreeSATThree), which is NP-complete. For a formula with m clauses, the clauses are the elements 0, …, m - 1, and 2m dummy elements m, …, 3m - 1 are added. A variable v occurring in the clauses O_v (one to three of them) contributes the sets O_v ∪ W for every window W of 3 - |O_v| consecutive dummy elements, and every window of three consecutive dummy elements is a set. There are at most 2m + 1 windows of each width, and the gadget is emitted once for each of the 3m variable occurrences, so the instance has O(m²) sets. This is attained: m ≥ 1 clauses on 3m distinct variables give 3m (2m - 1) variable sets and 2m - 2 dummy triples. Enumerating all dummy triples instead would give Θ(m³) sets. This is the padding of the last step of Goldreich's proof (the reduction from 3XC′, with K = m), applied directly to the occurrence sets; the draft pads with arbitrary dummy elements, but consecutive windows suffice.

The draft's proof composes three reductions, from 3SAT with at most three occurrences per variable through set cover with sets of size at most three and exact cover with sets of size at most three. The reduction here starts instead from the exact-one problem, whose NP-hardness is already in the library, and uses only the last of these steps.

Main definitions #

Main results #

References #

D is an exact cover drawn from the sets C: every set of D is a set of C, and every element of a set of C belongs to exactly one set of D.

Exact Cover by 3-sets (3XC): a sequence C of sets of exactly three elements each, some sub-collection of which covers every element of their union exactly once. Sets are lists of three distinct natural numbers.

The windows [m + i, …, m + i + k - 1] of k consecutive dummy elements among the dummy elements m, …, 3m - 1.

The indices of the clauses of φ in which the variable v occurs.

The sets of a variable occurring in the clauses O, padded to three elements by every window of consecutive dummy elements.

A fixed no-instance: {0, 1, 2, 3} is not exactly covered by {0, 1, 2} and {0, 1, 3}.

The reduction from positive exact-three exact-one SAT with at most three occurrences per variable.

Membership in NP #

The shape of the reduced instance #

Occurrences under the syntax guard #

Correctness of the reduction #

Exact covers give exact-one assignments. A variable is set true when a set of the cover consists of its occurrences and it is the least variable with these occurrences.

Exact-one assignments give exact covers. The true variables of the clauses have disjoint occurrence lists covering all clause indices; padding them with distinct dummy elements and covering the remaining dummy elements by triples gives an exact cover.

3XC is in NP: a certificate selects the sets of the exact cover.