{"@context":"https:\/\/schema.org\/","@type":"ScholarlyArticle","@id":"#article12342","name":"Dynamic Time Warping in Strongly Subquadratic Time: Algorithms for the Low-Distance Regime and Approximate Evaluation","abstract":"Dynamic time warping distance (DTW) is a widely used distance measure between time series, with applications in areas such as speech recognition and bioinformatics. The best known algorithms for computing DTW run in near quadratic time, and conditional lower bounds prohibit the existence of significantly faster algorithms.\r\nThe lower bounds do not prevent a faster algorithm for the important special case in which the DTW is small, however. For an arbitrary metric space Sigma with distances normalized so that the smallest non-zero distance is one, we present an algorithm which computes dtw(x, y) for two strings x and y over Sigma in time O(n * dtw(x, y)). When dtw(x, y) is small, this represents a significant speedup over the standard quadratic-time algorithm.\r\nUsing our low-distance regime algorithm as a building block, we also present an approximation algorithm which computes dtw(x, y) within a factor of O(n^epsilon) in time O~(n^{2 - epsilon}) for 0 < epsilon < 1. The algorithm allows for the strings x and y to be taken over an arbitrary well-separated tree metric with logarithmic depth and at most exponential aspect ratio. Notably, any polynomial-size metric space can be efficiently embedded into such a tree metric with logarithmic expected distortion. Extending our techniques further, we also obtain the first approximation algorithm for edit distance to work with characters taken from an arbitrary metric space, providing an n^epsilon-approximation in time O~(n^{2 - epsilon}), with high probability.\r\nFinally, we turn our attention to the relationship between edit distance and dynamic time warping distance. We prove a reduction from computing edit distance over an arbitrary metric space to computing DTW over the same metric space, except with an added null character (whose distance to a letter l is defined to be the edit-distance insertion cost of l). Applying our reduction to a conditional lower bound of Bringmann and K\u00fcnnemann pertaining to edit distance over {0, 1}, we obtain a conditional lower bound for computing DTW over a three letter alphabet (with distances of zero and one). This improves on a previous result of Abboud, Backurs, and Williams, who gave a conditional lower bound for DTW over an alphabet of size five.\r\nWith a similar approach, we also prove a reduction from computing edit distance (over generalized Hamming Space) to computing longest-common-subsequence length (LCS) over an alphabet with an added null character. Surprisingly, this means that one can recover conditional lower bounds for LCS directly from those for edit distance, which was not previously thought to be the case.","keywords":["dynamic time warping","edit distance","approximation algorithm","tree metrics"],"author":{"@type":"Person","name":"Kuszmaul, William","givenName":"William","familyName":"Kuszmaul","email":"mailto:kuszmaul@mit.edu","affiliation":"Massachusetts Institute of Technology, Cambridge, USA","funding":"Supported by an MIT Akamai Fellowship and a Fannie & John Hertz Foundation Fellowship. Also supported by NSF Grants 1314547 and 1533644. Parts of this research were performed during the Stanford CURIS research program."},"position":80,"pageStart":"80:1","pageEnd":"80:15","dateCreated":"2019-07-04","datePublished":"2019-07-04","isAccessibleForFree":true,"license":"https:\/\/creativecommons.org\/licenses\/by\/3.0\/legalcode","copyrightHolder":{"@type":"Person","name":"Kuszmaul, William","givenName":"William","familyName":"Kuszmaul","email":"mailto:kuszmaul@mit.edu","affiliation":"Massachusetts Institute of Technology, Cambridge, USA","funding":"Supported by an MIT Akamai Fellowship and a Fannie & John Hertz Foundation Fellowship. Also supported by NSF Grants 1314547 and 1533644. Parts of this research were performed during the Stanford CURIS research program."},"copyrightYear":"2019","accessMode":"textual","accessModeSufficient":"textual","creativeWorkStatus":"Published","inLanguage":"en-US","sameAs":"https:\/\/doi.org\/10.4230\/LIPIcs.ICALP.2019.80","publisher":"Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik","citation":["http:\/\/arxiv.org\/abs\/1501.07053","http:\/\/arxiv.org\/abs\/1607.03718","http:\/\/dx.doi.org\/10.4230\/LIPIcs.ICALP.2018.34","http:\/\/arxiv.org\/abs\/1904.09690","http:\/\/arxiv.org\/abs\/1003.4083"],"isPartOf":{"@type":"PublicationVolume","@id":"#volume6335","volumeNumber":132,"name":"46th International Colloquium on Automata, Languages, and Programming (ICALP 2019)","dateCreated":"2019-07-04","datePublished":"2019-07-04","editor":[{"@type":"Person","name":"Baier, Christel","givenName":"Christel","familyName":"Baier","email":"mailto:christel.baier@tu-dresden.de","affiliation":"TU Dresden, Germany"},{"@type":"Person","name":"Chatzigiannakis, Ioannis","givenName":"Ioannis","familyName":"Chatzigiannakis","email":"mailto:ichatz@diag.uniroma1.it","affiliation":"Sapienza University of Rome, Italy"},{"@type":"Person","name":"Flocchini, Paola","givenName":"Paola","familyName":"Flocchini","email":"mailto:paola.flocchini@uottawa.ca","affiliation":"University of Ottawa, Canada"},{"@type":"Person","name":"Leonardi, Stefano","givenName":"Stefano","familyName":"Leonardi","email":"mailto:leonardi@diag.uniroma1.it","affiliation":"Sapienza University of Rome, Italy"}],"isAccessibleForFree":true,"publisher":"Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik","hasPart":"#article12342","isPartOf":{"@type":"Periodical","@id":"#series116","name":"Leibniz International Proceedings in Informatics","issn":"1868-8969","isAccessibleForFree":true,"publisher":"Schloss Dagstuhl \u2013 Leibniz-Zentrum f\u00fcr Informatik","hasPart":"#volume6335"}}}