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 Fr\'echet 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$. We study dynamic algorithms for the DTW distance. We accommodate local changes to one or both curves, such as inserting or deleting vertices and, after each operation, can report 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. The natural follow-up question is whether this time bound can be improved; under the aforementioned SETH-based lower bound, we could even hope for linear update time. We refute these hopes and prove that our data structure is conditionally 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 $O(n^{1.5 - \delta})$ for any constant~$\delta > 0$, unless the Negative-$k$-Clique Hypothesis fails. This holds even if one of the curves is fixed at all times, whereas the points of the other curve may only undergo substitutions. In fact, we give matching upper and lower bounds for various further trade-offs between update and query time, even in cases where the lengths of the curves differ. The Negative-$k$-Clique Hypothesis is a recent but well-established hypothesis from fine-grained complexity, that generalizes the famous APSP Hypothesis, and successfully led to several lower bounds.
翻译:动态时间规整(DTW)距离是折线(即点序列)的一种常用相似性度量。它在理论和实际应用中都有重要价值,尤其适用于时序数据,并且被认为是弗雷歇距离的一种鲁棒、对异常值不敏感的替代方案。对于最多包含$n$个点的静态曲线,DTW距离可在恒定维度下以$O(n^2)$时间计算。这严格匹配了基于SETH的下界,即使对于$\mathbb{R}^1$中的曲线也是如此。我们研究DTW距离的动态算法。我们处理一条或两条曲线的局部变化,例如插入或删除顶点,并在每次操作后报告更新后的DTW距离。我们给出一种数据结构,其更新和查询时间为$O(n^{1.5} \log n)$,其中$n$是曲线的最大长度。一个自然的问题是这一时间界是否可以改进;基于前述SETH下界,我们甚至可以期望线性更新时间。我们否定了这些期望,并证明我们的数据结构在条件意义下最优(最多相差次多项式因子)。更精确地说,我们证明,即使对于$\mathbb{R}^1$中的曲线,不存在更新和查询时间为$O(n^{1.5 - \delta})$($\delta > 0$为任意常数)的动态算法来维护DTW距离,除非负-k-团假设不成立。这即使一条曲线固定不变而另一条曲线的点仅允许替换时也成立。事实上,我们在更新和查询时间之间给出了各种进一步权衡的匹配上下界,即使在曲线长度不同的情况下也是如此。负-k-团假设是近期在细粒度复杂性中提出但已被广泛认可的假设,它推广了著名的APSP假设,并成功推导出多个下界。