The edit distance between strings classically assigns unit cost to every character insertion, deletion, and substitution, whereas the Hamming distance only allows substitutions. In many real-life scenarios, insertions and deletions (abbreviated indels) appear frequently but significantly less so than substitutions. To model this, we consider substitutions being cheaper than indels, with cost $1/a$ for a parameter $a\ge 1$. This basic variant, denoted $ED_a$, bridges classical edit distance ($a=1$) with Hamming distance ($a\to\infty$), leading to interesting algorithmic challenges: Does the time complexity of computing $ED_a$ interpolate between that of Hamming distance (linear time) and edit distance (quadratic time)? What about approximating $ED_a$? We first present a simple deterministic exact algorithm for $ED_a$ and further prove that it is near-optimal assuming the Orthogonal Vectors Conjecture. Our main result is a randomized algorithm computing a $(1+\epsilon)$-approximation of $ED_a(X,Y)$, given strings $X,Y$ of total length $n$ and a bound $k\ge ED_a(X,Y)$. For simplicity, let us focus on $k\ge 1$ and a constant $\epsilon > 0$; then, our algorithm takes $\tilde{O}(n/a + ak^3)$ time. Unless $a=\tilde{O}(1)$ and for small enough $k$, this running time is sublinear in $n$. We also consider a very natural version that asks to find a $(k_I, k_S)$-alignment -- an alignment with at most $k_I$ indels and $k_S$ substitutions. In this setting, we give an exact algorithm and, more importantly, an $\tilde{O}(nk_I/k_S + k_S\cdot k_I^3)$-time $(1,1+\epsilon)$-bicriteria approximation algorithm. The latter solution is based on the techniques we develop for $ED_a$ for $a=\Theta(k_S / k_I)$. These bounds are in stark contrast to unit-cost edit distance, where state-of-the-art algorithms are far from achieving $(1+\epsilon)$-approximation in sublinear time, even for a favorable choice of $k$.
翻译:字符串之间的编辑距离, 经典地将单位成本指定为每个字符插入、 删除、 替换, 而含宽距离只允许替换。 在许多真实生活中, 插入和删除( abreevation indels) 似乎经常出现, 但比替代要少得多。 模型中, 我们考虑替代比因德尔便宜, 参数$a=ge 1美元的成本为1美元 。 这个基本变量, 表示$_ a$, 经典编辑距离( a=1美元), 连接( a=1美元) 的距离( a=1美元) 的距离( a\to\ atyle), 导致令人感兴趣的算法挑战: 在 Hamming 距离( 线性) 和编辑距离( talate) 之间的时间复杂性是多少( 美元) 美元( 美元)? 我们首先提出一个简单的确定精确算法, 美元( =xxxxx美元) 和 美元( a 美元) a 美元( 美元) a 、 美元( 美元) a 美元( 美元) a (axxxxxx) a 美元) a 和 a 美元) a 开始一个随机算算算算一个总 美元( 美元) 美元( 美元) 美元)