Abstract
Multi-way number partitioning is a fundamental NP-complete problem with critical applications in resource allocation and multi-processor scheduling. While efficient solutions exist for two-way partitioning, scaling to three or more subsets has historically been computationally prohibitive. This paper presents Sequential Number Partitioning (SNP) and Recursive Number Partitioning (RNP), two linear-space algorithms that utilize a "Principle of Optimality" to achieve performance gains of up to six orders of magnitude over previous state-of-the-art methods like the Complete Greedy Algorithm (CGA) and Complete Karmarkar-Karp (CKK).
Introduction
The number partitioning problem involves dividing a set of $n$ integers into $k$ subsets such that the sums of the elements in each subset are as equal as possible. This problem is notoriously difficult (NP-complete) and serves as a model for tasks like assigning jobs to identical processors to minimize the makespan. Traditional approaches, such as CGA and CKK, struggle as $k$ increases, often requiring days to solve relatively small instances.
Methodology
The breakthrough in this research comes from restructuring the multi-way problem into a series of simpler sub-problems.
Sequential Number Partitioning (SNP)
SNP operates by selecting one complete subset at a time using an inclusion-exclusion binary tree search. Once a subset is defined, the algorithm leverages the high efficiency of the CKK algorithm to optimally partition the remaining elements into the remaining $k-1$ subsets.
Recursive Number Partitioning (RNP)
RNP extends the SNP logic by applying it recursively. For an even number of subsets, it performs a top-level two-way split and recurses on each half. For an odd number, it isolates one subset and recurses on the remainder.
The Principle of Optimality
The efficiency of these algorithms is rooted in the "Principle of Optimality": the author proves that if an optimal $k$-way partition contains a specific subset, the remaining elements must be optimally partitioned into $k-1$ subsets to maintain overall optimality. This allows for aggressive pruning of the search space using sophisticated lower and upper bounds.
Experimental Results
The algorithms were tested on synthetic datasets of random integers. The performance improvements are most evident in the "hard" instances of the problem, where the number of integers $N$ is neither too small (few combinations) nor too large (many perfect partitions exist).
Performance Gains
In three-way partitioning, SNP demonstrates a massive advantage over CKK. As shown in Figure 1, for $N=35$, SNP is over 24,000 times faster than the previous state-of-the-art.
The speedup is even more pronounced in higher-order partitioning. For five-way partitioning, RNP's recursive structure allows it to solve instances in seconds that would take CGA days. At $N=33$, RNP is more than 1.7 million times faster than CGA, solving a nearly 9-day problem in less than half a second.
Discussion and Conclusion
While the number partitioning problem remains NP-complete and inherently exponential, SNP and RNP significantly push the boundaries of what is solvable. By transforming the multi-way problem into a sequence of optimized sub-problems, these algorithms provide a practical path for solving complex scheduling and partitioning tasks that were previously out of reach. Future work will focus on generalizing these implementations for arbitrary values of $k$ and establishing formal theoretical complexity bounds.
Summary updated