arXiv:2610.10503cs.DSOct 2026

Manuscript Offprint

arXiv:2610.10503

Barely Monotone (min,+)-Convolution in Truly Subquadratic Time

MohammadTaghi Hajiaghayi, Danny Mittal, Saeed Seddighin

Abstract

The (min, +)-convolution of two sequences A and B of length n is the sequence C with C[k]=min⁡i+j=k(A[i]+B[j])C[k] = \min_{i+j=k}(A[i] + B[j]). For bounded inputs, whose entries are integers in {0,…,O(n)}\{0, \ldots, O(n)\}, prior work computes it in truly subquadratic time when the inputs are monotone; the algorithm of Chi, Duan, Xie, and Zhang (STOC 2022) takes expected O~(n1.5)\widetilde{O}(n^{1.5}) time. We introduce a monotonicity measure ranging from 0 (monotone) to 1/2 (entirely non-monotone): a sequence has monotonicity α\alpha if it can be partitioned into O(nα)O(n^\alpha) monotone subsequences, and by the Erdős–Szekeres theorem every sequence has monotonicity at most 1/2. We show that truly subquadratic time is achievable even when just one input is barely monotone, that is, has monotonicity 1/2−Ω(1)1/2 - \Omega(1): if A has monotonicity α\alpha, we compute the convolution in expected time O~(n5/3+2α/3)\widetilde{O}(n^{5/3+2\alpha/3}) for every bounded B. If B has monotonicity β\beta as well, the expected time improves to O~(n(3+α+β)/2)\widetilde{O}(n^{(3+\alpha+\beta)/2}), which matches the monotone case for α=β=0\alpha = \beta = 0; this algorithm also allows infinite entries placed arbitrarily.

We complement these algorithms with fine-grained reductions. Bounded (min, +)-convolution reduces to bounded monotone (min, +)-convolution of length N=O(n1.5)N = O(n^{1.5}), so an O(N4/3−ε)O(N^{4/3-\varepsilon})-time algorithm for monotone inputs would give an O(n2−3ε/2)O(n^{2-3\varepsilon/2})-time algorithm for bounded inputs. Similarly, entries bounded by nn reduce to entries bounded by NxN^x on sequences of length N=Θ(n2/(1+x))N = \Theta(n^{2/(1+x)}). We also show that if only AA has entries in {0,…,M}\{0, \ldots, M\}, we can compute the convolution in O~(n(M+1))\widetilde{O}(n(M+1)) time, and in O~(n1.5M)\widetilde{O}(n^{1.5}\sqrt{M}) time if AA may also contain +∞+\infty.

*University of Maryland. Email: hajiaghayi@gmail.com.

†^{\dagger}University of Maryland. Email: dannymittal@gmail.com.

†^{†}Email: saeedreza.seddighin@gmail.com.

1 Introduction

The All-Pairs Shortest Paths (APSP) problem is equivalent, up to subcubic reductions, to computing the (min, +)-product C[i][j]=min⁡k(A[i][k]+B[k][j])C[i][j] = \min_k(A[i][k] + B[k][j]) of two n×nn \times n matrices [26]. Until recently the fastest known algorithm for both problems ran in n3/2Ω(log⁡n)n^3/2^{\Omega(\sqrt{\log n})} time [29], and whether O(n3−ε)O(n^{3-\varepsilon}) time is possible for some constant ε>0\varepsilon > 0 had been a central open question for decades; very recently, Alman and Vassilevska Williams [1] gave the first truly subcubic algorithm for APSP with polynomially bounded integer weights. The one-dimensional analogue of the (min, +)-product is the (min, +)-convolution of two sequences A=(A[0],…,A[n−1])A = (A[0], \ldots, A[n-1]) and B=(B[0],…,B[n−1])B = (B[0], \ldots, B[n-1]), namely the sequence C=A⋆BC = A \star B of length 2n−12n-1 with

C[k]=min⁡0≤i,j<ni+j=k(A[i]+B[j]),0≤k≤2n−2.C[k]=\min_{\substack{0\leq i,j<n\\ i+j=k}}(A[i]+B[j]),\qquad0\leq k\leq2n-2.

The two problems are closely related: as observed by Bremner et al. [7], the (min, +)-convolution of two sequences of length n can be computed with O(n)O(\sqrt{n}) (min, +)-products of n×n\sqrt{n} \times \sqrt{n} matrices. A truly subcubic algorithm for APSP therefore gives a truly subquadratic algorithm for (min, +)-convolution, which has long made the latter a natural intermediate target on the way to faster APSP algorithms. (min, +)-Convolution is also tied by fine-grained reductions to knapsack-type problems, tree sparsity, and other problems [16, 23, 5]. The algorithm of [1] yields a truly subquadratic algorithm for (min, +)-convolution with polynomially bounded integer entries, but with an exponent very close to 2. Structured inputs admit much faster algorithms, and they are the subject of this paper.

If all entries are integers in {0,…,M}\{0, \ldots, M\}, the convolution can be computed in O~(n(M+1))\tilde{O}(n(M+1)) time with the fast Fourier transform, in the spirit of the algorithm of Alon, Galil, and Margalit [2] for the matrix case. For M=Θ(n)M = \Theta(n), that is, for bounded inputs with entries in {0,…,O(n)}\{0, \ldots, O(n)\}, this gives no improvement over the naive algorithm. If, in addition, both sequences are monotone, the problem becomes substantially easier. Chan and Lewenstein [12] gave the first truly subquadratic algorithm for bounded monotone (min, +)-convolution, with expected running time O(n1.859)O(n^{1.859}), using additive combinatorics, and showed that the problem is closely related to bounded-difference (min, +)-convolution and to binary jumbled indexing. Chi, Duan, Xie, and Zhang [15] then improved the expected running time to O~(n1.5)\tilde{O}(n^{1.5}); we refer to their algorithm as the CDXZ algorithm. Bringmann, Dürr, and Polak [9] extended it to entries in {0,…,M}\{0, \ldots, M\}, obtaining expected time O~(nM+1)\tilde{O}(n\sqrt{M+1}), and showed that it suffices for one of the two sequences to be monotone; Jin, Park, Saha, and Xu [22] gave a deterministic version with an no(1)n^{o(1)} overhead. These algorithms have found applications to knapsack problems [8, 9]. The picture is similar for the (min, +)-product, where bounded-difference instances and instances with bounded row- or column-monotone matrices admit truly subcubic algorithms [10, 27, 20, 14, 15, 22].

Structured (min, +)-convolution is also at the heart of our recent work on dynamic problems [21]. There we gave truly sublinear dynamic algorithms for (min, +)-convolution and for (min, +)-matrix multiplication under marginal updates, in which each update changes one input entry by ±1\pm1 and each query asks for one output entry. For (min, +)-convolution we obtained O~(n21/22)\widetilde{O}(n^{21/22}) expected amortized update time and O(n21/22)O(n^{21/22}) worst-case query time, by combining the structure of bounded inputs with additive combinatorics, even though the values themselves may grow without bound. We also reduced static bounded-difference (min, +)-convolution to this dynamic problem; update and query times of O(n1/3−ε)O(n^{1/3-\varepsilon}) (with n2+o(1)n^{2+o(1)} initialization time for arbitrary inputs) would improve the exponent 3/2 for bounded-difference inputs. For (min, +)-matrix multiplication we obtained truly sublinear algorithms whenever the updates are not too concentrated on a single row or column, and a matching hardness result based on the OMv conjecture shows that this condition cannot

ProblemResultReference
mono⁡(A)≤nα, mono⁡(B)≤nβ\operatorname{mono}(A)\leq n^{\alpha},\ \operatorname{mono}(B)\leq n^{\beta}O~(n(3+α+β)/2), Las Vegas\widetilde{O}(n^{(3+\alpha+\beta)/2}),\ \text{Las Vegas}3.10
mono⁡(A)≤nα, B bounded\operatorname{mono}(A)\leq n^{\alpha},\ B\ \text{bounded}O~(n5/3+2α/3), Las Vegas\widetilde{O}(n^{5/3+2\alpha/3}),\ \text{Las Vegas}3.7
monotone with infinitiesO~(n1.5), Las Vegas\widetilde{O}(n^{1.5}),\ \text{Las Vegas}3.10
mono⁡(A)≤2, B bounded\operatorname{mono}(A)\leq 2,\ B\ \text{bounded}O(n1.5−ε)⇒bounded O(n2−ε)O(n^{1.5-\varepsilon})\Rightarrow \text{bounded } O(n^{2-\varepsilon})3.9
A∈[0,M]n, B arb.A\in[0,M]^n,\ B\ \text{arb.}O~(n(M+1)), determin.\widetilde{O}(n(M+1)),\ \text{determin.}5.3
A∈([0,M]∪{∞})n, B arb., 1≤M≤nA\in([0,M]\cup\{\infty\})^n,\ B\ \text{arb.},\ 1\leq M\leq nO~(n1.5M), determin.\widetilde{O}(n^{1.5}\sqrt{M}),\ \text{determin.}5.6
bounded→bounded monotone\text{bounded}\to\text{bounded monotone}length and values O(n1.5)O(n^{1.5})4.2
monotone O(N4/3−ε)⇒bounded O(n2−3ε/2)O(N^{4/3-\varepsilon})\Rightarrow \text{bounded } O(n^{2-3\varepsilon/2})4.4
values≤n→values≤Nx\text{values}\leq n\to \text{values}\leq N^xlength N=Θ(n2/(1+x))N=\Theta(n^{2/(1+x)})5.1, 5.2

Table 1: Summary of our results. Here nn is the input length, NN is the length produced by a reduction, and mono(⋅)\text{mono}(\cdot) is the monotonicity number; in the value-range reduction, 0<x≤10 < x \leq 1 is fixed. Unless stated otherwise, finite entries are integers in {0,…,O(n)}\{0, \dots, O(n)\}, and “arb.” means that BB may have arbitrary integer or +∞+\infty entries. In the third row, the finite entries of each input form a monotone sequence and +∞+\infty entries are placed arbitrarily. Las Vegas bounds are expected running times.

be dropped. These results complement classical work on dynamic matrix inverse and dynamic convolution.

All known algorithms for bounded inputs with running time close to n1.5n^{1.5}, however, rely on monotonicity, or on closely related structure such as bounded differences, of at least one of the sequences. In this paper we ask how much monotonicity is really needed. We measure the distance from monotonicity by the monotonicity number mono(A)\text{mono}(A), the minimum number of monotone subsequences into which a sequence AA can be partitioned. Every sequence of length nn has monotonicity number O(n)O(\sqrt{n}), so we may write mono(A)=O(nα)\text{mono}(A) = O(n^{\alpha}) with α∈[0,1/2]\alpha \in [0, 1/2] and call α\alpha the monotonicity of AA; it ranges from 0 for monotone sequences to 1/21/2 for entirely non-monotone ones, and the algorithms above cover only monotone sequences, at the extreme α=0\alpha = 0. We show that this is far from necessary: bounded (min,+)(\text{min}, +)-convolution can be computed in truly subquadratic time even when just one input is barely monotone, that is, has monotonicity 1/2−Ω(1)1/2 - \Omega(1). We also study the converse direction, that is, how improvements for monotone inputs can be transferred to less structured ones, and give fine-grained reductions between bounded, monotone, and small-range instances.

References (55)