Abstract
This paper presents an efficient solution for ranked (top-$k$) subsequence matching in time-series databases using Dynamic Time Warping (DTW). By introducing a novel lower-bound metric (MDMWP) and a deferred batch-retrieval strategy, the proposed method significantly reduces computational overhead and disk I/O, achieving up to two orders of magnitude speedup over existing techniques.
Introduction
Time-series analysis often involves finding specific patterns within long data streams, a task known as subsequence matching. While range queries (finding all matches within a distance threshold) have been widely studied, they are often impractical because users rarely know the appropriate threshold. Ranked matching—finding the top-$k$ most similar patterns—is more intuitive but computationally demanding, especially when using Dynamic Time Warping (DTW).
DTW is robust to temporal variations but slow to compute and difficult to index. As shown in Figure 1, DTW allows for non-linear alignment between a query $Q$ and a sequence $S$, often constrained by a warping window $\rho$ to maintain efficiency and meaningful results.
Methodology
The authors propose the DeferredTopK algorithm, which integrates three key innovations to handle the complexity of ranked DTW matching:
- MDMWP Lower Bound: The Minimum-Distance Matching-Window Pair (MDMWP) provides a tight lower bound for DTW. It estimates the minimum possible distance by examining window pairs in the index, allowing for early pruning of non-promising candidates before accessing the raw data on disk.
- AdvTopK Algorithm: This algorithm utilizes the MDMWP bound to aggressively prune the search space. By maintaining a current $k$-th best distance ($\delta_{cur}$), it skips any candidate whose lower bound exceeds this threshold. This process is illustrated in Figure 6, where nodes are only processed if they can potentially improve the current top-$k$ set.
- Deferred Group Subsequence Retrieval: To mitigate the high cost of random disk I/O, retrieval of candidate subsequences is delayed and batched. Candidates are grouped and fetched during a single sequential scan of the data file, guided by a "window-group distance" (WG-dist) to prune entire batches at once.
Experimental Evaluation
The authors evaluated their methods using four distinct datasets: the UCR Time-Series Archive, synthetic Random Walk data, real-world Stock data, and Music pitch data.
Key results include:
- Speedup: DeferredTopK outperformed sequential scans by up to 62.4 times and basic adaptations of previous state-of-the-art algorithms by up to 23.8 times.
- Pruning Efficiency: The new lower bounds reduced the number of candidate subsequences that needed to be checked by up to 163 times compared to simpler methods.
- I/O Performance: The deferred retrieval strategy was particularly effective when system memory was small, preventing performance degradation caused by excessive random disk reads.
Conclusion
The proposed framework offers a scalable and efficient solution for top-$k$ subsequence matching under DTW by prioritizing I/O efficiency and tight lower-bounding. While the method is robust, future work may address query scaling and adaptation to modern storage hardware like NVMe SSDs, where the penalty for random I/O is reduced but still relevant for large-scale databases.
Summary updated