A Near-Linear Pseudopolynomial Time Algorithm for Subset Sum
Abstract
Given a set Z of n positive integers and a target value t, the Subset Sum problem asks whether any subset of Z sums to t. A textbook pseudopolynomial time algorithm by Bellman from 1957 solves Subset Sum in time O(nt). This has been improved to O(n Z) by Pisinger [J. Algorithms'99] and recently to O(n t) by Koiliaris and Xu [SODA'17]. Here we present a simple randomized algorithm running in time O(n+t). This improves upon a classic algorithm and is likely to be near-optimal, since it matches conditional lower bounds from Set Cover and k-Clique. We then use our new algorithm and additional tricks to improve the best known polynomial space solution from time O(n3 t) and space O(n2) to time O(nt) and space O(n t), assuming the Extended Riemann Hypothesis. Unconditionally, we obtain time O(n t1+) and space O(n t) for any constant > 0.
Turn this paper into a lesson
ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.