arXiv:2610.42012cs.DSOct 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2610.42012

3SUM Made Simpler (Without Matrix Multiplication), kk-SUM Hypothesis Refuted for Odd kk, and Real 3SUM/APSP Derandomized

Timothy M. Chan, Reina Itakura, Zhiyuan Ma, Yuancheng Yu

Abstract

Recently, a truly subquadratic algorithm for the 3SUM problem and a truly subcubic algorithm for the all-pairs shortest paths (APSP) problem were found by Anthropic, as reported by Alman and Vassilevska Williams (2026). These algorithms relied on a new subroutine for rectangular matrix multiplication with selected output entries, which was obtained by modifying known matrix multiplication techniques of Schönhage (1981) and Coppersmith (1982).

  1. We present a different truly subquadratic randomized algorithm for 3SUM for integer inputs. It completely avoids the use of matrix multiplication but instead modifies known dynamic programming algorithms for subset convolution and the zeta transform, which rely only on simple subtraction tricks via inclusion-exclusion (and does not even require fast Fourier transform), and so is conceptually easier to understand (the whole solution is about 5 pages long).

  2. Following a similar approach, we obtain a randomized algorithm for kk-SUM for integer inputs for odd constant kk in O(n⌈k/2⌉−εk)O(n^{\lceil k/2 \rceil - \varepsilon_k}) time for some constant εk>0\varepsilon_k > 0, disproving the kk-SUM Hypothesis for all odd kk.

  3. Existing reductions from 3SUM and APSP to selected-entries rectangular matrix multiplication were randomized in the case of real-valued input. We present new deterministic reductions, yielding a truly subquadratic deterministic algorithm for Real 3SUM and a truly subcubic deterministic algorithm for Real APSP.

1 Introduction

Recently, Anthropic found the first truly subcubic algorithm for the all-pairs shortest paths (APSP) problem and the first truly subquadratic algorithm for the 3SUM problem, as announced and presented by Alman and Vassilevska Williams [AW26]. The key to the breakthrough lies in a faster algorithm for the following matrix problem: computing ww user-selected (also called “wanted”) entries of the product of an n×dn \times d and d×nd \times n matrix, when ww is subquadratic. Let Mselected-entries(n,d,n∣w)M_{\text{selected-entries}}(n, d, n \mid w) denote its time complexity. Rephrased in graph-theoretical terms, this rectangular matrix problem includes a lopsided version of the “#All-Edges (AE) Sparse Triangle” problem: we are given a tripartite graph where the left and right parts VLV_L and VHV_H have nn vertices and the middle part VMV_M has dd vertices, and there are ww edges between VLV_L and VHV_H; we want

*Siebel School of Computing and Data Science, University of Illinois at Urbana–Champaign, USA ({tmc, itakura3, zm25, yyu51}@illinois.edu) to count the number of triangles containing ee, for each edge ee between VLV_L and VRV_R. Their main subroutine established, for any sufficiently small constants q,ε>0q, \varepsilon > 0, the existence of some γ=γ(q,ε)\gamma = \gamma(q, \varepsilon) such that1^1

Mselected−entries(n,d,n∣w)≤O~(n2/dγ+wdq)M_{\mathrm{selected-entries}}(n,d,n\mid w)\leq\widetilde{O}(n^2/d^\gamma+w d^q)

for all d≤nεd \leq n^\varepsilon. For example, Mselected−entries(n,d,n∣w)≤O~(n2/d0.063+wd0.437)M_{\mathrm{selected-entries}}(n,d,n\mid w) \leq \widetilde{O}(n^2/d^{0.063}+wd^{0.437}) for all d≤n1/18d \leq n^{1/18}.

The new subroutine was obtained by modifying known matrix multiplication techniques of Schönhage [Sch81] and Coppersmith [Cop82] to achieve output-sensitivity. This is surprising, since matrix multiplication is usually used as a black box in algorithmic applications, and there were not many successful prior examples when modifying matrix multiplication algorithms helped.

Once this matrix problem has been solved, faster algorithms for both APSP and 3SUM—and, more strongly, the Exact Triangle problem—follow more or less immediately, by using or adapting existing reductions from APSP/3SUM/Exact Triangle to AE Sparse Triangle [Pät10, KPP16, VX20, CVX22, CX24, FKP24]. There are multiple options, and some of these reductions already hold in the lopsided setting. In the integer input case, deterministic reductions were known [CX24, FKP24]; however, in the real case, only randomized reductions were known [CVX22].

Several improvements have been found just days after the initial announcement of the breakthrough2^2 but in this new era, conceptual understanding and better exposition are perhaps more important than small incremental improvements. In this manuscript, we address two themes: 1. simplifying these algorithms, to make the ideas more broadly accessible, and 2. derandomizing the algorithms in the real input case.

3SUM simplified. Shortly after the announcement of the breakthrough, Karingula and Lovett [KL26] have already presented a simplification (found with the help of swarms of agents) of the main subroutine for selected-entries rectangular matrix multiplication (with slightly worse exponents). The original explanation of the subroutine [AW26], requiring about 18 pages, has now been cut down to 7 pages (not counting the remaining reduction from 3SUM/APSP to lopsided AE Sparse Triangle, which would require at least 2 more pages).

While the usage of matrix multiplication tools for APSP is inevitable as APSP is equivalent to (min⁡,+)(\min, +)-matrix multiplication, an interesting question is whether further simplifications are possible for 3SUM (to the general public, 3SUM seems to attract even more attention than APSP). Our intuition is this: 3SUM and the easier (min⁡,+)(\min, +)-convolution problem are about sequences of numbers, whereas Exact Triangle and (min⁡,+)(\min, +)-matrix multiplication are their matrix counterparts (see Figure 1). Sequence problems are more often solved using convolutions or fast Fourier transform (FFT) instead of matrix multiplication. For example, known algorithms for the bounded monotone (min⁡,+)(\min, +)-convolution problem [CL15, CDXZ22] mostly used FFT, whereas known algorithms for bounded monotone (min⁡,+)(\min, +)-matrix multiplication [BGSV19, CDXZ22] used fast matrix multiplication.

A natural thought is to try to modify existing algorithms for standard convolution such as FFT, Karat-suba's, and Toom and Cook's, which if doable might be easier than modifying matrix multiplication algorithms such as Schönhage's and Coppersmith's, to those who are not experts in matrix multiplication machineries. Even if possible, it still seems to require effort to achieve output-sensitivity: for all these recursive algorithms, it is nontrivial to analyze which nodes of the recursion tree are necessary for the selected output entries (see all the figures needed in the descriptions by both Alman and Vassilevska Williams [AW26] and Karingula and Lovett [KL26]).

1^1The O~\widetilde{O} notation hides polylogarithmic factors. 2^2For example, see [Maj26, SY26] and https://bigospeedrun.com/3sum.

Figure

Figure 1: Known simple reductions [Pät10, BCD +^+14, VW18, CMWW19]. (The dashed ones are for integer input, unless one uses more complicated, recent techniques [FPS26].)

We find a simpler way to obtain a truly subquadratic, Monte-Carlo randomized algorithm for 3SUM for polynomially bounded integer inputs. The key idea is to switch to a different but related problem, subset convolution (see Problem 2.1). Standard algorithms for subset convolution are based on the so-called zeta (or Möbius) transform, which is solved by simple dynamic programming (DP), using just subtraction or inclusion-exclusion tricks, and are simpler than FFT. Adapting these subset convolution algorithms to the selected-entries setting turns out to be easy, due to the simple DAG or lattice structure of the DP (no messy analysis of dependency patterns of “input encoding/preparation” and “output decoding/reconstruction” in recursion trees [AW26, KL26]). In fact, this observation was noted explicitly before by Björklund, Husfeldt, Kaski, and Mikko Koivisto [BHKK10] (for a different application, concerning exponential-time algorithms for certain problems in bounded-degree graphs). 3^3 For completeness, we include a description of the selected-entries subset convolution algorithm in Section 2.1, which takes just one and a half page. We believe this is the simplest way to introduce to a broader audience the possibility of output-sensitivity for selected-entries versions of algebraic problems. 4^4

While this greatly simplifies the algebraic part of the solution, a bit more work is now required in the remaining part, to reduce 3SUM to subset convolution, since subset convolution is farther away from 3SUM than standard convolution. Nevertheless, this part is in more familiar territory to algorithm designers in fine-grained complexity, and indeed can be solved in under 3 pages using hashing techniques (see Section 2.2). Hashing is commonly used in prior work about convolutions and 3SUM-related reductions (e.g., see [CH02, BDP08, Pät10, CH20, BFN21, BFN22]), but this reduction requires some new technical ideas (with a nontrivial analysis), as it does not seem to follow directly from any existing work.

The solution here raises some new interesting questions concerning whether the 3SUM algorithm here might be considered combinatorial, and more generally what is the meaning of “combinatorial algorithms”. See Section 2.3 for discussion. (Spoiler: we, the authors, do not have a definitive answer, and will leave the question to the readers to decide for themselves.)

By known simple reductions [CMWW19], we also immediately obtain a simpler truly subquadratic randomized algorithm for (min, +)-convolution for polynomially bounded integer inputs, which in turn has many applications, e.g., see [CMWW19, KPS17, BN21, Bri24, Jin24].

3^3Alman and Vassilevska Williams [AW26] actually cited Björklund, Husfeldt, Kaski, and Mikko Koivisto's work in a remark at the end of their Section 2 on selected-entries matrix multiplication: “The pruned recursion of Section 2.4.2 is an analog of FFT pruning [Mar71, SB93] of trimmed Möbius inversion [BHKK10]...” However, their paper did not pursue further the usage of [BHKK10] to solve 3SUM more directly and more simply.

4^4We have found that an AI-generated (and Lean-verified) solution posted at https://bigospeedrun.com/3sum by c01dzy17 also appeared to use subset convolution, but there are no accompanying human-written manuscripts explaining the ideas.

kk-SUM Hypothesis refuted for all odd kk. As an unintended byproduct of this simpler approach, we obtain an O(n⌊k/2⌋−εk)O(n^{\lfloor k/2\rfloor - \varepsilon_k})-time randomized algorithm for the kk-SUM problem for polynomially bounded integer inputs, for every odd constant k≥5k \geq 5, for some constant εk>0\varepsilon_k > 0. This thus refutes the kk-SUM Hypothesis for all odd kk (at least for the integer setting, with randomization). Alman and Vassilevska Williams [AW26] explicitly listed the kk-SUM Hypothesis for larger kk as one of the remaining open questions, as their approach based on selected-entries rectangular matrix multiplication does not seem to generalize. This demonstrates another advantage of working with convolution-based approaches instead of matrix multiplication.

As is easy to see, kk-SUM for odd kk reduces to an unbalanced instance of 3SUM, where the first set has n⌊k/2⌋n^{\lfloor k/2\rfloor} elements, the second set has nn elements, and the third (“query”) set has n⌊k/2⌋n^{\lfloor k/2\rfloor} elements. As the number of queries is large, we need to refine the 3SUM algorithm to achieve lower cost per query. To this end, the extra idea is to use convolution where elements are vectors in [r]d[r]^d instead of subsets (bit vectors), for a larger constant base rr. This extended problem with selected entries can still be solved by adapting standard algorithms for subset convolution. The remaining hashing part proceeds similar to before, and the analysis is only slightly more involved. (See Section 3.)

Real 3SUM and APSP derandomized. In the second half of the paper (Sections 4–5, which can be read independently of Sections 2–3), we turn to the question of derandomization in the real input case (the recent algorithms in the integer input case are already deterministic). The subroutine for selected-entries rectangular matrix multiplication or lopsided AE Sparse Triangle was already deterministic [AW26]. The issue lies in the reduction of APSP/3SUM to AE Sparse Triangle. In the real case, the only known reduction was the one by Chan, Vassilevska Williams, and Xu [CVX22], which crucially relied on random sampling. (Fischer, Polak, and Schmidt [FPS26] recently gave a reduction from Real 3SUM to Integer 3SUM, but it was complicated and also used randomization.) In contrast, the previous best slightly subcubic real APSP algorithm [Wil18] before the recent breakthrough was successfully derandomized [CW21], while the previous best slightly subquadratic real 3SUM algorithm [Cha20] was already deterministic.

We describe deterministic reductions from both Real 3SUM and Real APSP to #AE Sparse Triangle. The new reductions build on Chan, Vassilevska Williams, and Xu's approach [CVX22]; the main new idea is clever but simple, especially for Real APSP (the details are a bit trickier for Real 3SUM). These deterministic reductions lead to the first truly subquadratic and subcubic-time deterministic algorithms for Real 3SUM and Real APSP respectively.

References (47)