Abstract
The Longest Common Subsequence (LCS) and Dynamic Time Warping Distance (DTWD) are fundamental metrics in sequence analysis, with applications ranging from bioinformatics to speech recognition. For decades, the most efficient algorithms for these problems have remained stuck at quadratic time complexity ($O(n^2)$). This paper establishes that these algorithms are likely optimal by proving that a "truly subquadratic" algorithm ($O(n^{2-\epsilon})$) would refute the Strong Exponential Time Hypothesis (SETH). Furthermore, the authors demonstrate that this hardness persists even for small, constant-sized alphabets, bridging the gap between theoretical complexity and practical application.
1. Introduction
Comparing sequences is a cornerstone of modern computational science. Whether aligning genomic sequences, detecting plagiarism, or analyzing time-series data, the Longest Common Subsequence (LCS) and Dynamic Time Warping Distance (DTWD) are the standard tools of the trade. Despite their ubiquity, the computational cost of these measures is significant. The classic dynamic programming approach requires $O(n^2)$ time, which becomes prohibitive as datasets scale into the millions of elements.
For years, the research community has sought a "breakthrough" algorithm—one that could achieve a complexity of $O(n^{1.99})$ or better. However, only marginal logarithmic improvements have been found. This paper addresses a fundamental question: Is the $O(n^2)$ barrier a result of limited algorithmic ingenuity, or is it an inherent property of the problems themselves?
2. Theoretical Framework: SETH and Fine-Grained Complexity
To answer this question, the authors employ the framework of fine-grained complexity. Unlike traditional NP-hardness, which categorizes problems as "hard" in an absolute sense, fine-grained complexity establishes conditional lower bounds. It links the complexity of one problem to another well-studied "hard" problem.
The primary assumption used here is the Strong Exponential Time Hypothesis (SETH). SETH posits that the $k$-Satisfiability ($k$-SAT) problem cannot be solved in time significantly faster than $O(2^n)$. By assuming SETH is true, researchers can prove that other problems must also have specific lower bounds.
The reduction path in this paper follows a known trajectory:
- SETH implies a lower bound for the Orthogonal Vectors (OV) problem.
- The authors then reduce OV to LCS and DTWD.
If a subquadratic algorithm existed for LCS, it would imply a subquadratic algorithm for OV, which in turn would refute SETH—a result that would upend decades of complexity theory.
3. Methodology: Gadget Construction
The core technical contribution of the paper is the construction of "gadgets." These are specifically designed sequences of characters that simulate the behavior of vectors in the Orthogonal Vectors problem.
The reduction involves translating an instance of OV into strings such that the LCS of those strings reveals whether an orthogonal pair of vectors exists. The authors introduced Weighted LCS as an intermediate step. By assigning different weights to different characters, they simplified the reduction process, allowing for an inductive proof structure that avoids the exhaustive case-by-case analysis common in previous hardness results.
4. Key Results
4.1 Small Alphabet Hardness
One of the most significant findings is the relevance of these bounds to small alphabets. Previous proofs often required an alphabet size that scaled with the input length, which is not representative of real-world data (like the 4-character DNA alphabet). This paper proves:
- LCS is hard to solve in subquadratic time even with an alphabet of only 7 symbols.
- DTWD is hard with an alphabet of only 5 symbols.
4.2 The $k$-String Wall
The paper also examines the problem of finding the LCS of $k$ different strings. The standard dynamic programming approach takes $O(n^k)$ time. The authors prove that an algorithm running in $O(n^{k-\epsilon})$ would also refute SETH, suggesting that the $O(n^k)$ complexity is essentially optimal for any $k$.
4.3 Approximation Hardness
For DTWD, the authors show that even finding a rough approximation is computationally difficult in subquadratic time, provided the distance function between individual symbols is arbitrary. This suggests that for certain distance measures, even sacrificing precision may not yield the desired speedup.
5. Conclusion and Implications
The results presented in this paper provide a rigorous justification for the $O(n^2)$ bottleneck that has frustrated researchers for decades. By grounding the hardness of LCS and DTWD in SETH, the authors provide a clear signal to the community: the search for a truly subquadratic exact algorithm is likely futile.
Instead, future efforts should be directed toward:
- Heuristics: Developing algorithms that perform well on "typical" rather than worst-case data.
- Approximations: Finding near-optimal solutions for LCS that might bypass the quadratic barrier.
- Specialized Hardware: Leveraging parallel processing to mitigate the $O(n^2)$ cost in practice.
While these bounds are conditional on the truth of SETH, they represent a major step forward in our understanding of the fundamental limits of sequence comparison.
Summary updated