## Abstract

Given n elements with nonnegative integer weights w = (w1, . . . ,wn), an integer capacity C and positive integer ranges u = (u1, . . . , un), we consider the counting version of the classic integer knapsack problem: find the number of distinct multisets whose weights add up to at most C. We give a deterministic algorithm that estimates the number of solutions to within relative error ϵ in time polynomial in n, log U and 1/ϵ, where U = maxi ui. More precisely, our algorithm runs in O( n^{3} log^{2} U/ϵ log n log U ϵ ) time. This is an improvement of n^{2} and 1/^{2} (up to log terms) over the best known deterministic algorithm by Gopalan et al. [FOCS, (2011), pp. 817-826]. Our algorithm is relatively simple, and its analysis is rather elementary. Our results are achieved by means of a careful formulation of the problem as a dynamic program, using the notion of binding constraints.

Original language | English |
---|---|

Title of host publication | Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques - 19th International Workshop, APPROX 2016 and 20th International Workshop, RANDOM 2016 |

Editors | Klaus Jansen, Claire Mathieu, Jose D. P. Rolim, Chris Umans |

Publisher | Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing |

ISBN (Electronic) | 9783959770187 |

DOIs | |

State | Published - 1 Sep 2016 |

Externally published | Yes |

Event | 19th International Workshop on Approximation Algorithms for Combinatorial Optimization Problems, APPROX 2016 and the 20th International Workshop on Randomization and Computation, RANDOM 2016 - Paris, France Duration: 7 Sep 2016 → 9 Sep 2016 |

### Publication series

Name | Leibniz International Proceedings in Informatics, LIPIcs |
---|---|

Volume | 60 |

ISSN (Print) | 1868-8969 |

### Conference

Conference | 19th International Workshop on Approximation Algorithms for Combinatorial Optimization Problems, APPROX 2016 and the 20th International Workshop on Randomization and Computation, RANDOM 2016 |
---|---|

Country/Territory | France |

City | Paris |

Period | 7/09/16 → 9/09/16 |

### Bibliographical note

Funding Information:Partial support for this research was provided by the Recanati Fund of the Jerusalem School of Business Administration .

## Keywords

- Approximate counting
- Bounding constraints
- Dynamic programming
- Integer knapsack
- K-Approximating sets and functions.