Partition

Input

Finite set AA and a size s(a)∈Z+s(a) \in \mathbb{Z}^{+} for each a∈Aa \in A.

Question

Is there a subset A′⊆AA' \subseteq A such that ∑a∈A′s(a)=∑a∈A−A′s(a)\sum_{a \in A'} s(a) = \sum_{a \in A - A'} s(a)?

Classes

Comments

Remains NP-complete even if we require that ∣A′∣=∣A∣2|A'| = \frac{|A|}{2}, or if the elements in AA are ordered as a1,a2,…,a2na_1, a_2, \dots, a_{2n} and we require that A′A' contains exactly one of a2i−1a_{2i-1}, a2ia_{2i} for 1≤i≤n1 \leq i \leq n. However, all these problems can be solved in pseudo-polynomial time by dynamic programming.

Proofs

NP-complete

Transformation from 3-Dimensional Matching (Karp, 1972).

Reducible from

Reducible to

References