[Paper Review] Dynamic Time Warping and Geometric Edit Distance: Breaking the Quadratic Barrier
This paper presents the first deterministic algorithms to compute Dynamic Time Warping (DTW) and Geometric Edit Distance (GED) between two sequences of n points in R in O(n²/log log n) time, breaking the longstanding O(n²) quadratic time barrier. The approach uses a divide-and-conquer strategy with a novel application of the extended Fredman trick and SMAWK algorithm on decomposed subproblems, enabling subquadratic performance for both DTW and GED under polyhedral metrics like L1 and L∞.
Dynamic Time Warping (DTW) and Geometric Edit Distance (GED) are basic similarity measures between curves or general temporal sequences (e.g., time series) that are represented as sequences of points in some metric space (X, dist). The DTW and GED measures are massively used in various fields of computer science and computational biology, consequently, the tasks of computing these measures are among the core problems in P. Despite extensive efforts to find more efficient algorithms, the best-known algorithms for computing the DTW or GED between two sequences of points in X = R^d are long-standing dynamic programming algorithms that require quadratic runtime, even for the one-dimensional case d = 1, which is perhaps one of the most used in practice. In this paper, we break the nearly 50 years old quadratic time bound for computing DTW or GED between two sequences of n points in R, by presenting deterministic algorithms that run in O( n^2 log log log n / log log n ) time. Our algorithms can be extended to work also for higher dimensional spaces R^d, for any constant d, when the underlying distance-metric dist is polyhedral (e.g., L_1, L_infty).
Motivation & Objective
- To break the nearly 50-year-old O(n²) time bound for computing DTW and GED between point sequences in R.
- To extend subquadratic performance to higher-dimensional spaces Rd under polyhedral metrics such as L1 and L∞.
- To provide a deterministic algorithm that improves upon the long-standing quadratic-time dynamic programming approach.
- To support practical applications requiring fast similarity computation on time series and trajectory data.
Proposed method
- Decompose the input sequences into blocks and use a divide-and-conquer strategy to process subproblems.
- Apply a modified version of the extended Fredman trick to compare costs of staircase paths in grid subproblems efficiently.
- Use the SMAWK algorithm for totally monotone matrices to optimize dynamic programming transitions.
- Represent each subproblem as a weighted grid graph with vertical, horizontal, and diagonal edges, where edge weights correspond to distances or gap penalties.
- Maintain and propagate optimal path costs across subproblem boundaries using R-boundary computations.
- Adapt the framework to GED by modeling monotone matchings as paths in a grid with gap penalties ρ, and apply the same optimization techniques.
Experimental results
Research questions
- RQ1Can the O(n²) time complexity for computing DTW on one-dimensional sequences be broken using deterministic algorithms?
- RQ2Is it possible to extend subquadratic performance from DTW to Geometric Edit Distance (GED) under standard linear gap penalties?
- RQ3Can the same algorithmic framework be adapted to higher-dimensional spaces Rd with polyhedral metrics like L1 and L∞?
- RQ4How can the extended Fredman trick be applied to compare path costs in grid-based dynamic programming under non-uniform edge weights?
- RQ5Can the log log n factor in the time bound be further reduced using advanced matrix selection techniques?
Key findings
- The paper achieves a deterministic O(n²/log log n) time algorithm for computing DTW between two sequences of n points in R, breaking the 50-year-old quadratic time barrier.
- The same algorithmic framework is extended to compute GED in the same time complexity, supporting both optimal matching and cost computation.
- The method applies to higher-dimensional spaces Rd for any constant d when the underlying metric is polyhedral, such as L1 or L∞.
- The approach uses a novel combination of divide-and-conquer, the extended Fredman trick, and the SMAWK algorithm to optimize dynamic programming tables.
- The algorithm supports more general gap penalty functions, including linear functions of point coordinates, enhancing robustness to outliers.
- The time bound is improved by shaving off the log log log n factor via the SMAWK algorithm, as noted in the acknowledgments.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.