Given a set of non-negative integer weights and an integer , the #Knapsack problem asks to count the number of distinct subsets of whose total weight is at most . In the more general integer version of the problem, the subsets are multisets. That is, we are also given a set and we are allowed to take up to items of weight . We present a deterministic FPTAS for #Knapsack running in time. The previous best deterministic algorithm [FOCS 2011] runs in $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(n^{2.5} \sqrt{\log (n\varepsilon^{-1}) } + \varepsilon^{-2} n^2 )\varepsilon$, we close the gap between the randomized algorithm and the deterministic algorithm. For the integer version with , we present a deterministic FPTAS running in $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(n^3\varepsilon^{-1}\log(n \varepsilon^{-1} \log U) \log^2 U)$ time.

生成讲解博客的中文版本

生成AI智能校验的中文版本