[Paper Review] Quadratic-Time Hardness of LCS and other Sequence Similarity Measures
This paper establishes conditional quadratic-time lower bounds for computing the Longest Common Subsequence (LCS) and Dynamic Time Warping Distance (DTWD) under the Strong Exponential Time Hypothesis (SETH). It proves that any algorithm computing LCS or DTWD in truly subquadratic time $O(n^{2- \varepsilon})$ for some $\varepsilon > 0$ would refute SETH, thereby explaining the longstanding quadratic runtime bottleneck for these fundamental sequence similarity measures.
Two important similarity measures between sequences are the longest common subsequence (LCS) and the dynamic time warping distance (DTWD). The computations of these measures for two given sequences are central tasks in a variety of applications. Simple dynamic programming algorithms solve these tasks in $O(n^2)$ time, and despite an extensive amount of research, no algorithms with significantly better worst case upper bounds are known. In this paper, we show that an $O(n^{2-ε})$ time algorithm, for some $ε>0$, for computing the LCS or the DTWD of two sequences of length $n$ over a constant size alphabet, refutes the popular Strong Exponential Time Hypothesis (SETH). Moreover, we show that computing the LCS of $k$ strings over an alphabet of size $O(k)$ cannot be done in $O(n^{k-ε})$ time, for any $ε>0$, under SETH. Finally, we also address the time complexity of approximating the DTWD of two strings in truly subquadratic time.
Motivation & Objective
- To explain the persistent quadratic-time bottleneck in computing LCS and DTWD, despite decades of research.
- To establish conditional lower bounds for LCS and DTWD based on the Strong Exponential Time Hypothesis (SETH).
- To extend these hardness results to the k-string LCS problem over small alphabets.
- To analyze the possibility of truly subquadratic approximation algorithms for DTWD.
Proposed method
- Reduces the problem of detecting a pair of vectors with small inner product to LCS and DTWD computation, using a reduction framework based on SETH.
- Constructs sequences with weighted symbols to encode vector inner product queries, where optimal matchings correspond to low-inner-product pairs.
- Uses a layered construction of unmatchable and matchable symbols to enforce structural constraints on optimal matchings.
- Employs a weight-balancing argument to show that optimal matchings must match exactly $n$ intervals per sequence, ensuring correctness of the reduction.
- Analyzes contributions from different symbol types (e.g., $3_i$, $U$, $E_U$) to bound the total score and link it to the inner product condition.
- Proves optimality of matchings by showing that any deviation from $N_i = n$ intervals leads to a higher score, contradicting optimality.
Experimental results
Research questions
- RQ1Can the $O(n^2)$ runtime for LCS be improved below $O(n^{2-\varepsilon})$ for any $\varepsilon > 0$?
- RQ2Does computing DTWD in truly subquadratic time imply a refutation of SETH?
- RQ3Is there a truly subquadratic algorithm for computing LCS of $k$ strings over an alphabet of size $O(k)$?
- RQ4Can the DTWD be approximated in truly subquadratic time under SETH?
Key findings
- An $O(n^{2-\varepsilon})$ algorithm for LCS on constant-size alphabets would refute SETH.
- An $O(n^{2-\varepsilon})$ algorithm for DTWD would refute SETH.
- Computing LCS of $k$ strings over an alphabet of size $O(k)$ in $O(n^{k-\varepsilon})$ time for any $\varepsilon > 0$ would refute SETH.
- The optimal matching for the constructed sequences must match exactly $n$ intervals per string, ensuring correctness of the reduction.
- The total score of the optimal matching is exactly $E_G = n \cdot E_U + B_2 + (2n+1) \sum_{i=2}^k B_i$, linking it to the inner product condition.
- The reduction shows that solving LCS or DTWD in truly subquadratic time would imply faster algorithms for CNF-SAT, contradicting SETH.
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.