Partially Ordered Sets Corresponding to the Partition Problem
Abstract
The partition problem is a well-known basic NP-complete problem. We mainly consider the optimization version of it in this paper. The problem has been investigated from various perspectives for a long time and can be solved efficiently in practice. Hence, we might say that the only remaining task is to decide whether the problem can be solved in polynomial time in the number of given integers.
We propose two partially ordered sets (posets) and present a novel methodology for solving the partition problem. The first poset is order-isomorphic to a well-known poset whose structures are related to the solutions of the subset sum problem, while the second is a subposet of the first and plays a crucial role in this paper. We first show several properties of the two posets, such as size, height and width (the largest size of a subset consisting of incomparable elements). Both widths are the same and for congruent to or (mod ). This fact indicates the hardness of the partition problem. We then prove that in general all the candidate solutions correspond to the elements of the second poset, whose size is . Since a partition corresponds to two elements of the poset, the number of the candidate partitions is half of it, that is, . We finally prove that the candidate solutions can be reduced based on the partial order. In particular, we give several polynomially solvable cases by considering the minimal elements of the second poset.
Our approach offers a valuable tool for structural analysis of the partition problem and provides a new perspective on the P versus NP problem.
1 Introduction
The partition problem is formulated as follows: given positive integers , the objective is to decide whether there exists a subset of such that , where
(1) |
In this paper, we mainly consider the optimization version of it: to find a subset of that minimizes the absolute value . Without loss of generality, we can assume that the integers are indexed in non-increasing order, that is,
and that for the simplicity of proof though originally .
The partition problem is one of Karp’s 21 NP-complete problems [11] and is also one of Garey and Johnson’s six basic NP-complete problems [5]. Therefore, the optimization version is known to be NP-hard. It has important applications such as task scheduling [3, 21], and is equivalent to the two-identical-parallel-machine scheduling problem to minimize the makespan.
The problem has been investigated from various perspectives. Several optimal algorithms give exact solutions in exponential time in [5, 8, 12, 17]. Moreover, a variety of heuristic and metaheuristic algorithms have been developed [1, 4, 9, 10, 16]. Thus, we can solve the problem efficiently in practice. An “easy-hard” phase transition was observed and the solution structure has been studied based on the notion and tools from statistical mechanics [2, 6, 7, 15]. An algebraic expression was presented based on the max-plus algebra [13]. We might say that the only remaining task is to decide whether the problem can be solved in polynomial time in .
Furthermore, the number of solutions to the subset sum problem, a special case of which is the partition problem, has been studied. The subset sum problem with positive inputs is to decide whether there exists a subset of such that
where is a given constant, a target. Let denote the number of the solutions. It is known that
[14, 19]. The number is Sequence A025591 in the On-Line Encyclopedia of Integer Sequences [22] and is known to be for congruent to or (mod )[20]. The inequality is established using the properties of a partially ordered set (poset).
The poset is a well-known poset, denoted by in Stanley’s paper [19, Subsection 4.1.2]. The elements of are all the subsets of . Let and be two subsets of with elements and , respectively, and assume that the elements of and are indexed in decreasing order. The partial order is defined as follows: if and only if and for .
To the best of our knowledge, there is no work applying the poset to the partition problem in terms of optimization.
Main results
To define two posets that correspond to the partition problem, we first consider the set of -dimensional vectors of real numbers. Let and , and define a partial order on the set: if and only if
In other words, means that any entry of the cumulative sum of is less than or equal to the corresponding one of .
Let us define a poset that corresponds to the partition problem. Let be the set of all -dimensional vectors with entries in . The size of is of course . The partial order is defined to be the restriction of on , denoted by . The poset is order-isomorphic to under the mapping from to defined by the following rule: Given , we have that if and only if .
Example.


Let us define another poset to be the subset of obtained by deleting from the elements that are less than or greater than , that is, where . The partial order is defined to be the restriction of on , denoted by . The poset can be constructed by truncating the upper part and lower part of . The size of is proved to be .
Example.
Let us consider for . We can easily see that and , the elements of which are incomparable. The Hasse diagrams of and are shown in Figure 3.



To investigate the relationship between the partition problem and the posets and , we rewrite the difference (1) of the partition problem. There is a one-to-one correspondence between and the set of all subsets of . We introduce a mapping from to . To each subset of , we assign defined by
Let . Then
where the dot indicates the usual inner product. Note that and hence , the absolute value of which is equal to . A pair of two elements and corresponds to the partition . We can show that we have only to consider for solving the partition problem.
Theorem 1.
The candidate solutions to the partition problem are the subsets that correspond to the elements of .
The number of the candidate partitions is half of the size of , i.e., , since a partition comprises a subset and its complement. Furthermore, the candidate solutions can be reduced based on the partial order of .
Theorem 2.
Given an instance of the partition problem, the following holds:
-
(1)
If for some subset of satisfying , then for any that satisfies or .
-
(2)
If for some subset of satisfying , then for any that satisfies or .
Using this result, we provide several polynomially solvable cases by considering the minimal elements of .
Theorem 3.
Let be a minimal element of . If , then the subset such that is a solution and the optimal value is .
All the minimal elements are explicitly obtained, as shown in Proposition 15. This is a generalization of the obvious fact that the subset is a solution and the optimal value is if , which is the case where the minimal element is .
Our results are very simple once we realize them. However, the realization was the hard part. The key points are to use instead of when defining the posets and not to limit the candidate solutions to half by assuming, for instance, that a subset of always contains . We believe that our approach offers a valuable tool for structural analysis of the partition problem and provides a new perspective on the P versus NP problem.
The organization in the paper
2 Two posets corresponding to the partition problem
2.1 Preliminaries
In this subsection, we review some standard facts on posets and give some properties of the poset .
Let be a finite poset. We simply denote the poset by and define the relation by if and only if and . A subset of is a chain if it is totally ordered, and a subset of is an antichain if no pair of elements in it is comparable. A chain is a maximal chain if no other element can be added to it without losing the property of being totally ordered. The height (width) of is the largest size of a chain (antichain, resp.) in . An element of is a maximal (minimal) element if it is not less (greater, resp.) than any other element. An element of is the greatest (least) element if it is greater (less, resp.) than any other element.
A poset is graded111There are several competing definitions for graded posets. if it is equipped with a rank function from to that satisfies:
-
(i)
if , then ;
-
(ii)
if covers , i.e., and there is no such that , then .
An element has rank if . By setting the minimum value of the rank function to zero, any graded poset can be partitioned into , where . We denote the size of by . The poset is rank-symmetric if for each . The poset is rank-unimodal if for some , and is Sperner if the width of is equal to . The width is lower bounded by since every is an antichain. In a Sperner poset, the largest one among provides an antichain of maximum size.
A poset is a lattice if any two elements have a least upper bound and a greatest lower bound, denoted by and respectively. A lattice is distributive if for each .
The poset has the following properties [18]:
-
•
The rank function with minimum rank 0 is the sum of elements of a subset. The maximum rank is .
-
•
The poset is rank-symmetric, rank-unimodal and Sperner. Therefore, its width is equal to the size of the middle rank, which is .
-
•
Its height is .
-
•
The poset is a distributive lattice with the greatest element and the least element .
2.2 Properties of the two posets
We will provide the properties of and . We need first to become familiar with some elementary properties of the partial order .
Proposition 4.
For , the following holds:
-
(1)
.
-
(2)
and .
-
(3)
and .
Proof.
Straightforward. ∎
In particular, is equivalent to . In order to examine the poset , we define two operators. Let us denote the th entry of a vector by hereafter.
Definition 5 (Addition operator).
For , the addition operator takes the input with and sets the th entry to , that is,
For other elements , the operation is not defined.
Definition 6 (Swap operator).
For , with , the swap operator takes the input with and , and swaps and , that is,
For other elements , the operation is not defined.
We prove some relationships between the operators and the partial order .
Proposition 7.
In the poset , if and only if is obtained from by applying addition and/or swap operators.
Proof.
Assume that is obtained from by applying addition and/or swap operators. For each and any possible integers and , we have and . Therefore, .
Conversely, assume that . Let . Then is or for . Denote the indices of ’s equal to by in increasing order. Since any entry of the cumulative sum of is nonnegative, we can pair each entry equal to with an entry equal to 2 on the left, that is, we can choose distinct indices of ’s equal to such that . Hence, is decomposed as follows:
where are the indices of the remaining ’s. Since the indices are all distinct, we have This means that is obtained from by applying addition and/or swap operators. ∎
Proposition 8.
In the poset , covers if and only if is obtained from by applying a single operator of the addition operator and the swap operators .
Proof.
Assume that covers , that is, and there is no such that . Suppose, contrary to our claim, that is not obtained from by one of the operators. We have the following three cases:
Case 1: is obtained from by two or more addition and/or swap operators. Then there exists such that since one of the operators always makes the input larger. This is a contradiction.
Case 2: for some . Then . If then . If then . Both lead to Case 1, a contradiction.
Case 3: for some and with . Then and . If then . If then . Both lead to Case 1, a contradiction.
Conversely, assume that is obtained from by applying one of the operators. It is clear that . Suppose, contrary to our claim, that there exists such that . If , then for , and . Thus, for and must be equal to , which is a contradiction. If for some , then for , , , and . Thus, for , , and for , which is also a contradiction. ∎
Proposition 9.
The poset is order-isomorphic to .
Proof.
We need to show that if and only if for each and in .
Assume that . From Proposition 7 it follows that is obtained from by applying addition and/or swap operators. An addition operator increases 1’s of the input by one and a swap operator shifts one of 1’s of the input to the left. Now let have 1’s. Then has at least 1’s, which implies that has at least as many elements as . The left-most 1’s of do not lie more to the right than the 1’s of , which implies that in decreasing order the th element of is not less than that of for . Hence, .
Conversely, assume that . Let and in decreasing order. Then , which means that has at least as many 1’s as , and for , which means that the left-most 1’s of do not lie more to the right than the 1’s of . By the properties of addition and swap operators, is obtained from by applying addition and/or swap operators, that is, . ∎
The poset has the following symmetry.
Proposition 10.
In the poset , if and only if .
Proof.
For each , it holds that . The statement follows immediately from Proposition 4 (3). ∎
It follows from Proposition 9 and its proof and Proposition 10 that the poset has the following properties:
-
•
The rank function with minimum rank 0 is
(2) for , where .
-
•
The poset is rank-symmetric, rank-unimodal and Sperner.
-
•
Its width is .
-
•
Its height is .
-
•
The poset has a certain symmetry: .
-
•
The poset is a distributive lattice. The greatest element and the least one are respectively and .
Remark.
An element of can be also regarded as a path of the random walk on the integer number line which starts at 0 and at each step moves or . The relation means that the path corresponding to does not “exceed” the one corresponding to . Figure 4 shows an example.

We investigate the other poset . Hereafter, let . We will show some properties of .
Let and . We can see that the subposets and of are sublattices of . The least element of is , the rank of which in is if is even and if is odd. The elements of are not in the middle rank of . This is true for by the symmetry of . Therefore, we obtain the next proposition.
Proposition 11.
The width of is the same as that of .
For the size of , the next proposition holds.
Proposition 12.
The size of is .
Proof.
By definition, , where indicates the size of a set. Since and , it is sufficient to show that . Let us regard the elements of as the paths of the random walk. The size is the number of -step paths from 0 never going below 0 (for example, see in Figure 4). Denote the number by and define . Then we have
where is the number of -step paths from 0 to 0 never going below 0, known as the Catalan number. The sequence is known to be . ∎
The poset also has the symmetry.
Proposition 13.
In the poset , if and only if .
Proof.
For each , we show that . Suppose, contrary to our claim, that . Then or , which contradicts . The statement follows immediately from Proposition 4 (3). ∎
Proposition 14.
The poset is graded and one of the rank functions is the same as the rank function (2) of .
Proof.
Denote the rank function of by . We show that a rank function of is . Since is a subposet of , if then . When covers in , suppose, contrary to our claim, that . Then there exists some such that and . Since is not in , or . If then . If then . Either case is a contradiction. ∎
Let . For we denote by the element of
Thus, stands for the element of
Proposition 15.
The maximal (minimal) elements of are , , , , , resp.).
Proof.
We first prove that for is maximal. It is sufficient to show that the elements covering on are not in . If is even, then the last entry of is always for each . From this fact and Proposition 8 it follows that the unique element covering is , that is,
which is greater than . If is odd, then the last entry of might be . The unique element covering is if , and , that is,
if . Both are greater than .
We next prove that no other elements are maximal. Consider a maximal element . Now we distinguish two cases.
Case 1: contains no sequence. Then is a vector with ’s up to some position (possibly none) and then ’s for the rest of the entries, that is, , or . The first two are not obviously in . Since and , the sum must be equal to . Therefore, is
where is odd. This is exactly .
Case 2: contains sequences. We assume that the left-most sequence lies at the th and th positions. Then . Hence, must be equal to . If contains another sequence at the th and th positions, then , which contradicts the maximality. Therefore, the subsequences and contain no sequence. By a similar argument to Case 1, they are , , or empty. Since , we get
where is odd (if then the subsequence is empty). On the other hand, if then , which contradicts the maximality. Hence, is or empty. Consequently, is
which is exactly , where and . Note that if is even and if is odd.
By symmetry, if is a maximal element, then is a minimal element.
∎
Lemma 16.
In the poset with , a minimal element is less than a maximal element with , that is, .
Proof.
Let and . If , then
which is greater than since . If , then
which is evidently greater than . ∎
Note that in the case where , the maximal elements and are also minimal elements.
Proposition 17.
The height of is
Proof.
We first consider the case where . From Lemma 16 it follows that two elements and with are comparable. Let us take a maximal chain containing the two elements. Since is graded, the size of the maximal chain is , where denotes the rank function (2) of and . Therefore, the height is
(3) |
Since for , we have
Substituting these expressions into (3), we obtain
The objective function is symmetric in and , and we can assume that . In the - plane the farthest point from the center point provides the maximum value. Therefore, the candidate points are and . Determining the position of the center point relative to the line , equidistant from the two points, we conclude that the optimal point is for and for . Hence, the height is for and for .
In the case where , the height is , which is obtained by the expression above for . ∎
Summarizing, we have the following properties of :
-
•
The rank function with minimum rank 0 is
for .
-
•
Its size is .
-
•
The poset is rank-symmetric and Sperner.
-
•
Its width is the same as that of , i.e., .
-
•
Its height is for and for .
-
•
The poset also has the same symmetry as : .
-
•
The minimal elements and the maximal ones are respectively and .
It does not seem easy to determine whether is rank-unimodal or not. As a side note, we observed that is rank-unimodal for .
3 Relationship between the partition problem and the posets
We will discuss the relationship between the partition problem and the posets and . We first show the relationship between the difference of the partition problem and the partial order or . To this end, we introduce another expression of the difference . Let defined by for , where . Note that , which is a componentwise inequality. Denote the cumulative sum of by , that is, when . Then . In addition, the relation can be succinctly written as the componentwise inequality .
Proposition 18.
Given two subsets and of , the inequality holds for any if and only if .
Proof.
We denote and by and , respectively.
We first assume that for any . Suppose, contrary to our claim, that for some . Take
Then , which is a contradiction.
We next prove the converse. We assume that , that is, . Suppose, contrary to our claim, that for some . Then we have . Since is nonpositive and is nonnegative, the left-hand side is nonpositive, a contradiction. ∎
A similar statement holds for the poset .
Corollary 19.
Given two subsets and of satisfying , , the inequality holds for any if and only if .
We next provide subsets unnecessary to be considered in the partition problem.
Lemma 20.
If a subset of satisfies or , then there exists some subset of , not equal to or , such that for any .
Proof.
We denote by . For the complement of , we have and . Without loss of generality, we can thus assume that . We need to consider two cases:
Case 1: contains no sequence. Since , it holds that . Take as . Then and . It follows from the former relation and Proposition 18 that holds for any . The latter relation is equivalent to . The inner product of with the nonnegative vector is nonpositive. Thus, for any . Therefore, for any .
By this lemma, it turns out that it is unnecessary to consider the elements of . We then show that in general we must consider all the elements of .
Lemma 21.
Let a subset of satisfy . Then there exists some such that for any that satisfies and is not equal to or .
Proof.
We will prove this by contradiction. Suppose that for any there exists some such that . In particular, implies . Considering another expression of the difference, we deduce that for satisfying there exists some such that . By regarding these expressions as inequalities for , we obtain
We will denote the left-hand side and the set in the union on the right-hand side by and respectively. From the notation and the expression above, we can deduce that is equal to the union of the intersections of with each , that is,
Now choose a minimal decomposition
(4) |
with minimal. Then , since and are linearly independent and and are both in . By minimality, no is contained in the union of other ’s. Take vectors and such that but for and but for . Consider the intersection of and the infinite set . If , then the intersection is empty since and . If , then the intersection is at most one point since . So intersects each in at most one point. Since (4) holds, is a finite set, a contradiction. ∎
We thus can prove Theorem 1.
We will consider an instance of the partition problem, that is, we take a concrete into account. We can reduce the candidate solutions by using the partial order.
Proposition 22.
Given an instance of the partition problem, the following holds:
-
(1)
If for some subset of , then for any that satisfies or .
-
(2)
If for some subset of , then for any that satisfies or .
Proof.
We show the first statement. From Proposition 18 it follows that or . Hence, or . Either case implies that .
In the same manner, we can prove the second. ∎
If the height of is large, we can reduce efficiently the candidate solutions by using Theorem 2. However, this is not the case; its height is , while its width is for congruent to 0 or 3 (mod 4). The large width indicates the hardness of the partition problem.
We will give some polynomially solvable cases by considering the minimal elements of . To this end, we show an interesting property of the minimal elements of .
Lemma 23.
Given a subset of , any minimal element of is less than or equal to either or .
Proof.
Let be a minimal element of , where . We prove that there are subsets such that . Now is
By Proposition 7, is obtained from by applying addition and/or swap operators. We denote by , where . For a nonnegative integer , any containing ’s is greater than or equal to
The number of elements containing ’s is and the total number is as follows:
On the other hand, any , the number of which is , is obviously greater than or equal to . Therefore, we can obtain distinct subsets satisfying the condition, which contain no complementary pair, because otherwise and are comparable by symmetry and this contradicts
Consequently, for each subset of , either or holds. ∎
In some cases, we can easily solve the partition problem.
Proof of Theorem 3.
We obtain the following statement for the maximal element of .
Corollary 24.
If , (applicable for ), and (applicable for ) for some , then the subset such that is a solution and the optimal value is .
Proof.
Rewriting the three inequalities, we have
(5) |
Since , and the elements covering the minimal element are only for and for , it follows from Theorem 2 (1) and Lemma 23 that the candidate solutions are reduced to six elements: , and . The inequalities (5) imply that the subsets such that are solutions and the optimal value is . ∎
It is possible that these conditions could be written down for other elements as well. It is a future problem.
References
- [1] B. Alidaee, F. Glover, G. A. Kochenberger, and C. Rego. A new modeling and solution approach for the number partitioning problem. Journal of Applied Mathematics and Decision Sciences, 2:113–121, 2005.
- [2] C. Borgs, J. Chayes, and B. Pittel. Phase transition and finete-size scaling for the integer partitioning problem. Random Structures & Algorithms, 19:247–288, 2001.
- [3] E. G. Coffman Jr. and G. S. Lueker. Probabilistic Analysis of Packing and Partitioning Algorithms. Wiley, Chichester, 1991.
- [4] L. Fuksz and P. C. Pop. A hybrid genetic algorithm with variable neighborhood search approach to the number partitioning problem. In 8th International Conference on Hybrid Artificial Intelligence Systems, pages 649–658, 2013.
- [5] M. R. Garey and D. S. Johnson. Computers and intractability: A guide to the theory of NP-completeness. W. H. Freeman, New York, 1979.
- [6] I. P. Gent and T. Walsh. Phase transitions and annealed theories: Number partitioning as a case study. In W. Wahlster, editor, ECAI 96 : 12th European Conference on Artificial Intelligence, pages 170–174, Chichester, 1996. Wiley.
- [7] A. K. Hartmann, A. Mann, and W. Radenbach. Solution-space structure of (some) optimization problems. Journal of Physics: Conference Series, 95:012011, 2008.
- [8] E. Horowitz and S. Sahni. Computing partitions with applications to the knapsack problem. Journal of the ACM, 21:277–292, 1974.
- [9] D. S. Johnson, C. R. Aragon, L. A. McGeoch, and C. Schevon. Optimization by simulated annealing: An experimental evaluation; part II, graph coloring and number partitioning. Operations Research, 39:378–406, 1991.
- [10] N. Karmarkar and R. M. Karp. The differencing method of set partitioning. Technical Report, Computer Science Division, University of California, Berkeley, 82/113, 1982.
- [11] R. M. Karp. Reducibility among combinatorial problems. In R. E. Miller, J. W. Thatcher, and J. Bohlinger, editors, Complexity of Computer Computations, pages 85–103, Boston, 1972. Springer.
- [12] R. E. Korf. A complete anytime algorithm for number partitioning. Artificial Intelligence, 106:181–203, 1998.
- [13] S. Kubo and K. Nishinari. An algebraic expression of the number partitioning problem. Discrete Applied Mathematics, 285:283–296, 10 2020.
- [14] Lindström. Conjecture on a theorem similar to Sperner’s. In R. Guy, H. Hanani, N. Sauer, and J. Schönheim, editors, Combinatorial Structures and Their Applications, page 241, New York, 1970. Gordon and Breach.
- [15] S. Mertens. Phase transition in the number partitioning problem. Physical Review Letters, 81:4281–4284, 1998.
- [16] W. Ruml, J. T. Ngo, J. Marks, and S. M. Shieber. Easily searched encodings for number partitioning. Journal of Optimization Theory and Applications, 89:251–291, 1996.
- [17] R. Schroeppels and A. Shamir. A , algorithm for certain NP-complete problems. SIAM Journal on computing, 10:456–464, 1981.
- [18] R. P. Stanley. Weyl groups, the hard Lefschetz theorem, and the Sperner property. SIAM Journal on Algebraic and Discrete Methods, 1:168–184, 1980.
- [19] R. P. Stanley. Some applications of algebra to combinatorics. Discrete Applied Mathematics, 34:241–277, 1991.
- [20] B. D. Sullivan. On a conjecture of Andrica and Tomescu. Journal of Integer Sequences, 16:Article 13.3.1, 2013.
- [21] L.-H. Tsai. Asymptotic analysis of an algorithm for balanced processor scheduling. SIAM Journal on Computing, 21:59–64, 1992.
- [22] D. W. Wilson. Sequence A025591. The On-Line Encyclopedia of Integer Sequences, 2023.