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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Abboud, A., Backurs, A., Williams, V.V.: Tight hardness results for LCS and other sequence similarity measures. In: FOCS 2015, pp. 59–78 (2015)
Bringmann, K., Künnemann, M.: Quadratic conditional lower bounds for string problems and dynamic time warping. In: FOCS 2015, pp. 79–97 (2015)
Charalampopoulos, P., Kociumaka, T., Mozes, S.: Dynamic string alignment. In: CPM 2020, pp. 9:1–9:13 (2020)
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)
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
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)
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
Hyyrö, H., Narisawa, K., Inenaga, S.: Dynamic edit distance table under a general weighted cost function. J. Discret. Algorithms 34, 2–17 (2015)
Kim, S.R., Park, K.: A dynamic edit distance table. J. Discret. Algorithms 2, 302–312 (2004)
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)
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
Sakoe, H., Chiba, S.: Dynamic programming algorithm optimization for spoken word recognition. IEEE Trans. Acoust. Speech Signal Process. 26(1), 43–49 (1978)
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)
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
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Switzerland AG
About this paper
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)