Lune

SODA2025Top-tier venue

Approximately Counting Knapsack Solutions in Subquadratic Time

Weiming Feng, Ce Jin

Abstract

We revisit the classic #Knapsack problem, which asks to count the Boolean points (x 1 , x 2 , . . . , x n ) ∈ 0, 1 n in a given half-space n i=1 W i x i ≤ T . This #P-complete problem is known to admit (1±ε)-approximation. Before this work, [Dyer, STOC 2003]'s O(n 2.5 +n 2 ε -2 )-time randomized approximation scheme remains the fastest known in the natural regime of ε ≥ 1/ poly log n.

In this paper, we give a randomized (1 ± ε)-approximation algorithm for #Knapsack in 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:

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Approximating Knapsack and Partition via Dense Subset Sums cites A Fine-Grained Perspective on Approximating Subset Sum and Partition
  • A Nearly Quadratic-Time FPTAS for Knapsack cites Approximating Knapsack and Partition via Dense Subset Sums
  • A Nearly Quadratic-Time FPTAS for Knapsack cites A Fine-Grained Perspective on Approximating Subset Sum and Partition
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on8

  1. Optimal mixing of Glauber dynamics: entropy factorization via high-dimensional expansionZongchen Chen, Kuikui Liu, Eric VigodaSTOC 2021 · 61 citations
  2. A Fine-Grained Perspective on Approximating Subset Sum and PartitionKarl Bringmann, Vasileios NakosSODA 2021 · 14 citations
  3. Faster min-plus product for monotone instancesShucheng Chi, Ran Duan, Tianle Xie, Tianyi ZhangSTOC 2022 · 12 citations
  4. Approximating Knapsack and Partition via Dense Subset SumsMingyang Deng, Ce Jin, Xiao MaoSODA 2023 · 10 citations
  5. A Nearly Quadratic-Time FPTAS for KnapsackLin Chen, Jiayi Lian, Yuchen Mao, Guochuan ZhangSTOC 2024 · 4 citations

Related papers

  1. (1 - ε)-Approximation of Knapsack in Nearly Quadratic TimeXiao MaoSTOC 2024
  2. Knapsack with Small Items in Near-Quadratic TimeKarl BringmannSTOC 2024 · 8 citations
  3. Derandomizing Pseudopolynomial Algorithms for Subset SumTimothy M. ChanSODA 2026
  4. 0-1 Knapsack in Nearly Quadratic TimeCe JinSTOC 2024 · 6 citations
  5. Improving Schroeppel and Shamir's algorithm for subset sum via orthogonal vectorsJesper Nederlof, Karol WegrzyckiSTOC 2021
Dusk over the sea between two cliffs drawn in fine vertical lines