Polynomial-Time Approximation Schemes for Knapsack and Related Counting Problems using Branching Programs

  • Parikshit Gopalan ,
  • Adam Klivans ,
  • Raghu Meka

MSR-TR-2010-178 |

We give a deterministic, polynomial-time algorithm for approximately counting the number of f0; 1g-solutions to any instance of the knapsack problem. On an instance of length n with total weight W and accuracy parameter “, our algorithm produces a (1 + “)-multiplicative approximation in time poly(n; logW; 1=”). We also give algorithms with identical guarantees for general integer knapsack, the multidimensional knapsack problem (with a constant number of constraints) and for contingency tables (with a constant number of rows). Previously, only randomized approximation schemes were known for these problems due to work by Morris and Sinclair and work by Dyer. Our algorithms work by constructing small-width, read-once branching programs for approximating the underlying solution space under a carefully chosen distribution. As a byproduct of this approach, we obtain new query algorithms for learning functions of k halfspaces with respect to the uniform distribution on f0; 1gn. The running time of our algorithm is polynomial in the accuracy parameter “. Previously even for the case of k = 2, only algorithms with an exponential dependence on ” were known.