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

We give a deterministic, polynomial-time algorithm for approximately counting the number of {0,1}-solutions to any instance of the knapsack problem. On an instance of length n with total weight W and accuracy parameter eps, our algorithm produces a (1 + eps)-multiplicative approximation in time poly(n,log W,1/eps). 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 {0,1}^n. The running time of our algorithm is polynomial in the accuracy parameter eps. Previously even for the case of k=2, only algorithms with an exponential dependence on eps were known.

[1]  Vasileios Vasaitis Approximate Counting by Dynamic Programming , 2005 .

[2]  David Gamarnik,et al.  Simple deterministic approximation algorithms for counting matchings , 2007, STOC '07.

[3]  Martin E. Dyer,et al.  A Mildly Exponential Time Algorithm for Approximating the Number of Solutions to a Multidimensional Knapsack Problem , 1993, Combinatorics, Probability and Computing.

[4]  Eric Vigoda,et al.  A polynomial-time approximation algorithm for the permanent of a matrix with nonnegative entries , 2004, JACM.

[5]  Rocco A. Servedio,et al.  Bounded Independence Fools Halfspaces , 2009, 2009 50th Annual IEEE Symposium on Foundations of Computer Science.

[6]  P. Gopalan,et al.  Fooling Functions of Halfspaces under Product Distributions , 2010, 2010 IEEE 25th Annual Conference on Computational Complexity.

[7]  Nader H. Bshouty,et al.  On Learning width Two Branching Programs , 1998, Inf. Process. Lett..

[8]  Diego Klabjan,et al.  A Fully Polynomial Time Approximation Scheme for Single-item Stochastic Inventory Control with Discrete Demand , 2022 .

[9]  David Zuckerman,et al.  Pseudorandom generators for polynomial threshold functions , 2009, STOC '10.

[10]  Rocco A. Servedio,et al.  Learning intersections and thresholds of halfspaces , 2002, The 43rd Annual IEEE Symposium on Foundations of Computer Science, 2002. Proceedings..

[11]  Alistair Sinclair,et al.  Random walks on truncated cubes and sampling 0-1 knapsack solutions , 1999, 40th Annual Symposium on Foundations of Computer Science (Cat. No.99CB37039).

[12]  Dana Angluin,et al.  Learning Regular Sets from Queries and Counterexamples , 1987, Inf. Comput..

[13]  Eric Vigoda,et al.  A Deterministic Polynomial-Time Approximation Scheme for Counting Knapsack Solutions , 2010, SIAM J. Comput..

[14]  Dror Weitz,et al.  Counting independent sets up to the tree threshold , 2006, STOC '06.

[15]  David Zuckerman,et al.  Deterministic extractors for small-space sources , 2011, J. Comput. Syst. Sci..

[16]  Rocco A. Servedio,et al.  Every Linear Threshold Function has a Low-Weight Approximator , 2006, 21st Annual IEEE Conference on Computational Complexity (CCC'06).

[17]  Ronitt Rubinfeld,et al.  On learning bounded-width branching programs , 1995, COLT '95.

[18]  Martin E. Dyer,et al.  Approximate counting by dynamic programming , 2003, STOC '03.