(k, l)-Medians Clustering of Trajectories Using Continuous Dynamic Time Warping

Milutin Brankovic, Kevin Buchin, Koen Klaren, André Nusser, Aleksandr Popov, Sampson Wong · DOI

Introduction

Clustering trajectories—sequences of spatial coordinates over time—is a fundamental task in analyzing movement data from GPS-tracked animals, vehicles, and handwritten characters. Defining an appropriate distance metric between two paths is the primary challenge. Traditional approaches typically rely on either the Fréchet distance or Dynamic Time Warping (DTW).

The Fréchet distance, often described as the "dog-leash" distance, is a continuous bottleneck measure. While it respects the continuous nature of paths, it is highly sensitive to outliers; a single erroneous data point can drastically inflate the distance. Conversely, DTW is a "summed" measure that is more robust to noise but is inherently discrete. It only considers the vertices of the paths, making it sensitive to sampling rates and prone to artifacts when aligning trajectories with different temporal resolutions.

This paper proposes the use of Continuous Dynamic Time Warping (CDTW) to bridge this gap. By integrating distances along the entire length of the curves, CDTW provides a robust, sampling-independent measure that captures the underlying geometry of trajectories more effectively than discrete alternatives.

Methodology: Computing and Refining CDTW

The core technical contribution is a practical framework for clustering under the CDTW metric. Since exact computation of CDTW is complex, the authors developed an additive approximation algorithm. This approach represents the alignment space between two trajectories as a grid of cells. By introducing "Steiner points" along the edges of these cells and applying a modified Dijkstra’s algorithm, the optimal continuous warping path is efficiently found.

Continuous matching between two trajectories, illustrating the dense alignment lines characteristic of CDTW.

The (k, ℓ)-Medians Framework

The authors frame the clustering problem as a $(k, \ell)$-medians objective: finding $k$ cluster centers, each with a maximum complexity (number of vertices) of $\ell$. To refine these centers, two iterative improvement methods are introduced:

  1. CDBA (CDTW Barycenter Averaging): An adaptation of the discrete DBA algorithm that utilizes continuous matching to update center positions.
  2. The Wedge Method: A novel optimization technique that adjusts the edges of the center trajectory rather than just its vertices, allowing the representative path to better follow the "flow" of the cluster.

Experimental Evaluation

The approach was tested on three real-world datasets: handwritten characters, pigeon flight paths, and stork migration data.

Robustness and Visual Fidelity

A key advantage of CDTW is its robustness to outliers compared to the Fréchet distance. Because CDTW integrates the distance over the entire path, brief deviations have a minimal impact on the overall metric. In contrast, the Fréchet distance is determined by the single point of maximum separation.

Comparison of cluster centers: (a) the Fréchet center is pulled toward a single outlier spike, while (b) the CDTW center remains representative of the overall path.

As shown in the figure above, the Fréchet center is significantly distorted by a single "spike" in the input data. The CDTW center, however, maintains a smooth profile that accurately represents the majority of the trajectory. Qualitatively, CDTW centers (particularly those refined via the Wedge method) were found to capture the essential geometry of trajectories more accurately, avoiding the "zigzag" artifacts often seen in discrete DTW centers.

Conclusion

Continuous Dynamic Time Warping offers a superior alternative for trajectory clustering by combining the continuous nature of the Fréchet distance with the noise robustness of DTW. While the computational cost of the approximation algorithm is higher than discrete methods, the resulting clusters and simplified center trajectories are significantly more representative of the underlying data. Future work aims to optimize the algorithmic efficiency to support real-time processing of large-scale geospatial datasets.

Summary updated

BibTeX
@inproceedings{brankovic2020k,
  author = {Milutin Brankovic and Kevin Buchin and Koen Klaren and André Nusser and Aleksandr Popov and Sampson Wong},
  title = {{(k, l)-Medians Clustering of Trajectories Using Continuous Dynamic Time Warping}},
  booktitle = {SIGSPATIAL/GIS},
  year = {2020},
  url = {https://openreview.net/forum?id=mxO95U8OAp},
}

Loading related content...

Figure