Dynamic Time Warping in the Low-Distance Regime

📅 2026-09-30
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study investigates the computational complexity optimization and theoretical lower bounds of Dynamic Time Warping (DTW) under low distance thresholds. Challenging the conventional O(nk) paradigm, we employ orthogonal vector reductions, run-length encoding analysis, and dynamic programming refinements to establish, for the first time under discrete mismatch costs, a conditionally optimal n^{1-o(1)}k lower bound based on the Orthogonal Vectors Hypothesis (OVH). This result reveals an intrinsic connection between input periodicity and computational hardness. The primary contributions lie in delineating near-optimal complexity boundaries for DTW and its pattern matching variant at low distances, while proposing polynomial-time efficient algorithms tailored to specific structured inputs.
📝 Abstract
Dynamic Time Warping (DTW) is a classical similarity measure for strings and time series that allows local stretching. Given non-empty strings $S,T$ over an alphabet $Σ$ and a cost function $δ:Σ^2\to\mathbb{R}_{\ge0}$, $DTW_δ(S,T)$ is the minimum total cost of equal-length expansions of $S$ and $T$ obtained by duplicating characters. For strings of length at most $n$, DTW is computable in $O(n^2)$ time, and this is conditionally optimal under the Orthogonal Vectors Hypothesis (OVH). We study the low-distance regime, where an integer $k$ upper-bounds $DTW_δ(S,T)$, assuming $δ(a,a)=0$ and $δ(a,b)\ge1$ for $a\ne b$. For several classical similarity measures, this regime admits $O(n+\operatorname{poly}(k))$ algorithms, whereas for DTW with metric costs the best known bound is $O(nk)$. We show that this dependence is essentially optimal: assuming OVH, computing DTW requires $n^{1-o(1)}k$ time even for the discrete mismatch-cost function, which assigns cost $1$ to every mismatch. The lower bound applies to the whole spectrum of thresholds $k$ between constant and linear in $n$. Our reduction from Orthogonal Vectors encodes vector coordinates in the lengths of equal-character runs. The resulting instances are very structured: collapsing runs to single characters reveals long substrings with short periods. We complement the lower bound with a $\tilde O(n+\operatorname{poly}(k))$-time algorithm whenever, after collapsing runs in the inputs, every substring with period $O(k)$ has length $\operatorname{poly}(k)$. Finally, we extend this lower bound to DTW pattern matching, which asks whether any non-empty substring of a length-$n$ text has DTW distance at most $k$ from a length-$m$ pattern. We prove that the classic $O(nm)$-time dynamic-programming algorithm is near-optimal under OVH, even when $k=O(\log n)$.
Problem

Research questions and friction points this paper is trying to address.

Dynamic Time Warping
Low-Distance Regime
Computational Complexity
Pattern Matching
Orthogonal Vectors Hypothesis
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dynamic Time Warping
Low-Distance Regime
Orthogonal Vectors Hypothesis
Fine-Grained Complexity
Pattern Matching
🔎 Similar Papers
No similar papers found.