Efficient reductions and algorithms for variants of Subset Sum
Abstract
Given (a1, …, an, t) ∈ Z≥ 0n + 1, the Subset Sum problem (SSUM) is to decide whether there exists S ⊂eq [n] such that Σi ∈ S ai = t. There is a close variant of the SSUM, called Subset~Product. Given positive integers a1, ..., an and a target integer t, the Subset~Product problem asks to determine whether there exists a subset S ⊂eq [n] such that Πi ∈ S ai=t. There is a pseudopolynomial time dynamic programming algorithm, due to Bellman (1957) which solves the SSUM and Subset~Product in O(nt) time and O(t) space. In the first part, we present search algorithms for variants of the Subset Sum problem. Our algorithms are parameterized by k, which is a given upper bound on the number of realisable sets (i.e.,~number of solutions, summing exactly t). We show that SSUM with a unique solution is already NP-hard, under randomized reduction. This makes the regime of parametrized algorithms, in terms of k, very interesting. Subsequently, we present an O(k· (n+t)) time deterministic algorithm, which finds the hamming weight of all the realisable sets for a subset sum instance. We also give a poly(knt)-time and O((knt))-space deterministic algorithm that finds all the realisable sets for a subset sum instance. In the latter part, we present a simple and elegant randomized O(n + t) time algorithm for Subset~Product. Moreover, we also present a poly(nt) time and O(2 (nt)) space deterministic algorithm for the same. We study these problems in the unbounded setting as well. Our algorithms use multivariate FFT, power series and number-theoretic techniques, introduced by Jin and Wu (SOSA'19) and Kane (2010).
Turn this paper into a full lesson
ArcXiv compiles a staged curriculum from this paper: 8-12 lessons across beginner → advanced, synthesised section guides, visuals, flashcards, a quiz, exercises, and on-demand deep dives per section. Grounded in the abstract, never invented.