[Paper Review] Subset Sum Made Simple
This paper presents a new, conceptually simple algorithm for the Subset Sum problem using divide-and-conquer and Fast Fourier Transform (FFT), achieving a time complexity of $\tilde{O}(\sqrt{n}\,t)$, matching the best-known deterministic running time. The approach partitions the input set by congruence modulo $\lfloor\sqrt{n\log n}\rfloor$, computes subset sums recursively within each residue class, and combines results via FFT-based convolution.
Subset Sum is a classical optimization problem taught to undergraduates as an example of an NP-hard problem, which is amenable to dynamic programming, yielding polynomial running time if the input numbers are relatively small. Formally, given a set $S$ of $n$ positive integers and a target integer $t$, the Subset Sum problem is to decide if there is a subset of $S$ that sums up to $t$. Dynamic programming yields an algorithm with running time $O(nt)$. Recently, the authors [SODA '17] improved the running time to $ ilde{O}\bigl(\sqrt{n}t\bigr)$, and it was further improved to $ ilde{O}\bigl(n+t\bigr)$ by a somewhat involved randomized algorithm by Bringmann [SODA '17], where $ ilde{O}$ hides polylogarithmic factors. Here, we present a new and significantly simpler algorithm with running time $ ilde{O}\bigl(\sqrt{n}t\bigr)$. While not the fastest, we believe the new algorithm and analysis are simple enough to be presented in an algorithms class, as a striking example of a divide-and-conquer algorithm that uses FFT to a problem that seems (at first) unrelated. In particular, the algorithm and its analysis can be described in full detail in two pages (see pages 3-5).
Motivation & Objective
- To present a simpler and more intuitive algorithm for the Subset Sum problem that achieves the state-of-the-art deterministic time complexity.
- To demonstrate how FFT can be applied in a non-obvious way to solve a classic dynamic programming problem with pseudopolynomial time complexity.
- To provide a clean, teachable algorithm suitable for inclusion in advanced algorithms courses.
- To reduce the conceptual and technical complexity compared to prior approaches, particularly Bringmann's randomized algorithm and the authors' earlier method.
- To offer a unified and transparent analysis that can be fully explained in two pages, enhancing pedagogical accessibility.
Proposed method
- Partition the input set $S$ of $n$ positive integers into $b = \lfloor \sqrt{n\log n} \rfloor$ residue classes modulo $b$, based on $x \bmod b$.
- For each residue class $S_\ell$, transform elements into $Q_\ell = \{(x - \ell)/b \mid x \in S_\ell\}$ to reduce the problem to smaller subset sum instances.
- Recursively compute all subset sums with cardinality information $\mathcal{S}^{\#}_{u/b}(Q_\ell)$ using a standard divide-and-conquer approach.
- Map the results back to original sums via $zb + \ell j$ for each pair $(z,j) \in \mathcal{S}^{\#}_{u/b}(Q_\ell)$, yielding $\mathcal{S}_u(S_\ell)$.
- Combine the subset sums of all residue classes using $u$-bounded pairwise sum operation $\oplus_u$, implemented efficiently via FFT.
- Use the FFT-based convolution to compute the union of subset sums across classes in $O(b u \log u)$ time, leveraging the fact that $b = \Theta(\sqrt{n\log n})$.
Experimental results
Research questions
- RQ1Can a simpler, deterministic algorithm be designed for Subset Sum that achieves the $\tilde{O}(\sqrt{n}\,t)$ time complexity without relying on complex randomization or intricate recursion structures?
- RQ2How can the Fast Fourier Transform (FFT) be effectively applied to a problem like Subset Sum, which does not inherently involve convolution?
- RQ3Is it possible to design a divide-and-conquer algorithm for Subset Sum that partitions the input by congruence and uses FFT to combine results efficiently?
- RQ4What is the minimal conceptual overhead required to achieve near-optimal pseudopolynomial time complexity in Subset Sum?
- RQ5Can the algorithm be made sufficiently transparent and self-contained to be taught in a standard algorithms course?
Key findings
- The proposed algorithm computes all subset sums up to $u$ in $O(\sqrt{n\log n}\,u\log u)$ time, matching the best-known deterministic running time of $\tilde{O}(\sqrt{n}\,t)$ when $u = t$.
- The algorithm achieves this result through a clean divide-and-conquer strategy that partitions the input by congruence modulo $\lfloor \sqrt{n\log n} \rfloor$, reducing the problem size and enabling efficient FFT-based combination.
- The use of FFT to compute the union of subset sums across residue classes is central to the efficiency, with the total cost of combining results bounded by $O(b u \log u)$, where $b = \lfloor \sqrt{n\log n} \rfloor$.
- The algorithm is deterministic and avoids the complex randomization and two-stage color-coding used in Bringmann's $\tilde{O}(n + t)$ algorithm, making it more accessible for teaching and implementation.
- The analysis is concise and can be fully presented in two pages, making it suitable for inclusion in advanced algorithms textbooks and courses.
- The algorithm generalizes to the AllSubsetSums problem, computing all subset sums with cardinality information, and thus applies directly to the original Subset Sum decision problem.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.