Skip to content

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

MohammadTaghi Hajiaghayi, Danny Mittal, Saeed Seddighin

cs.DS

Abstract

The (min,+)-convolution of two sequences A and B of length n is the sequence C with C[k] = mini+j=k (A[i]+B[j]). For bounded inputs, whose entries are integers in 0,...,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) 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(nalpha) monotone subsequences, and by the Erdos-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 - Omega(1): if A has monotonicity alpha, we compute the convolution in expected time O~(n5/3+2alpha/3) for every bounded B. If B has monotonicity beta as well, the expected time improves to O~(n(3+alpha+beta)/2), which matches the monotone case for 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), so an O(N4/3-eps)-time algorithm for monotone inputs would give an O(n2-3eps/2)-time algorithm for bounded inputs. Similarly, entries bounded by n reduce to entries bounded by Nx on sequences of length N = Theta(n2/(1+x)). We also show that if only A has entries in 0,...,M, we can compute the convolution in O~(n(M+1)) time, and in O~(n1.5 sqrt(M)) time if A may also contain +infinity.

Create a lesson