Sumsets, 3SUM, Subset Sum: Now for Real!

Nick Fischer
2024-10-29
Abstract:We study a broad class of algorithmic problems with an "additive flavor" such as computing sumsets, 3SUM, Subset Sum and geometric pattern matching. Our starting point is that these problems can often be solved efficiently for integers, owed to the rich available tool set including bit-tricks, linear hashing, and the Fast Fourier Transform. However, for real numbers these tools are not available, leading to significant gaps in the best-known running times for integer inputs versus for real inputs. In this work our goal is to close this gap. As our key contribution we design a new technique for computing real sumsets. It is based on a surprising blend of algebraic ideas (like Prony's method and coprime factorizations) with combinatorial tricks. We then apply our new algorithm to the aforementioned problems and successfully obtain, in all cases, equally fast algorithms for real inputs. Specifically, we replicate the running times of the following landmark results by randomized algorithms in the standard real RAM model: - Sumsets: Given two sets $A,B$, their sumset $A+B=\{a+b:a\in A,b\in B\}$ can be computed in time $\tilde O(|A+B|)$ [Cole, Hariharan; STOC'02]. - Geometric pattern matching: Given two sets $A,B$, we can test whether there is some shift such that $A+s\subseteq B$ in time $\tilde O(|A|+|B|)$ [Cardoze, Schulman; FOCS'98]. - 3SUM with preprocessing: We can preprocess three size-$n$ sets $A,B,C$ in time $\tilde O(n^2)$ such that upon query of sets $A'\subseteq A,B'\subseteq B,C'\subseteq C$, the 3SUM instance $(A',B',C')$ can be decided in time $\tilde O(n^{13/7})$ [Chan, Lewenstein; STOC'15]. - Output-sensitive Subset Sum: Given a size-$n$ (multi-)set $X$ and a target $t$, we can compute the set of subset sums $\{\Sigma(X'):X'\subseteq X,\Sigma(X')\leq t\}$ in output-sensitive time $\tilde O(n+\mathrm{out}^{4/3})$ [Bringmann, Nakos; STOC'20].
Data Structures and Algorithms
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is to design efficient algorithms for real - number inputs in order to solve a series of computational problems with "additive characteristics". These problems include the calculation of sumsets, 3SUM, Subset Sum, and geometric pattern matching, etc. For integer inputs, these problems can usually be efficiently solved by using tools such as bit operations, linear hashing, and the Fast Fourier Transform (FFT). However, these tools are not available when dealing with real numbers, resulting in a significant gap between the best - known running times for integer inputs and real - number inputs. The goal of this paper is to bridge this gap by developing new techniques. ### Specific problem description 1. **Calculation of sumsets**: - Given two sets \(A\) and \(B\), their sumset \(A + B=\{a + b:a\in A,b\in B\}\) can be calculated in time \(\tilde{O}(|A + B|)\). 2. **Geometric pattern matching**: - Given two point sets \(A\) and \(B\), it can be tested whether there exists a translation \(s\) such that \(A + s\subseteq B\) within time \(\tilde{O}(|A|+|B|)\). 3. **3SUM with pre - processing**: - Three sets \(A\), \(B\), and \(C\) of size \(n\) can be pre - processed in time \(\tilde{O}(n^{2})\) so that 3SUM instances of query sets \(A'\subseteq A\), \(B'\subseteq B\), \(C'\subseteq C\) can be determined in time \(\tilde{O}(n^{13/7})\). 4. **Output - sensitive Subset Sum**: - Given a (multi - )set \(X\) of size \(n\) and a target \(t\), all subset sums \(\{\Sigma(X'):X'\subseteq X\}\) that satisfy \(\Sigma(X')\leq t\) can be calculated in output - sensitive time \(\tilde{O}(n+\text{out}^{4/3})\). ### Key contributions The key contribution of the paper lies in developing a new technique for calculating real - number sumsets. This technique combines algebraic methods (such as the Prony method and coprime factorization) with combinatorial techniques. Specifically: - **Prony method**: An old polynomial interpolation algorithm used to recover the support set of a sparse polynomial from the evaluation of a geometric series. - **Coprime factorization**: Used to handle the special properties of real - number inputs. Through this method, the author has successfully provided equally efficient algorithms for the above problems applicable to real - number inputs. For example: - **Real - number sumsets**: Given \(A,B\subseteq\mathbb{R}\), the sumset \(A + B\) can be calculated in time \(\tilde{O}(|A + B|)\). - **Real - number geometric pattern matching (Geometric Pattern Matching)**: Given \(A,B\subseteq\mathbb{R}^{d}\), it can be tested whether there exists a translation \(s\) such that \(A + s\subseteq B\) within time \(\tilde{O}(|A|+|B|)\). - **Real - number 3SUM with pre - processing**: Pre - processing can be done in time \(\tilde{O}(n^{2})\), and the problem can be solved with a time complexity of \(\tilde{O}(n^{13/7})\) during querying. - **Real - number Subset Sum**: Given \(X\subseteq\mathbb{R}_{\geq0}\) and...