Hairpin Completion Distance Lower Bound
Itai Boneh, Dvir Fried, Shay Golan, Matan Kraus
TL;DR
This work proves a conditional lower bound for computing the hairpin completion distance under SETH, showing no $O(n^{2-\varepsilon})$-time algorithm exists unless SETH fails, thereby matching the known $O(n^{2})$ upper bound up to subpolynomial factors. The authors construct a linear-time reduction from the LCS problem on ternary strings to the hairpin distance problem using a rich gadget-based encoding that yields $\mathsf{HDD}(x,y) = \sum_{\alpha} D(\alpha)(\#_\alpha(S)+\#_\alpha(T)) - \mathsf{LCS}(S,T)\cdot B$, and then bridge to the original hairpin distance via a linear transformation to $x',y'$. This reduction establishes that efficiency gains below quadratic time are unlikely under SETH, and the argument applies even on a small alphabet, highlighting the practical relevance for DNA-inspired string problems. The paper thus tightens the complexity landscape for hairpin-based string operations and clarifies the computational limits of distance computations in this model.
Abstract
Hairpin completion, derived from the hairpin formation observed in DNA biochemistry, is an operation applied to strings, particularly useful in DNA computing. Conceptually, a right hairpin completion operation transforms a string $S$ into $S\cdot S'$ where $S'$ is the reverse complement of a prefix of $S$. Similarly, a left hairpin completion operation transforms a string $S$ into $S'\cdot S$ where $S'$ is the reverse complement of a suffix of $S$. The hairpin completion distance from $S$ to $T$ is the minimum number of hairpin completion operations needed to transform $S$ into $T$. Recently Boneh et al. showed an $O(n^2)$ time algorithm for finding the hairpin completion distance between two strings of length at most $n$. In this paper we show that for any $\varepsilon>0$ there is no $O(n^{2-\varepsilon})$-time algorithm for the hairpin completion distance problem unless the Strong Exponential Time Hypothesis (SETH) is false. Thus, under SETH, the time complexity of the hairpin completion distance problem is quadratic, up to sub-polynomial factors.
