The Dynamic Time Warping (DTW) distance is a popular similarity measure for polygonal curves (i.e., sequences of points). It finds many theoretical and practical applications, especially for temporal data, and is known to be a robust, outlier-insensitive alternative to the \frechet distance. For static curves of at most $n$ points, the DTW distance can be computed in $O(n^2)$ time in constant dimension. This tightly matches a SETH-based lower bound, even for curves in $\mathbb{R}^1$. In this work, we study \emph{dynamic} algorithms for the DTW distance. Here, the goal is to design a data structure that can be efficiently updated to accommodate local changes to one or both curves, such as inserting or deleting vertices and, after each operation, reports the updated DTW distance. We give such a data structure with update and query time $O(n^{1.5} \log n)$, where $n$ is the maximum length of the curves. As our main result, we prove that our data structure is conditionally \emph{optimal}, up to subpolynomial factors. More precisely, we prove that, already for curves in $\mathbb{R}^1$, there is no dynamic algorithm to maintain the DTW distance with update and query time~\makebox{$O(n^{1.5 - \delta})$} for any constant $\delta > 0$, unless the Negative-$k$-Clique Hypothesis fails. In fact, we give matching upper and lower bounds for various trade-offs between update and query time, even in cases where the lengths of the curves differ.
翻译:动态时间规整(DTW)距离是一种针对多边形曲线(即点序列)的常用相似性度量。它在理论和实际应用(尤其是时序数据)中具有广泛用途,且被认为是弗雷歇距离的一种稳健、抗离群点的替代方案。对于最多包含 n 个点的静态曲线,在固定维度下可在 O(n²) 时间内计算 DTW 距离。这严格匹配了基于 SETH 的下界,即使对于 ℝ¹ 中的曲线亦然。本文研究 DTW 距离的动态算法。目标是设计一种可高效更新的数据结构,以适应一条或两条曲线的局部变化(例如插入或删除顶点),并在每次操作后报告更新后的 DTW 距离。我们给出了一种更新与查询时间为 O(n^{1.5} log n) 的数据结构(其中 n 为曲线的最大长度)。作为主要成果,我们证明该数据结构在亚多项式因子范围内是条件性最优的。具体而言,我们证明:即使对于 ℝ¹ 中的曲线,若负-k-团假设不成立,则不存在更新与查询时间为 O(n^{1.5 - δ})(δ > 0 为任意常数)的动态算法来维护 DTW 距离。事实上,我们在更新与查询时间的多种权衡下给出了匹配的上下界,甚至包括曲线长度不同的情形。