3-partition problem
The 3-partition problem is a strongly NP-complete problem in computer science.[src] The problem is to decide whether a given multiset of integers can be partitioned into triplets that all have the same sum.[src] More precisely: * Input: a multiset S containing n positive integer elements.[src] * Conditions: S must be partitionable into m triplets, S 1 , S 2 , ..., S m , where n = 3m.[src] These triplets partition S in the sense that they are disjoint and they cover S.[src] The target value T is computed by taking the sum of all elements in S, then dividing by m.[src] * Output: whether or not there exists a partition of S such that, for all triplets, the sum of the elements in each triplet equals T.[src] The 3-partition problem remains strongly NP-complete under the restriction that every integer in S is strictly between T/4 and T/2.[src]
The 3-partition problem is a strongly NP-complete problem in computer science.[src] The problem is to decide whether a given multiset of integers can be partitioned into triplets that all have the same sum.[src] More precisely: Input: a multiset S containing n positive integer elements.[src] Conditions: S must be partitionable into m triplets, S 1 , S 2 , ..., S m , where n = 3m.[src] These triplets partition S in the sense that they are disjoint and they cover S.[src] The target value T is computed by taking the sum of all elements in S, then dividing by m.[src] Output: whether or not there exists a partition of S such that, for all triplets, the sum of the elements in each triplet equals T.[src] The 3-partition problem remains strongly NP-complete under the restriction that every integer in S is strictly between T/4 and T/2.[src] ==Example== The set S = \{ 20, 23, 25, 30, 49, 45, 27, 30, 30, 40, 22, 19 \} can be partitioned into the four sets \{ 20, 25, 45 \}, \{ 23, 27, 40 \}, \{ 49, 22, 19 \} , \{ 30, 30, 30\} , each of which sums to T = 90.[src] The set S = \{1, 2, 5, 6, 7, 9\} can be partitioned into the two sets \{1, 5, 9\}, \{2, 6, 7\} each of which sum to T = 15.[src] (every integer in S is strictly between T/4 and T/2): S = \{4,5,5,5,5,6\} , thus m=2, and T=15.[src] There is feasible 3-partition \{4,5,6\}, \{5,5,5\} .[src] (every integer in S is strictly between T/4 and T/2): S = \{4,4,4,6,6,6\} , thus m=2, and T=15.[src] There is no feasible solution.[src] ==Strong NP-completeness== The 3-partition problem remains NP-complete even when the integers in S are bounded above by a polynomial in n.[src] In other words, the problem remains NP-complete even when representing the numbers in the input instance in unary.[src] i.e., 3-partition is NP-complete in the strong sense or strongly NP-complete.[src] This property, and 3-partition in general, is useful in many reductions where numbers are naturally represented in unary.[src] The 3-partition problem is similar to the partition problem, in which the goal is to partition S into two subsets with equal sum, and the multiway number partitioning, in which the goal is to partition S into k subsets with equal sum, where k is a fixed parameter.[src] In 3-Partition the goal is to partition S into m = n/3 subsets, not just a fixed number of subsets, with equal sum.[src] Partition is "easier" than 3-Partition: while 3-Partition is strongly NP-hard, Partition is only weakly NP-hard - it is hard only when the numbers are encoded in non-unary system, and have value exponential in n.[src] When the values are polynomial in n, Partition can be solved in polynomial time using the pseudopolynomial time number partitioning algorithm.[src] ==Variants== In the unrestricted-input variant, the inputs can be arbitrary integers; in the restricted-input variant, the inputs must be in (T/4, T/2).[src] The restricted version is as hard as the unrestricted version: given an instance S u of the unrestricted variant, construct a new instance of the restricted version .[src] Every solution of S u corresponds to a solution of S r but with a sum of 7 instead of T, and every element of S r is in which is contained in .[src] In the distinct-input variant, the inputs must be in (T/4, T/2), and in addition, they must all be distinct integers.[src] It, too, is as hard as the unrestricted version.[src] 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).[src] The restricted-output variant can be reduced to the unrestricted-variant: given an instance S r of the restricted variant, with 3m items summing up to mT, construct a new instance of the unrestricted variant , with 3m items summing up to 7mT, and with target sum 7 .[src] Every solution of S r naturally corresponds to a solution of S u .[src] Conversely, in every solution of S u , since the target sum is 7 and each element is in , there must be exactly 3 elements per set, so it corresponds to a solution of S r .[src] The ABC-partition problem (also called numerical 3-d matching) is a variant in which, instead of a set S with 3 integers, there are three sets A, B, C with m integers in each.[src] The sum of numbers in all sets is .[src] The goal is to construct m triplets, each of which contains one element from A, one from B and one from C, such that the sum of each triplet is T.[src] The 4-partition problem is a variant in which S contains n = 4 integers, the sum of all integers is , and the goal is to partition it into m quadruplets, all with a sum of T.[src] It can be assumed that each integer is strictly between T/5 and T/3.[src] Similarly, ABCD-partition is a variant of 4-partition in which there are 4 input sets and each quadruplet should contain one element from each set.[src] For each triplet t = {w i ,x j ,y k } in E, the set B contains w it , C contains x jt , and D contains y kt .[src] So for each of w i , x j , y k , there may be many corresponding elements in B, C, D - one for each triplet in which they appear.[src] We consider one of these elements (denoted by "1") as the "real" one, and the others as "dummy" ones.[src] The element sizes are as follows: The sum of every three "real" elements or every three "dummy" elements is 30r 4 +ir+jr 2 +kr 3 ; and if the triplet element is added, the sum is 40r 4 .[src] The threshold for the ABCD-partition instance is T=40r 4 .[src] Note that the size of each element is in (T/3,T/5).[src] Given a perfect matching in E, we construct a 4-partition of ABCD as follows: For each triplet in the matching, we construct a 4-set .[src] For each triplet not in the matching, we construct a similar 4-set, but with the corresponding dummy elements.[src] In both cases, the sum of the 4-set is 40r 4 as needed.[src] Given a partition of ABCD, the sum of each 4-set is .[src] Therefore, the terms with and must cancel out, and the terms with must sum up to ; so the 4-set must contain a triplet and three matching "real" elements, or a triplet and three matching "dummy" elements.[src] From the triplets with the three matching "real" elements, we construct a valid perfect matching in .[src] 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.[src] Every ABCD-partition corresponds naturally to a 4-partition.[src] Conversely, in every 4-partition, the sum modulo 16 is 15, and therefore it must contain exactly one item with size modulo 16 = 1, 2, 4, 8; this corresponds to exactly one item from A, B, C, D, from which we can construct an ABCD-partition.[src] Using a similar reduction, ABC-partition can be reduced to 3-partition.[src] For each a i in A, B contains a "regular" element w i = 4*(5T+a i )+1.[src] All in all there are 4m regular elements, summing up to 81mT + 4m.[src] For each pair of elements a i ,a j in A, B contains two "pairing" elements: u ij = 4*(6T - a i - a j )+2 and u ij ' = 4*(5T + a i + a j )+2.[src] All in all there are 4m*(4m-1) pairing elements, summing up to (88mT+16m)*(4m-1).[src] Additionally, B contains 8m 2 -3m "filler" elements, with size 20T, and total sum (8m 2 -3m)*20T.[src] All in all, B contains 24m 2 -3m = 3(8m 2 -m) elements, with sum (64T+4)*(8m 2 -m).[src] The threshold for the 3-partition instance is 64T+4; note that the sizes of all elements in B are in (16T+1,32T+2).[src] Given a 4-partition of A, we construct a 3-partition for B as follows: For each 4-set {a 1 ,a 2 ,a 3 ,a 4 } with sum T, we construct a 3-set {w 1 ,w 2 ,u 12 } with sum 4*(5T+a 1 +5T+a 2 +6T-a 1 -a 2 )+1+1+2=64T+4 and another 3-set {w 3 ,w 4 ,u 12 '} with sum 4*(5T+a 3 +5T+a 4 +5T+a 1 +a 2 )+1+1+2=64T+4.[src] These sets contain all 4m regular elements and 2m matching pairs of pairing elements.[src] From the remaining elements, we construct 3-sets {u ij ,u ij ',filler} with sum 4*(6T-a i -a j +5T+a i +a j +5T)+2+2=64T+4.[src] Conversely, given a 3-partition of B, the sum of each 3-set is a multiple of 4, so it must contain either two regular items and one pairing item, or two pairing items and one filler item: If a 3-set contains two pairing items u ij , u kl and one filler item, then the sum of the two pairing items must be 44T+4 = 4*(5T+6T)+2+2, so they must have matching sizes (a i +a j =a k +a l ).[src] Therefore, by replacing as needed, we can assume that the two pairing items are in fact u ij and u ij '.[src] Therefore, the remaining pairing items also consist of n matching pairs.[src] Therefore, the remaining 3-sets can be partitioned into two groups: n 3-sets containing the items u ij , and n 3-sets containing the items u ij '.[src] In each matching pair of 3-sets, the sum of the two pairing items u ij +u ij ' is 44T+4, so the sum of the four regular items is 84T+4.[src] Therefore, from the four regular items, we construct a 4-set in A, with sum T.[src] ==References==[src]
78 sentences · 78 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"3-partition problem." encyclopegia.org, 2026, https://encyclopegia.org/wiki/3-partition-problem. Accessed 01 December 2026.
Chicago
"3-partition problem." encyclopegia.org. Accessed December 1, 2026. https://encyclopegia.org/wiki/3-partition-problem.
APA
encyclopegia.org. (2026). 3-partition problem. Retrieved December 1, 2026, from https://encyclopegia.org/wiki/3-partition-problem
Accessed December 1, 2026 · CC BY-SA 4.0 · citation page · JSON