Table of Contents
Fetching ...

Approximately Counting Knapsack Solutions in Subquadratic Time

Weiming Feng, Ce Jin

TL;DR

The algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights, achieving the first sub-quadratic dependence on $n$.

Abstract

We revisit the classic #Knapsack problem, which asks to count the Boolean points $(x_1,\dots,x_n)\in\{0,1\}^n$ in a given half-space $\sum_{i=1}^nW_ix_i\le T$. This #P-complete problem admits $(1\pmε)$-approximation. Before this work, [Dyer, STOC 2003]'s $\tilde{O}(n^{2.5}+n^2{ε^{-2}})$-time randomized approximation scheme remains the fastest known in the natural regime of $ε\ge 1/polylog(n)$. In this paper, we give a randomized $(1\pmε)$-approximation algorithm in $\tilde{O}(n^{1.5}{ε^{-2}})$ time (in the standard word-RAM model), achieving the first sub-quadratic dependence on $n$. Such sub-quadratic running time is rare in the approximate counting literature in general, as a large class of algorithms naturally faces a quadratic-time barrier. Our algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights. We refine Dyer's framework using the following ideas: - We decrease the sample complexity of Dyer's Monte Carlo method, by proving some structural lemmas for typical points near the input hyperplane via hitting-set arguments, and appropriately setting the rounding scale. - Instead of running a vanilla dynamic program on the rounded instance, we employ techniques from the growing field of pseudopolynomial-time Subset Sum algorithms, such as FFT, divide-and-conquer, and balls-into-bins hashing of [Bringmann, SODA 2017]. We also need other ingredients, including a surprising application of the recent Bounded Monotone (max,+)-Convolution algorithm by [Chi-Duan-Xie-Zhang, STOC 2022] (adapted by [Bringmann-Dürr-Polak, ESA 2024]), the notion of sum-approximation from [Gawrychowski-Markin-Weimann, ICALP 2018]'s #Knapsack approximation scheme, and a two-phase extension of Dyer's framework for handling tiny weights.

Approximately Counting Knapsack Solutions in Subquadratic Time

TL;DR

The algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights, achieving the first sub-quadratic dependence on .

Abstract

We revisit the classic #Knapsack problem, which asks to count the Boolean points in a given half-space . This #P-complete problem admits -approximation. Before this work, [Dyer, STOC 2003]'s -time randomized approximation scheme remains the fastest known in the natural regime of . In this paper, we give a randomized -approximation algorithm in time (in the standard word-RAM model), achieving the first sub-quadratic dependence on . Such sub-quadratic running time is rare in the approximate counting literature in general, as a large class of algorithms naturally faces a quadratic-time barrier. Our algorithm follows Dyer's framework, which reduces #Knapsack to the task of sampling (and approximately counting) solutions in a randomly rounded instance with poly(n)-bounded integer weights. We refine Dyer's framework using the following ideas: - We decrease the sample complexity of Dyer's Monte Carlo method, by proving some structural lemmas for typical points near the input hyperplane via hitting-set arguments, and appropriately setting the rounding scale. - Instead of running a vanilla dynamic program on the rounded instance, we employ techniques from the growing field of pseudopolynomial-time Subset Sum algorithms, such as FFT, divide-and-conquer, and balls-into-bins hashing of [Bringmann, SODA 2017]. We also need other ingredients, including a surprising application of the recent Bounded Monotone (max,+)-Convolution algorithm by [Chi-Duan-Xie-Zhang, STOC 2022] (adapted by [Bringmann-Dürr-Polak, ESA 2024]), the notion of sum-approximation from [Gawrychowski-Markin-Weimann, ICALP 2018]'s #Knapsack approximation scheme, and a two-phase extension of Dyer's framework for handling tiny weights.

Paper Structure

This paper contains 28 sections, 25 theorems, 145 equations.

Key Result

Theorem 1.1

There is an FPRAS for (Zero-One) #Knapsack in time

Theorems & Definitions (65)

  • Theorem 1.1: Sub-quadratic time FPRAS for #Knapsack, main
  • Lemma 2.1: FFT
  • Lemma 2.2: Rounding a subgaussian
  • proof
  • Lemma 2.3: Coupling Inequality
  • Lemma 3.1
  • proof
  • Lemma 3.2
  • Lemma 3.3
  • proof : Proof of \ref{['lem:omegadbound']}
  • ...and 55 more