Computing Partitions with Applications to the Knapsack Problem

  • Authors:
  • Ellis Horowitz;Sartaj Sahni

  • Affiliations:
  • Computer Science Program, University of Southern Califorina, Los Angles, CA and Cornell University, Ithaca, New York;Department of CICS, Unversity of Minnesota, Minneapolis MN and Cornell University, Ithaca, New York

  • Venue:
  • Journal of the ACM (JACM)
  • Year:
  • 1974

Quantified Score

Hi-index 0.02

Visualization

Abstract

Given r numbers s1, ···, sr, algorithms are investigated for finding all possible combinations of these numbers which sum to M. This problem is a particular instance of the 0-1 unidimensional knapsack problem. All of the usual algorithms for this problem are investigated in terms of both asymptotic computing times and storage requirements, as well as average computing times. We develop a technique which improves all of the dynamic programming methods by a square root factor. Empirical studies indicate this new algorithm to be generally superior to all previously known algorithms. We then show how this improvement can be incorporated into the more general 0-1 knapsack problem obtaining a square root improvement in the asymptotic behavior. A new branch and search algorithm that is significantly faster than the Greenberg and Hegerich algorithm is also presented. The results of extensive empirical studies comparing these knapsack algorithms are given