摘要

Given n elements with nonnegative integer weights w(1),..., w(n) and an integer capacity C, we consider the counting version of the classic knapsack problem: find the number of distinct subsets whose weights add up to at most the given capacity. We give a deterministic algorithm that estimates the number of solutions to within relative error 1 +/-epsilon in time polynomial in n and 1/epsilon ( fully polynomial approximation scheme). More precisely, our algorithm takes time O(n(3)epsilon(-1) log(n/epsilon)). Our algorithm is based on dynamic programming. Previously, randomized polynomial-time approximation schemes were known first by Morris and Sinclair via Markov chain Monte Carlo techniques and subsequently by Dyer via dynamic programming and rejection sampling.

  • 出版日期2012