A Complete Anytime Algorithm for Number Partitioning

Abstract Given a set of numbers, the two-way number partitioning problem is to divide them into two subsets, so that the sum of the numbers in each subset are as nearly equal as possible. The problem is NP-complete. Based on a polynomial-time heuristic due to Karmarkar and Karp, we present a new algorithm, called Complete Karmarkar-Karp (CKK), that optimally solves the general number-partitioning problem, and significantly outperforms the best previously-known algorithms for large problem instances. For numbers with twelve significant digits or less, CKK can optimally solve two-way partitioning problems of arbitrary size in practice. For numbers with greater precision, CKK first returns the Karmarkar-Karp solution, then continues to find better solutions as time allows. Over seven orders of magnitude improvement in solution quality is obtained in less than an hour of running time. Rather than building a single solution one element at a time, or modifying a complete solution, CKK constructs subsolutions, and combines them together in all possible ways. This approach may be effective for other NP-hard problems as well.

[1]  Benjamin Yakir,et al.  The Differencing Algorithm LDM for Partitioning: A Proof of a Conjecture of Karmarkar and Karp , 1996, Math. Oper. Res..

[2]  Hector J. Levesque,et al.  Hard and Easy Distributions of SAT Problems , 1992, AAAI.

[3]  Matthew L. Ginsberg,et al.  Limited Discrepancy Search , 1995, IJCAI.

[4]  Toby Walsh,et al.  From Approximate to Optimal Solutions: Constructing Pruning and Propagation Rules , 1997, IJCAI.

[5]  Simon Kasif,et al.  Exploiting Algebraic Structure in Parallel State Space Search , 1994, AAAI.

[6]  Donald R. Jones,et al.  Solving Partitioning Problems with Genetic Algorithms , 1991, International Conference on Genetic Algorithms.

[7]  Richard E. Korf,et al.  From Approximate to Optimal Solutions: A Case Study of Number Partitioning , 1995, IJCAI.

[8]  Raymond E. Miller,et al.  Complexity of Computer Computations , 1972 .

[9]  Mark S. Boddy,et al.  Solving Time-Dependent Planning Problems , 1989, IJCAI.

[10]  Ian P. Gent,et al.  The Number Partition Phase Transition by , 1995 .

[11]  Adi Shamir,et al.  A T=O(2n/2), S=O(2n/4) Algorithm for Certain NP-Complete Problems , 1981, SIAM J. Comput..

[12]  G. S. Lueker,et al.  Probabilistic analysis of optimum partitioning , 1986, Journal of Applied Probability.

[13]  Richard M. Karp,et al.  The Differencing Method of Set Partitioning , 1983 .

[14]  David S. Johnson,et al.  Computers and Intractability: A Guide to the Theory of NP-Completeness , 1978 .

[15]  Tad Hogg,et al.  Phase Transitions in Artificial Intelligence Systems , 1987, Artif. Intell..

[16]  Ellis Horowitz,et al.  Computing Partitions with Applications to the Knapsack Problem , 1974, JACM.

[17]  J. Marks,et al.  Easily searched encodings for number partitioning , 1996 .

[18]  Peter C. Cheeseman,et al.  Where the Really Hard Problems Are , 1991, IJCAI.

[19]  Richard E. Korf,et al.  Improved Limited Discrepancy Search , 1996, AAAI/IAAI, Vol. 1.

[20]  Weixiong Zhang,et al.  A Study of Complexity Transitions on the Asymmetric Traveling Salesman Problem , 1996, Artif. Intell..

[21]  Cecilia R. Aragon,et al.  Optimization by Simulated Annealing: An Experimental Evaluation; Part II, Graph Coloring and Number Partitioning , 1991, Oper. Res..