Fundamentals of Computing Continuous Dynamic Time Warping in 2D under Different Norms

This paper establishes that Continuous Dynamic Time Warping (CDTW) for 2D polygonal curves cannot be computed exactly under the Euclidean norm using only algebraic operations, while providing an exact algorithm for norms approximating the Euclidean norm based on newly developed technical fundamentals that generalize to other norms and related measures.

Kevin Buchin, Maike Buchin, Jan Erik Swiadek, Sampson Wong

Published 2026-04-10
📖 5 min read🧠 Deep dive

Imagine you are trying to compare two different recordings of a person walking. One recording is slow and steady, while the other is fast and erratic. You want to know: Are these two people walking the same path, even if they did it at different speeds?

In the world of computers, this is called measuring curve similarity. The paper you provided tackles a specific, high-tech version of this problem called Continuous Dynamic Time Warping (CDTW).

Here is the breakdown of the paper's findings, translated into everyday language with some creative metaphors.

1. The Problem: The "Rubber Band" vs. The "Hiking Trail"

Usually, computers compare shapes by looking at specific points (like the corners of a polygon). This is like comparing two hiking trails by only looking at the campgrounds. If the trails have different numbers of campgrounds, the comparison gets messy.

CDTW is smarter. It treats the trails as continuous lines (like a rubber band). It tries to stretch and squash one trail to match the other as closely as possible, calculating the total "distance" traveled between the two lines at every single moment.

2. The Big Discovery: The "Math Magic" Wall

The authors discovered a huge hurdle when trying to calculate this perfectly for the most common way of measuring distance (called the Euclidean 2-norm, or standard straight-line distance).

  • The Metaphor: Imagine trying to build a perfect Lego castle using only standard Lego bricks. You can do it. But then, you realize that to make the roof perfectly smooth, you need a piece of "math magic" that doesn't exist in the Lego box.
  • The Reality: The paper proves that for the standard "straight-line" distance, the answer involves transcendental numbers (like π\pi or ee, or complex logarithms). These are numbers that cannot be built using just basic arithmetic (addition, subtraction, multiplication, division, and square roots).
  • The Consequence: You cannot write a computer program that calculates the exact answer for this specific problem using standard math tools. It's like trying to measure the circumference of a circle using only a ruler; you can get close, but you can never get the exact number without an infinite decimal expansion.

3. The Solution: The "Polygonal Approximation"

Since we can't get the exact answer for the "perfect circle" (the 2-norm), the authors suggest using a polygon (a shape with many straight sides) to approximate it.

  • The Metaphor: Think of a circle drawn on a screen. If you zoom in, it looks like a jagged staircase. If you use a shape with 4 sides (a square), it's a bad circle. If you use a shape with 100 sides, it looks almost exactly like a circle.
  • The Innovation: The authors created a new algorithm that works perfectly for these "polygonal" shapes.
    • They treat the distance measurement not as a smooth curve, but as a shape made of straight lines (like a hexagon or an octagon).
    • Because these shapes are made of straight lines, the math becomes simple algebra again. The computer can now calculate the exact answer for these shapes.
    • By making the polygon have enough sides, the answer becomes so close to the "real" circle that for all practical purposes, it is perfect.

4. How the Algorithm Works: The "Folding Map"

To solve this, the computer uses a technique called Dynamic Programming.

  • The Metaphor: Imagine you are folding a large, complex map of a city into a small pocket. You don't try to solve the whole city at once. You solve it one neighborhood at a time.
    • The computer divides the space between the two curves into a grid of "cells" (neighborhoods).
    • It calculates the best path through the first cell, then uses that result to calculate the best path through the next cell, and so on.
    • The paper shows that for these polygonal shapes, the "best path" through a cell follows very predictable rules (like sliding down a valley). This allows the computer to "propagate" the solution efficiently across the whole map.

5. The Remaining Mystery: The "Exponential Explosion"

The paper admits there is one loose end. While they have a working algorithm, they aren't 100% sure how fast it runs in the worst-case scenario.

  • The Metaphor: Imagine you are folding that map. Usually, it takes a few seconds. But in some weird, twisted city layouts, the number of folds might double every time you add a new block. The authors proved that for simple 1D lines, the folding is manageable. But for 2D shapes, they haven't yet proven that the number of folds won't explode into an unmanageable giant.
  • The Status: They have laid the groundwork and proven the math works, but the final "speed limit" of the algorithm is still an open question for future researchers.

Summary

  • The Goal: Compare two wiggly lines perfectly, even if they move at different speeds.
  • The Bad News: You can't calculate the exact answer for standard straight-line distance because the math gets too weird (transcendental numbers).
  • The Good News: You can calculate the exact answer if you pretend the distance is measured using a shape with many straight sides (a polygon).
  • The Result: The authors built a new, exact algorithm for these polygonal shapes that gets you arbitrarily close to the perfect answer, effectively solving the problem for real-world applications like matching handwriting, tracking animals, or comparing GPS routes.

Get papers like this in your inbox

Personalized daily or weekly digests matching your interests. Gists or technical summaries, in your language.

Try Digest →