Skip to main content

Towards Efficient Interactive Computation of Dynamic Time Warping Distance

  • Conference paper
  • First Online:
String Processing and Information Retrieval (SPIRE 2020)

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 A and B of respective lengths m and n, there is a fundamental dynamic programming algorithm that computes the DTW distance \(\mathsf {dtw}(A,B)\) for A and B together with an optimal alignment in \(\varTheta (mn)\) time and space. In this paper, we tackle the problem of interactive computation of the DTW distance for dynamic strings, denoted \(\mathbf {D^2TW}\), where character-wise edit operation (insertion, deletion, substitution) can be performed at an arbitrary position of the strings. Let M and N be the sizes of the run-length encoding (RLE) of A and B, respectively. We present an algorithm for \(\mathbf {D^2TW}\) that occupies \(\varTheta (mN+nM)\) space and uses \(O(m+n+\#_{\mathrm {chg}}) \subseteq O(mN + nM)\) time to update a compact differential representation \( DS \) of the DP table per edit operation, where \(\#_{\mathrm {chg}}\) denotes the number of cells in \( 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 \(\varTheta (mN + nM)\) time, and is faster when \(\#_{\mathrm {chg}}\) is smaller than \(O(mN + nM)\) which, as our preliminary experiments suggest, is likely to be the case in the majority of instances.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Abboud, A., Backurs, A., Williams, V.V.: Tight hardness results for LCS and other sequence similarity measures. In: FOCS 2015, pp. 59–78 (2015)

    Google Scholar 

  2. Bringmann, K., Künnemann, M.: Quadratic conditional lower bounds for string problems and dynamic time warping. In: FOCS 2015, pp. 79–97 (2015)

    Google Scholar 

  3. Charalampopoulos, P., Kociumaka, T., Mozes, S.: Dynamic string alignment. In: CPM 2020, pp. 9:1–9:13 (2020)

    Google Scholar 

  4. Froese, V., Jain, B.J., Rymar, M., Weller, M.: Fast exact dynamic time warping on run-length encoded time series. CoRR abs/1903.03003 (2020)

    Google Scholar 

  5. Hyyrö, H., Inenaga, S.: Compacting a dynamic edit distance table by RLE compression. In: Freivalds, R.M., Engels, G., Catania, B. (eds.) SOFSEM 2016. LNCS, vol. 9587, pp. 302–313. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-49192-8_25

    Chapter  Google Scholar 

  6. Hyyrö, H., Inenaga, S.: Dynamic RLE-compressed edit distance tables under general weighted cost functions. Int. J. Found. Comput. Sci. 29(4), 623–645 (2018)

    Article  MathSciNet  Google Scholar 

  7. Hyyrö, H., Narisawa, K., Inenaga, S.: Dynamic edit distance table under a general weighted cost function. In: van Leeuwen, J., Muscholl, A., Peleg, D., Pokorný, J., Rumpe, B. (eds.) SOFSEM 2010. LNCS, vol. 5901, pp. 515–527. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-11266-9_43

    Chapter  Google Scholar 

  8. Hyyrö, H., Narisawa, K., Inenaga, S.: Dynamic edit distance table under a general weighted cost function. J. Discret. Algorithms 34, 2–17 (2015)

    Article  MathSciNet  Google Scholar 

  9. Kim, S.R., Park, K.: A dynamic edit distance table. J. Discret. Algorithms 2, 302–312 (2004)

    Article  MathSciNet  Google Scholar 

  10. Kuszmaul, W.: Dynamic time warping in strongly subquadratic time: algorithms for the low-distance regime and approximate evaluation. In: ICALP 2019, pp. 80:1–80:15 (2019)

    Google Scholar 

  11. Nishi, A., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M.: Towards efficient interactive computation of dynamic time warping distance. CoRR abs/2005.08190 (2020). https://arxiv.org/abs/2005.08190

  12. Sakoe, H., Chiba, S.: Dynamic programming algorithm optimization for spoken word recognition. IEEE Trans. Acoust. Speech Signal Process. 26(1), 43–49 (1978)

    Article  Google Scholar 

  13. Schmidt, J.P.: All highest scoring paths in weighted grid graphs and their application in finding all approximate repeats in strings. SIAM J. Comput. 27(4), 972–992 (1998)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgments

This work was supported by JSPS KAKENHI Grant Numbers JP18K18002 (YN), JP17H01697 (SI), JP20H04141 (HB), JP18H04098 (MT), and JST PRESTO Grant Number JPMJPR1922 (SI).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shunsuke Inenaga .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Nishi, A., Nakashima, Y., Inenaga, S., Bannai, H., Takeda, M. (2020). Towards Efficient Interactive Computation of Dynamic Time Warping Distance. In: Boucher, C., Thankachan, S.V. (eds) String Processing and Information Retrieval. SPIRE 2020. Lecture Notes in Computer Science(), vol 12303. Springer, Cham. https://doi.org/10.1007/978-3-030-59212-7_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-59212-7_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-59211-0

  • Online ISBN: 978-3-030-59212-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics