3-partition problem

The problem is to decide whether a given multiset of integers can be partitioned into triplets that all have the same sum.

More precisely: The 3-partition problem remains strongly NP-complete under the restriction that every integer in S is strictly between T/4 and T/2.

This property, and 3-partition in general, is useful in many reductions where numbers are naturally represented in unary.

[1] In the unrestricted-output variant, the m output subsets can be of arbitrary size - not necessarily 3 (but they still need to have the same sum T).

Garey and Johnson (1975) originally proved 3-Partition to be NP-complete, by a reduction from 3-dimensional matching.

[3] The classic reference by Garey and Johnson (1979) describes an NP-completeness proof, reducing from 3-dimensional matching to 4-partition to 3-partition.

We are given an instance of E of 3d-matching, containing some m triplets {wi,xj,yk}, where the vertices are w1,...,wq and x1,...,xq and y1,...,yq.

From the triplets with the 3 matching "real" elements, we construct a valid perfect matching in E. Note that, in the above reduction, the size of each element is polynomial in the input size; hence, this reduction shows that ABCD-partition is strongly NP-hard.