Table of Contents
Fetching ...

New Applications of 3SUM-Counting in Fine-Grained Complexity and Pattern Matching

Nick Fischer, Ce Jin, Yinzhan Xu

TL;DR

It is established that 3SUM and 3SUM are fine-grained equivalent under deterministic reductions, and a deterministic algorithm is given for the Text-to-Pattern Hamming Distances problem in time.

Abstract

The 3SUM problem is one of the cornerstones of fine-grained complexity. Its study has led to countless lower bounds, but as has been sporadically observed before -- and as we will demonstrate again -- insights on 3SUM can also lead to algorithmic applications. The starting point of our work is that we spend a lot of technical effort to develop new algorithms for 3SUM-type problems such as approximate 3SUM-counting, small-doubling 3SUM-counting, and a deterministic subquadratic-time algorithm for the celebrated Balog-Szemerédi-Gowers theorem from additive combinatorics. As consequences of these tools, we derive diverse new results in fine-grained complexity and pattern matching algorithms, answering open questions from many unrelated research areas. Specifically: - A recent line of research on the "short cycle removal" technique culminated in tight 3SUM-based lower bounds for various graph problems via randomized fine-grained reductions [Abboud, Bringmann, Fischer; STOC '23] [Jin, Xu; STOC '23]. In this paper we derandomize the reduction to the important 4-Cycle Listing problem. - We establish that \#3SUM and 3SUM are fine-grained equivalent under deterministic reductions. - We give a deterministic algorithm for the $(1+ε)$-approximate Text-to-Pattern Hamming Distances problem in time $n^{1+o(1)} \cdot ε^{-1}$. - In the $k$-Mismatch Constellation problem the input consists of two integer sets $A, B \subseteq [N]$, and the goal is to test whether there is a shift $c$ such that $|(c + B) \setminus A| \leq k$ (i.e., whether $B$ shifted by $c$ matches $A$ up to $k$ mismatches). For moderately small $k$ the previously best running time was $\tilde O(|A| \cdot k)$ [Cardoze, Schulman; FOCS '98] [Fischer; SODA '24]. We give a faster $|A| \cdot k^{2/3} \cdot N^{o(1)}$-time algorithm in the regime where $|B| = Θ(|A|)$.

New Applications of 3SUM-Counting in Fine-Grained Complexity and Pattern Matching

TL;DR

It is established that 3SUM and 3SUM are fine-grained equivalent under deterministic reductions, and a deterministic algorithm is given for the Text-to-Pattern Hamming Distances problem in time.

Abstract

The 3SUM problem is one of the cornerstones of fine-grained complexity. Its study has led to countless lower bounds, but as has been sporadically observed before -- and as we will demonstrate again -- insights on 3SUM can also lead to algorithmic applications. The starting point of our work is that we spend a lot of technical effort to develop new algorithms for 3SUM-type problems such as approximate 3SUM-counting, small-doubling 3SUM-counting, and a deterministic subquadratic-time algorithm for the celebrated Balog-Szemerédi-Gowers theorem from additive combinatorics. As consequences of these tools, we derive diverse new results in fine-grained complexity and pattern matching algorithms, answering open questions from many unrelated research areas. Specifically: - A recent line of research on the "short cycle removal" technique culminated in tight 3SUM-based lower bounds for various graph problems via randomized fine-grained reductions [Abboud, Bringmann, Fischer; STOC '23] [Jin, Xu; STOC '23]. In this paper we derandomize the reduction to the important 4-Cycle Listing problem. - We establish that \#3SUM and 3SUM are fine-grained equivalent under deterministic reductions. - We give a deterministic algorithm for the -approximate Text-to-Pattern Hamming Distances problem in time . - In the -Mismatch Constellation problem the input consists of two integer sets , and the goal is to test whether there is a shift such that (i.e., whether shifted by matches up to mismatches). For moderately small the previously best running time was [Cardoze, Schulman; FOCS '98] [Fischer; SODA '24]. We give a faster -time algorithm in the regime where .

Paper Structure

This paper contains 39 sections, 49 theorems, 135 equations.

Key Result

Theorem 1.1

For any constant $\delta>0$, there is a deterministic fine-grained reduction from 3SUM to 3SUM with additive energy at most $n^{2+\delta}$.

Theorems & Definitions (96)

  • Theorem 1.1
  • Theorem 1.2
  • Theorem 1.3
  • Theorem 1.4
  • Theorem 1.5
  • Theorem 1.6
  • Corollary 1.7
  • Theorem 1.8
  • Theorem 1.9: Deterministic Popular Sums Approximation
  • Theorem 1.10: Deterministic small-doubling 3SUM-counting; simplified from \ref{['thm:detsmalldoublethreesum']}
  • ...and 86 more