Article ID | Journal | Published Year | Pages | File Type |
---|---|---|---|---|
4952513 | Theoretical Computer Science | 2016 | 7 Pages |
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(n3log2â¡Uϵlogâ¡nlogâ¡Uϵ) time. This is an improvement of n2 and 1/ϵ (up to log terms) over the best known deterministic algorithm by Gopalan et al. (2011) [5]. 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.
Related Topics
Physical Sciences and Engineering
Computer Science
Computational Theory and Mathematics
Authors
Nir Halman,