Skip to main content
QUICK REVIEW

[论文解读] An Algorithmic Bridge Between Hamming and Levenshtein Distances

Elazar Goldenberg, Tomasz Kociumaka|arXiv (Cornell University)|Nov 22, 2022
Algorithms and Data Compression被引用 2
一句话总结

本文提出了EDa,一种参数化的编辑距离,其中替换的代价为1/a,插入/删除的代价为1,从而在汉明距离(a→∞)与标准编辑距离(a=1)之间建立桥梁。本文提出了一种随机化(1+ϵ)-近似算法,其时间复杂度为Õ(n/a + ak³),当a较大且k较小时,该复杂度在n上为亚线性。该算法进一步扩展至(kI,kS)-对齐问题,实现了(1,1+ϵ)-双准则近似,同样具备亚线性性能,相较于单位代价编辑距离在实际场景中(替换多、插入/删除少)实现了显著加速。

ABSTRACT

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 o\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+ε)$-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 $ε> 0$; then, our algorithm takes $ ilde{O}(n/a + ak^3)$ time. Unless $a= ilde{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 $ ilde{O}(nk_I/k_S + k_S\cdot k_I^3)$-time $(1,1+ε)$-bicriteria approximation algorithm. The latter solution is based on the techniques we develop for $ED_a$ for $a=Θ(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+ε)$-approximation in sublinear time, even for a favorable choice of $k$.

研究动机与目标

  • 通过引入一种替换代价低于插入/删除的代价的代价桥接模型,弥合汉明距离(线性时间)与编辑距离(二次时间)之间的算法差距。
  • 探究EDa的计算时间复杂度是否随着代价参数a从1增加到∞而平滑地介于线性时间与二次时间之间。
  • 设计EDa与(kI,kS)-对齐问题的高效近似算法,尤其在距离较小时且a较大时实现亚线性时间。
  • 为现实应用中替换占主导地位的启发式字符串比较方法的效率提供理论依据。

提出的方法

  • 提出EDa,一种替换代价为1/a、插入/删除代价为1的编辑距离变体,由参数a ≥ 1控制。
  • 设计一种确定性精确算法用于EDa,并在正交向量猜想下证明其近乎最优。
  • 提出一种随机化(1+ϵ)-近似算法,时间复杂度为Õ(n/a + ak³),利用具有容错能力的最长公共扩展(LCE)查询。
  • 将该算法适配至(kI,kS)-对齐问题,通过调节a = Θ(kS/kI),实现Õ(nkI/kS + kSk³I)时间内的(1,1+ϵ)-双准则近似。
  • 采用分层动态规划方法,结合替换次数的采样与基于LCE的验证,以减少查询开销。
  • 使用LCEd,ϵ查询估计具有有界误差的公共子串,从而在可控精度下实现亚线性时间近似。

实验结果

研究问题

  • RQ1当代价参数a从1增加到∞时,EDa的计算时间复杂度是否在汉明距离(线性时间)与编辑距离(二次时间)之间平滑插值?
  • RQ2当a较大且编辑距离较小时,是否能在亚线性时间内计算EDa的(1+ϵ)-近似?
  • RQ3是否可能在亚线性时间内实现(kI,kS)-对齐问题的(1,1+ϵ)-双准则近似(即插入/删除与替换数量均受限)?
  • RQ4在插入/删除稀少、替换密集的真实场景下,所提算法的性能与现有单位代价编辑距离的亚线性时间算法相比如何?
  • RQ5在正交向量猜想下,加权编辑距离的亚线性时间近似是否存在理论极限?

主要发现

  • 所提出的EDa的(1+ϵ)-近似算法时间复杂度为Õ(n/a + ak³),当a ≫ 1且k较小时,该复杂度在n上为亚线性。
  • 对于(kI,kS)-对齐问题,该算法在Õ(nkI/kS + kSk³I)时间内实现(1,1+ϵ)-双准则近似,当kI ≪ kS时同样为亚线性。
  • 该算法的运行时间显著快于现有最先进的单位代价编辑距离亚线性算法,后者仅能达到对数或多项式时间复杂度的近似比。
  • 该算法以高概率正确,依赖于具有有界误差的LCEd,ϵ查询,高效验证对齐候选。
  • 在正交向量猜想下,该算法的运行时间近乎最优,表明进一步优化将打破广泛接受的复杂性假设。
  • 该方法为计算生物学等领域中启发式字符串比较方法的实证高效性提供了理论解释,这些领域中替换占主导地位。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。