Overview
Dynamic Time Warping fills a cost table to find a low-cost alignment path between two sequences with flexible timing.
Measures similarity between sequences that may be stretched or shifted in time.
Compact metadata for implementation and discovery.
Dynamic Time Warping fills a cost table to find a low-cost alignment path between two sequences with flexible timing.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n m)
Average
O(n m)
Worst
O(n m)
Space
O(n m)
dp[i][j] = distance(a[i], b[j]) + min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1])Chooses the cheapest predecessor for the alignment path.
Show an alignment path bending through a matrix between two time series.
Window constraints can reduce cost and prevent unreasonable alignments.
What each reference supports for this entry.
Reference for dynamic time warping in time-series alignment and nonlinear temporal matching.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Dynamic time warping and Levenshtein distance both align sequences but optimize different edit models.
Dynamic Time Warping is an alternative to Needleman-Wunsch within the Sequence Alignment family.