English

Dynamic Time Warping Under Translation: Approximation Guided by Space-Filling Curves

Computational Geometry 2022-03-17 v2 Data Structures and Algorithms

Abstract

The Dynamic Time Warping (DTW) distance is a popular measure of similarity for a variety of sequence data. For comparing polygonal curves π,σ\pi, \sigma in Rd\mathbb{R}^d, it provides a robust, outlier-insensitive alternative to the Fr\'echet distance. However, like the Fr\'echet distance, the DTW distance is not invariant under translations. Can we efficiently optimize the DTW distance of π\pi and σ\sigma under arbitrary translations, to compare the curves' shape irrespective of their absolute location? There are surprisingly few works in this direction, which may be due to its computational intricacy: For the Euclidean norm, this problem contains as a special case the geometric median problem, which provably admits no exact algebraic algorithm (that is, no algorithm using only addition, multiplication, and kk-th roots). We thus investigate exact algorithms for non-Euclidean norms as well as approximation algorithms for the Euclidean norm: - For the L1L_1 norm in Rd\mathbb{R}^d, we provide an O(n2(d+1))\mathcal{O}(n^{2(d+1)})-time algorithm, i.e., an exact polynomial-time algorithm for constant dd. Here and below, nn bounds the curves' complexities. - For the Euclidean norm in R2\mathbb{R}^2, we show that a simple problem-specific insight leads to a (1+ε)(1+\varepsilon)-approximation in time O(n3/ε2)\mathcal{O}(n^3/\varepsilon^2). We then show how to obtain a subcubic O~(n2.5/ε2)\widetilde{\mathcal{O}}(n^{2.5}/\varepsilon^2) time algorithm with significant new ideas; this time comes close to the well-known quadratic time barrier for computing DTW for fixed translations. Technically, the algorithm is obtained by speeding up repeated DTW distance estimations using a dynamic data structure for maintaining shortest paths in weighted planar digraphs. Crucially, we show how to traverse a candidate set of translations using space-filling curves in a way that incurs only few updates to the data structure.

Keywords

Cite

@article{arxiv.2203.07898,
  title  = {Dynamic Time Warping Under Translation: Approximation Guided by Space-Filling Curves},
  author = {Karl Bringmann and Sándor Kisfaludi-Bak and Marvin Künnemann and Dániel Marx and André Nusser},
  journal= {arXiv preprint arXiv:2203.07898},
  year   = {2022}
}

Comments

Full version of SoCG '22 paper

R2 v1 2026-06-24T10:13:59.374Z