English

A Faster FPTAS for #Knapsack

Data Structures and Algorithms 2018-02-19 v1

Abstract

Given a set W={w1,,wn}W = \{w_1,\ldots, w_n\} of non-negative integer weights and an integer CC, the #Knapsack problem asks to count the number of distinct subsets of WW whose total weight is at most CC. In the more general integer version of the problem, the subsets are multisets. That is, we are also given a set {u1,,un} \{u_1,\ldots, u_n\} and we are allowed to take up to uiu_i items of weight wiw_i. We present a deterministic FPTAS for #Knapsack running in O(n2.5ε1.5log(nε1)log(nε))O(n^{2.5}\varepsilon^{-1.5}\log(n \varepsilon^{-1})\log (n \varepsilon)) time. The previous best deterministic algorithm [FOCS 2011] runs in O(n3ε1log(nε1))O(n^3 \varepsilon^{-1} \log(n\varepsilon^{-1})) time (see also [ESA 2014] for a logarithmic factor improvement). The previous best randomized algorithm [STOC 2003] runs in O(n2.5log(nε1)+ε2n2)O(n^{2.5} \sqrt{\log (n\varepsilon^{-1}) } + \varepsilon^{-2} n^2 ) time. Therefore, in the natural setting of constant ε\varepsilon, we close the gap between the O~(n2.5)\tilde O(n^{2.5}) randomized algorithm and the O~(n3)\tilde O(n^3) deterministic algorithm. For the integer version with U=maxi{ui}U = \max_i \{u_i\}, we present a deterministic FPTAS running in O(n2.5ε1.5log(nε1logU)log(nε)log2U)O(n^{2.5}\varepsilon^{-1.5}\log(n\varepsilon^{-1} \log U)\log (n \varepsilon) \log^2 U) time. The previous best deterministic algorithm [APPROX 2016] runs in O(n3ε1log(nε1logU)log2U)O(n^3\varepsilon^{-1}\log(n \varepsilon^{-1} \log U) \log^2 U) time.

Keywords

Cite

@article{arxiv.1802.05791,
  title  = {A Faster FPTAS for #Knapsack},
  author = {Paweł Gawrychowski and Liran Markin and Oren Weimann},
  journal= {arXiv preprint arXiv:1802.05791},
  year   = {2018}
}
R2 v1 2026-06-23T00:24:07.815Z