Table of Contents
Fetching ...

Beating Bellman's Algorithm for Subset Sum

Karl Bringmann, Nick Fischer, Vasileios Nakos

TL;DR

This work positively resolve the question whether Subset Sum is in time $\tilde O(|\mathcal S(X, t)| \cdot n^{1-\epsilon})$ and design an algorithm that outperforms Bellman's algorithm in all regimes.

Abstract

Bellman's algorithm for Subset Sum is one of the earliest and simplest examples of dynamic programming, dating back to 1957. For a given set of $n$ integers $X$ and a target $t$, it computes the set of subset sums $\mathcal S(X, t)$ (i.e., the set of integers $s \in [0\ldots t]$ for which there is a subset of $X$ summing to $s$) in time $O(|\mathcal S(X, t)| \cdot n)$. Since then, it has been an important question whether Bellman's seminal algorithm can be improved. This question is addressed in many recent works. And yet, while some algorithms improve upon Bellman's algorithm in specific parameter regimes, such as Bringmann's $\tilde O(t + n)$-time algorithm [SODA '17] and Bringmann and Nakos' $\tilde O(|\mathcal S(X, t)|^{4/3})$-time algorithm [STOC '20], none of the known algorithms beats Bellman's algorithm in all regimes. In particular, it remained open whether Subset Sum is in time $\tilde O(|\mathcal S(X, t)| \cdot n^{1-ε})$ (for some $ε> 0$). In this work we positively resolve this question and design an algorithm that outperforms Bellman's algorithm in all regimes. Our algorithm runs in time $\tilde O(|\mathcal S(X, t)| \cdot \sqrt{n})$, thus improving the time complexity by a factor of nearly $\sqrt n$. Our key innovation is the use of a result from additive combinatorics, which has not been applied in an algorithmic context before and which we believe to be of further independent interest for algorithm design. To demonstrate the broader applicability of our approach, we extend our ideas to a variant of Subset Sum on vectors as well as to Unbounded Subset Sum.

Beating Bellman's Algorithm for Subset Sum

TL;DR

This work positively resolve the question whether Subset Sum is in time and design an algorithm that outperforms Bellman's algorithm in all regimes.

Abstract

Bellman's algorithm for Subset Sum is one of the earliest and simplest examples of dynamic programming, dating back to 1957. For a given set of integers and a target , it computes the set of subset sums (i.e., the set of integers for which there is a subset of summing to ) in time . Since then, it has been an important question whether Bellman's seminal algorithm can be improved. This question is addressed in many recent works. And yet, while some algorithms improve upon Bellman's algorithm in specific parameter regimes, such as Bringmann's -time algorithm [SODA '17] and Bringmann and Nakos' -time algorithm [STOC '20], none of the known algorithms beats Bellman's algorithm in all regimes. In particular, it remained open whether Subset Sum is in time (for some ). In this work we positively resolve this question and design an algorithm that outperforms Bellman's algorithm in all regimes. Our algorithm runs in time , thus improving the time complexity by a factor of nearly . Our key innovation is the use of a result from additive combinatorics, which has not been applied in an algorithmic context before and which we believe to be of further independent interest for algorithm design. To demonstrate the broader applicability of our approach, we extend our ideas to a variant of Subset Sum on vectors as well as to Unbounded Subset Sum.

Paper Structure

This paper contains 24 sections, 17 theorems, 29 equations, 4 algorithms.

Key Result

theorem 1.1

Given a multiset $X \subseteq [0 \ldots t]$, we can compute $\mathcal{S}(X, t)$ in time $\widetilde{O}(|\mathcal{S}(X, t)| \cdot \sqrt{n})$ (by a randomized algorithm that succeeds with high probability).

Theorems & Definitions (29)

  • theorem 1.1
  • theorem 1.2: Unbounded Subset Sum
  • theorem 1.3: High-Dimensional Subset Sum
  • lemma 2.1
  • proof
  • lemma 2.2: Sumset Computation BringmannFN22JinX24
  • lemma 3.1: Large Items
  • proof : Proof Sketch
  • lemma 3.2: Small Items
  • theorem 3.3: Sub-Multiplicativity of Sumsets GyarmatiMR10
  • ...and 19 more