Beating Bellman's Algorithm for Subset Sum

Karl Bringmann,Nick Fischer,Vasileios Nakos
2024-10-29
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-\epsilon})$ (for some $\epsilon > 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.
Data Structures and Algorithms
What problem does this paper attempt to address?
### What problem does this paper attempt to solve? This paper aims to solve a long - standing problem in theoretical computer science, that is, whether the time complexity of the Bellman algorithm on the Subset Sum problem can be improved. Specifically, since the Bellman algorithm was proposed in 1957, it has been a classic dynamic programming method for solving the Subset Sum problem. For a given set of integers \( X \) and a target value \( t \), the Bellman algorithm can calculate all possible subset sums \( S(X, t) \) in \( O(|S(X, t)| \cdot n) \) time, where \( |S(X, t)| \) represents the number of subset sums and \( n \) is the size of the set \( X \). However, for a long time, it has been unknown whether the time complexity of the Bellman algorithm can be significantly improved, especially being superior to the Bellman algorithm in all parameter ranges. Although algorithms in some specific scenarios have been improved, such as Bringmann's \( \tilde{O}(t + n) \) time - complexity algorithm [SODA '17] and Bringmann and Nakos's \( \tilde{O}(|S(X, t)|^{4/3}) \) time - complexity algorithm [STOC '20], these improvements do not outperform the Bellman algorithm in all cases. ### Main contributions of the paper In this paper, the authors successfully solve this problem and design a new algorithm that is superior to the Bellman algorithm in all parameter ranges. Specifically, the time complexity of the new algorithm is \( \tilde{O}(|S(X, t)| \cdot \sqrt{n}) \), compared with the time complexity \( O(|S(X, t)| \cdot n) \) of the Bellman algorithm, the new algorithm has an approximate \( \sqrt{n} \) improvement in time. ### Key innovation points The key innovation of the new algorithm lies in introducing a result in additive combinatorics, which has never been applied in algorithm design before. This result in additive combinatorics provides an estimate for a key step, enabling the algorithm to remain efficient in a wider range of parameter ranges. In addition, the authors also show the extended applications of this method in the vector subset sum problem and the unbounded subset sum problem. ### Summary In short, this paper, by introducing new tools in additive combinatorics, achieves a comprehensive improvement of the Bellman algorithm for the first time, thus making an important theoretical breakthrough in the Subset Sum problem.