Computing Continuous Dynamic Time Warping of Time Series in Polynomial Time

Authors Kevin Buchin , André Nusser , Sampson Wong

Thumbnail PDF


  • Filesize: 1.25 MB
  • 16 pages

Document Identifiers

Author Details

Kevin Buchin
  • Department of Computer Science, TU Dortmund, Germany
André Nusser
  • BARC, University of Copenhagen, Denmark
Sampson Wong
  • School of Computer Science, University of Sydney, Australia

Cite AsGet BibTex

Kevin Buchin, André Nusser, and Sampson Wong. Computing Continuous Dynamic Time Warping of Time Series in Polynomial Time. In 38th International Symposium on Computational Geometry (SoCG 2022). Leibniz International Proceedings in Informatics (LIPIcs), Volume 224, pp. 22:1-22:16, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)


Dynamic Time Warping is arguably the most popular similarity measure for time series, where we define a time series to be a one-dimensional polygonal curve. The drawback of Dynamic Time Warping is that it is sensitive to the sampling rate of the time series. The Fréchet distance is an alternative that has gained popularity, however, its drawback is that it is sensitive to outliers. Continuous Dynamic Time Warping (CDTW) is a recently proposed alternative that does not exhibit the aforementioned drawbacks. CDTW combines the continuous nature of the Fréchet distance with the summation of Dynamic Time Warping, resulting in a similarity measure that is robust to sampling rate and to outliers. In a recent experimental work of Brankovic et al., it was demonstrated that clustering under CDTW avoids the unwanted artifacts that appear when clustering under Dynamic Time Warping and under the Fréchet distance. Despite its advantages, the major shortcoming of CDTW is that there is no exact algorithm for computing CDTW, in polynomial time or otherwise. In this work, we present the first exact algorithm for computing CDTW of one-dimensional curves. Our algorithm runs in time 𝒪(n⁵) for a pair of one-dimensional curves, each with complexity at most n. In our algorithm, we propagate continuous functions in the dynamic program for CDTW, where the main difficulty lies in bounding the complexity of the functions. We believe that our result is an important first step towards CDTW becoming a practical similarity measure between curves.

Subject Classification

ACM Subject Classification
  • Theory of computation → Design and analysis of algorithms
  • Computational Geometry
  • Curve Similarity
  • Fréchet distance
  • Dynamic Time Warping
  • Continuous Dynamic Time Warping


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. Tight hardness results for LCS and other sequence similarity measures. In IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, pages 59-78. IEEE Computer Society, 2015. Google Scholar
  2. Pankaj K. Agarwal, Kyle Fox, Jiangwei Pan, and Rex Ying. Approximating dynamic time warping and edit distance for a pair of point sequences. In Sándor P. Fekete and Anna Lubiw, editors, 32nd International Symposium on Computational Geometry, SoCG 2016, volume 51 of LIPIcs, pages 6:1-6:16. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016. Google Scholar
  3. Helmut Alt and Michael Godau. Computing the Fréchet distance between two polygonal curves. Int. J. Comput. Geom. Appl., 5:75-91, 1995. Google Scholar
  4. Gowtham Atluri, Anuj Karpatne, and Vipin Kumar. Spatio-temporal data mining: A survey of problems and methods. ACM Comput. Surv., 51(4):83:1-83:41, 2018. Google Scholar
  5. Selcan Kaplan Berkaya, Alper Kursat Uysal, Efnan Sora Gunal, Semih Ergin, Serkan Gunal, and M Bilginer Gulmezoglu. A survey on ECG analysis. Biomedical Signal Processing and Control, 43:216-235, 2018. Google Scholar
  6. Donald J. Berndt and James Clifford. Using dynamic time warping to find patterns in time series. In Usama M. Fayyad and Ramasamy Uthurusamy, editors, Knowledge Discovery in Databases: Papers from the 1994 AAAI Workshop, Seattle, Washington, USA, July 1994. Technical Report WS-94-03, pages 359-370. AAAI Press, 1994. Google Scholar
  7. Krishnan Bhaskaran, Antonio Gasparrini, Shakoor Hajat, Liam Smeeth, and Ben Armstrong. Time series regression studies in environmental epidemiology. International Journal of Epidemiology, 42(4):1187-1195, 2013. Google Scholar
  8. Sotiris Brakatsoulas, Dieter Pfoser, Randall Salas, and Carola Wenk. On map-matching vehicle tracking data. In Proceedings of the 31st International Conference on Very Large Data Bases, VLDB 2005, pages 853-864. ACM, 2005. Google Scholar
  9. Milutin Brankovic, Kevin Buchin, Koen Klaren, André Nusser, Aleksandr Popov, and Sampson Wong. (k, 𝓁)-medians clustering of trajectories using continuous dynamic time warping. In SIGSPATIAL '20: 28th International Conference on Advances in Geographic Information Systems, pages 99-110. ACM, 2020. Google Scholar
  10. Karl Bringmann. Why walking the dog takes time: Fréchet distance has no strongly subquadratic algorithms unless SETH fails. In 55th IEEE Annual Symposium on Foundations of Computer Science, FOCS 2014, pages 661-670. IEEE Computer Society, 2014. Google Scholar
  11. Karl Bringmann and Marvin Künnemann. Quadratic conditional lower bounds for string problems and dynamic time warping. In IEEE 56th Annual Symposium on Foundations of Computer Science, FOCS 2015, pages 79-97. IEEE Computer Society, 2015. Google Scholar
  12. Karl Bringmann and Wolfgang Mulzer. Approximability of the discrete Fréchet distance. J. Comput. Geom., 7(2):46-76, 2016. Google Scholar
  13. Kevin Buchin, Maike Buchin, Wouter Meulemans, and Wolfgang Mulzer. Four soviets walk the dog: Improved bounds for computing the Fréchet distance. Discret. Comput. Geom., 58(1):180-216, 2017. Google Scholar
  14. Kevin Buchin, Maike Buchin, and Yusu Wang. Exact algorithms for partial curve matching via the fréchet distance. In Proceedings of the Twentieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2009, pages 645-654. SIAM, 2009. Google Scholar
  15. Kevin Buchin, André Nusser, and Sampson Wong. Computing continuous dynamic time warping of time series in polynomial time. CoRR, abs/2203.04531, 2022. Google Scholar
  16. Kevin Buchin, Tim Ophelders, and Bettina Speckmann. SETH says: Weak Fréchet distance is faster, but only if it is continuous and in one dimension. In Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, pages 2887-2901. SIAM, 2019. Google Scholar
  17. Maike Buchin. On the computability of the Fréchet distance between triangulated surfaces. PhD thesis, Freie Universität Berlin, 2007. Google Scholar
  18. Jean-Lou De Carufel, Carsten Grimm, Anil Maheshwari, Megan Owen, and Michiel H. M. Smid. A note on the unsolvability of the weighted region shortest path problem. Comput. Geom., 47(7):724-727, 2014. Google Scholar
  19. Ian R Cleasby, Ewan D Wakefield, Barbara J Morrissey, Thomas W Bodey, Steven C Votier, Stuart Bearhop, and Keith C Hamer. Using time-series similarity measures to compare animal movement trajectories in ecology. Behavioral Ecology and Sociobiology, 73(11):1-19, 2019. Google Scholar
  20. Anne Driemel, Amer Krivosija, and Christian Sohler. Clustering time series under the Fréchet distance. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2016, pages 766-785. SIAM, 2016. Google Scholar
  21. Richard M Dudley. Metric entropy of some classes of sets with differentiable boundaries. Journal of Approximation Theory, 10(3):227-236, 1974. Google Scholar
  22. Alon Efrat, Quanfu Fan, and Suresh Venkatasubramanian. Curve matching, time warping, and light fields: New algorithms for computing similarity between curves. J. Math. Imaging Vis., 27(3):203-216, 2007. Google Scholar
  23. Philippe Esling and Carlos Agón. Time-series data mining. ACM Comput. Surv., 45(1):12:1-12:34, 2012. Google Scholar
  24. Omer Gold and Micha Sharir. Dynamic time warping and geometric edit distance: Breaking the quadratic barrier. ACM Trans. Algorithms, 14(4):50:1-50:17, 2018. Google Scholar
  25. Sariel Har-Peled and Mitchell Jones. Proof of Dudley’s convex approximation. arXiv preprint, 2019. URL:
  26. Koen Klaren. Continuous dynamic time warping for clustering curves. Master’s thesis, Eindhoven University of Technology, 2020. Google Scholar
  27. Anil Maheshwari, Jörg-Rüdiger Sack, and Christian Scheffer. Approximating the integral Fréchet distance. Comput. Geom., 70-71:13-30, 2018. Google Scholar
  28. Jessica Meade, Dora Biro, and Tim Guilford. Homing pigeons develop local route stereotypy. Proceedings of the Royal Society B: Biological Sciences, 272(1558):17-23, 2005. Google Scholar
  29. Joseph S. B. Mitchell and Christos H. Papadimitriou. The weighted region problem: Finding shortest paths through a weighted planar subdivision. J. ACM, 38(1):18-73, 1991. Google Scholar
  30. Meinard Müller. Dynamic time warping. In Information Retrieval for Music and Motion, pages 69-84. Springer, 2007. Google Scholar
  31. Mario E. Munich and Pietro Perona. Continuous dynamic time warping for translation-invariant curve alignment with applications to signature verification. In Proceedings of the International Conference on Computer Vision, 1999, pages 108-115. IEEE Computer Society, 1999. Google Scholar
  32. Cory Myers, Lawrence Rabiner, and Aaron Rosenberg. Performance tradeoffs in dynamic time warping algorithms for isolated word recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(6):623-635, 1980. Google Scholar
  33. Hiroaki Sakoe and Seibi Chiba. Dynamic programming algorithm optimization for spoken word recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 26(1):43-49, 1978. Google Scholar
  34. Pavel Senin. Dynamic time warping algorithm review. Information and Computer Science Department University of Hawaii at Manoa Honolulu, USA, 855(1-23):40, 2008. Google Scholar
  35. Bruno Serra and Marc Berthod. Subpixel contour matching using continuous dynamic programming. In Conference on Computer Vision and Pattern Recognition, CVPR 1994, pages 202-207. IEEE, 1994. Google Scholar
  36. E. Sriraghavendra, K. Karthik, and Chiranjib Bhattacharyya. Fréchet distance based approach for searching online handwritten documents. In 9th International Conference on Document Analysis and Recognition, ICDAR 2007, pages 461-465. IEEE Computer Society, 2007. Google Scholar
  37. Yaguang Tao, Alan Both, Rodrigo I Silveira, Kevin Buchin, Stef Sijben, Ross S Purves, Patrick Laube, Dongliang Peng, Kevin Toohey, and Matt Duckham. A comparative analysis of trajectory similarity measures. GIScience & Remote Sensing, pages 1-27, 2021. Google Scholar
  38. Charles C. Tappert, Ching Y. Suen, and Toru Wakahara. The state of the art in online handwriting recognition. IEEE Transactions on Pattern Analysis and Machine Intelligence, 12(8):787-808, 1990. Google Scholar
  39. Stephen J Taylor. Modelling financial time series. World Scientific, 2008. Google Scholar
  40. Kevin Toohey and Matt Duckham. Trajectory similarity measures. ACM SIGSPATIAL Special, 7(1):43-50, 2015. Google Scholar
  41. Taras K Vintsyuk. Speech discrimination by dynamic programming. Cybernetics, 4(1):52-57, 1968. Google Scholar
  42. Xiaoyue Wang, Abdullah Mueen, Hui Ding, Goce Trajcevski, Peter Scheuermann, and Eamonn J. Keogh. Experimental comparison of representation methods and distance measures for time series data. Data Min. Knowl. Discov., 26(2):275-309, 2013. Google Scholar
  43. Öz Yilmaz. Seismic data analysis: Processing, inversion, and interpretation of seismic data. Society of exploration geophysicists, 2001. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail