English

Towards Efficient Interactive Computation of Dynamic Time Warping Distance

Data Structures and Algorithms 2020-07-30 v3 Databases

Abstract

The dynamic time warping (DTW) is a widely-used method that allows us to efficiently compare two time series that can vary in speed. Given two strings AA and BB of respective lengths mm and nn, there is a fundamental dynamic programming algorithm that computes the DTW distance for AA and BB together with an optimal alignment in Θ(mn)\Theta(mn) time and space. In this paper, we tackle the problem of interactive computation of the DTW distance for dynamic strings, denoted D2TW\mathrm{D^2TW}, where character-wise edit operation (insertion, deletion, substitution) can be performed at an arbitrary position of the strings. Let MM and NN be the sizes of the run-length encoding (RLE) of AA and BB, respectively. We present an algorithm for D2TW\mathrm{D^2TW} that occupies Θ(mN+nM)\Theta(mN+nM) space and uses O(m+n+#chg)O(mN+nM)O(m+n+\#_{\mathrm{chg}}) \subseteq O(mN + nM) time to update a compact differential representation DS\mathit{DS} of the DP table per edit operation, where #chg\#_{\mathrm{chg}} denotes the number of cells in DS\mathit{DS} whose values change after the edit operation. Our method is at least as efficient as the algorithm recently proposed by Froese et al. running in Θ(mN+nM)\Theta(mN + nM) time, and is faster when #chg\#_{\mathrm{chg}} is smaller than O(mN+nM)O(mN + nM) which, as our preliminary experiments suggest, is likely to be the case in the majority of instances.

Keywords

Cite

@article{arxiv.2005.08190,
  title  = {Towards Efficient Interactive Computation of Dynamic Time Warping Distance},
  author = {Akihiro Nishi and Yuto Nakashima and Shunsuke Inenaga and Hideo Bannai and Masayuki Takeda},
  journal= {arXiv preprint arXiv:2005.08190},
  year   = {2020}
}

Comments

Accepted for SPIRE 2020

R2 v1 2026-06-23T15:36:08.224Z