Abstract
In the field of fine-grained complexity, the 3SUM problem has traditionally served as a benchmark for hardness, used primarily to establish lower bounds for other computational problems. This paper shifts that paradigm by treating 3SUM-counting as a constructive algorithmic tool. By developing deterministic, subquadratic-time versions of foundational results from additive combinatorics—most notably the Balog-Szemerédi-Gowers (BSG) theorem—the authors derandomize key complexity reductions and break a 30-year-old efficiency barrier in deterministic pattern matching. These results bridge the gap between structured and random-looking sets, providing a new framework for deterministic algorithms in graph theory and string processing.
Introduction
The 3SUM problem—determining if any three integers in a set sum to zero—is a cornerstone of fine-grained complexity. Researchers typically assume a lower bound of nearly quadratic time ($n^2$) for 3SUM and use this to prove that other problems are similarly difficult. However, two significant issues have persisted in this landscape: the reliance on randomization in reductions and a lack of progress in deterministic algorithms for pattern matching.
Many reductions used to prove lower bounds are randomized, which obscures the true deterministic complexity of the target problems. Simultaneously, in the domain of pattern matching, deterministic algorithms for calculating the Hamming distance (the number of mismatches between a text and a pattern) have not seen significant improvement since the early 1990s. This paper addresses these gaps by asking whether insights from 3SUM counting and additive combinatorics can be leveraged to build superior deterministic algorithms.
Methodology and Technical Tools
The authors introduce a suite of five deterministic technical tools designed to handle additive structures efficiently:
- Deterministic Approximate 3SUM Counting: This algorithm estimates the number of pairs in sets $A$ and $B$ that sum to a specific value $c$. Crucially, it avoids the $n^2$ time complexity required by a full convolution.
- Deterministic Balog-Szemerédi-Gowers (BSG) Theorem: A central result in additive combinatorics, the BSG theorem relates high additive energy (many triples summing up) to small doubling (a large subset with simple structure). The authors provide the first deterministic, subquadratic-time algorithm to identify this structured subset.
- Almost-Additive Hashing: The paper introduces a new hashing scheme that preserves additive structure while utilizing a very short "seed." This efficiency allows for deterministic iteration through all possible hash functions.
- Small-Doubling 3SUM Counting: This specialized algorithm accelerates 3SUM solution counting when input sets exhibit the "small doubling" structure identified by the BSG tool.
Key Insights: Structure vs. Randomness
The core philosophy of the paper is the dichotomy between structure and randomness. By employing the BSG theorem, the authors can partition an arbitrary set into "structured" components and "random-looking" components. Structured sets are easier to process using specialized counting algorithms, while random-looking sets can be handled via more general methods.
Furthermore, the authors establish a "fine-grained equivalence" between 3SUM (the decision problem) and #3SUM (the counting problem) under deterministic reductions. This implies that any deterministic algorithmic progress made on counting 3SUM solutions translates directly into progress for the decision version, and vice versa.
Results and Applications
The application of these tools yielded several breakthroughs in graph theory and pattern matching:
- 4-Cycle Listing: The authors successfully derandomized the reduction from 3SUM to the 4-Cycle Listing problem in graphs. This resolves a major open question regarding the deterministic complexity of finding cycles in graphs.
- Approximate Hamming Distance: The paper presents a deterministic algorithm for $(1+\epsilon)$-approximate Text-to-Pattern Hamming Distances with a running time of $n m^{o(1)}/\epsilon$. This represents the first deterministic improvement over Karloff’s 1993 algorithm, matching the efficiency of the best-known randomized approaches by reducing the dependence on $\epsilon$ from quadratic to linear.
- k-Mismatch Constellation: For problems involving finding shifts where a pattern matches a text with at most $k$ mismatches, the authors achieved a running time of $|A| \cdot k^{2/3} \cdot N^{o(1)}$. This outperforms the long-standing $O(nk)$ baseline for a significant range of $k$ values.
Limitations and Future Work
While the paper marks a significant advancement, several challenges remain. In the $k$-mismatch problem, a gap persists between the new $k^{2/3}$ upper bound and the $\sqrt{k}$ lower bound established in the same research. Additionally, the improvements for the $k$-mismatch constellation problem are currently optimized for cases where the input sets are of similar size; extending this to scenarios where the pattern is significantly smaller than the text is a pending challenge.
Finally, the authors note that derandomizing reductions for Distance Oracles—data structures for shortest-path queries—remains difficult. Such problems require controlling longer cycles in graphs, a task that necessitates tools beyond the current 3SUM-counting framework.
Summary updated