arXiv:2609.04294cs.CGSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.04294

Approximating CDTW Distance of Piecewise Algebraic Curves

Alperen A. Ergür, Shamik Khowala

Abstract

Curves as input data naturally arise in a variety of fields including finance, seismology, medicine, spatio-temporal data mining, malicious activity detection, and more. A common way to analyze these data sets is to do similarity matching or clustering. The most common metrics used for measuring similarity of curves are Dynamic Time Warping (DTW) and Fréchet distance. These metrics are sensitive to sampling rate and outliers respectively, and do not yield robust outcomes. Continuous Dynamic Time Warping (CDTW) is a more robust distance metric that improves upon DTW and Fréchet distances. Existing algorithms for CDTW are either exact algorithms that focus on non-Euclidean norms and piecewise linear curves, or approximation algorithms limited to piecewise linear curves. We present an approximation algorithm for computing the CDTW distance under Euclidean norm between piecewise (higher degree) algebraic curves. That is, we present a fully polynomial-time approximation scheme (FPTAS) of multiplicative error ε\varepsilon, with O((m+n)104(1ε)104log⁡((m+n)ε2))O\left((m+n)^{\frac{10}{4}}(\frac{1}{\varepsilon})^{\frac{10}{4}} \log \left(\frac{(m+n)}{\varepsilon^2}\right)\right) complexity, where mm and nn are the number of pieces of the two input curves.

1 Introduction

The ability to rigorously analyze time-series and trajectory data is essential in fields such as signature verification, animal tracking, and electrocardiography. Such analysis frequently involves clustering, classifying, and spotting trends. A common way to do this is by measuring the similarity between curves. Many similarity measures have been considered, and the right choice often varies among applications.

Dynamic Time Warping (DTW) distance computes an alignment between two sequences accounting for the distances between all pairs of points, however, as an inherently discrete measure, it is sensitive to the sequences' sampling rates. Fréchet distance aligns curves accounting for the maximum distance between corresponding points; it is a bottleneck measure and inherently sensitive to outliers. Continuous Dynamic Time Warping (CDTW) distance overcomes both disadvantages by taking the best of both worlds: it combines the continuous nature of Fréchet distance with the summation-based nature of DTW distances.

The robustness of CDTW distance to outliers and sampling rates makes it a natural choice for a variety of applications. One of the first areas where CDTW was proposed is signature verification and handwriting analysis, where writing is naturally represented as continuous curves. Munich and Perona developed a CDTW-based algorithm for translation-invariant curve alignment that handled arbitrary point correspondence in signatures and matching the continuous shape of the signature rather than isolated sample points [MP99].

Clustering trajectories under CDTW avoids unwanted artifacts, such as zig-zags, that appear when using discrete DTW or the Fréchet distance. Brankovic, Buchin, Klaren, Nusser, Popov, and Wong studied kk-median problem under CDTW distance, providing the first (k,l)(k,l)-medians clustering algorithm using this metric. They utilize the squared Euclidean norm. The reasons for this is discussed in detail by Klaren [Bra+20]. In short, Euclidean distance is the natural norm for most applications, and especially for clustering and regression tasks. Gudmundsson and Valladares gave a GPU-based approach for subtrajectory clustering using the continuous Fréchet distance [GV12] (a variant of CDTW), which aids in the identification of movement patterns (e.g., flocks, leadership, and convergence) across large spatio-temporal datasets [GLW08].

In the remaining parts of the introduction, we review algorithms and hardness results for DTW, Fréchet, and CDTW similarity metrics in detail. This gives context to state our results in Section 1.4.

References (32)