Early Abandoning and Pruning for Elastic Distances including Dynamic Time Warping

Matthieu Herrmann, Geoffrey I. Webb
2/10/2021
25 citations
cs.LG

Official code: MonashTS/tempo (43 stars, C++, BSD-3-Clause, last commit 2026-09-15). 1 more implementation below.

Abstract

Nearest neighbor search under elastic distances is a key tool for time series analysis, supporting many applications. However, straightforward implementations of distances require $O(n^2)$ space and time complexities, preventing these applications from scaling to long series.

Show full abstract

Much work has been devoted to speeding up the NN search process, mostly with the development of lower bounds, allowing to avoid costly distance computations when a given threshold is exceeded. This threshold, provided by the similarity search process, also allows to early abandon the computation of a distance itself. Another approach, is to prune parts of the computation. All these techniques are othogonal to each other. In this work, we develop a new generic strategy, "EAPruned", that tightly integrates pruning with early abandoning. We apply it to six elastic distance measures: DTW, CDTW, WDTW, ERP, MSM and TWE, showing substantial speedup in NN search applications. Pruning alone also shows substantial speedup for some distances, benefiting applications beyond the scope of NN search (e.g. requiring all pairwise distances), and hence where early abandoning is not applicable. We~release our implementation as part of a new C++ library for time series classification, along with easy to use Python/Numpy bindings.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
MonashTS/tempoOfficial43C++BSD-3-Clause2026-09-15
HerrmannM/paper-2021-EAPElasticDistOfficial1RoffBSD-3-Clause2021-09-16
MonashTS/tempoOfficial100%
BSD-3-Clause

Monash Time Series Classification Library

437C++, PythonDec 7, 20202 months agoBSD-3-Clause
BSD-3-Clause
11Roff, C++Jan 11, 20215 years agoBSD-3-Clause

Similar Papers

Cite this paper

@article{herrmann2021early,
  title  = {Early Abandoning and Pruning for Elastic Distances including Dynamic Time Warping},
  author = {Matthieu Herrmann and Geoffrey I. Webb},
  year   = {2021},
  eprint = {2102.05221},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2102.05221}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2102.05221.svg)](https://codeofpaper.com/paper/2102.05221)

Discussion