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 for a parameter . This basic variant, denoted , bridges classical edit distance () with Hamming distance (), leading to interesting algorithmic challenges: Does the time complexity of computing interpolate between that of Hamming distance (linear time) and edit distance (quadratic time)? What about approximating ? We first present a simple deterministic exact algorithm for and further prove that it is near-optimal assuming the Orthogonal Vectors Conjecture. Our main result is a randomized algorithm computing a -approximation of , given strings of total length and a bound . For simplicity, let us focus on and a constant ; then, our algorithm takes time. Unless and for small enough , this running time is sublinear in . We also consider a very natural version that asks to find a -alignment – an alignment with at most indels and substitutions. In this setting, we give an exact algorithm and, more importantly, an -time -bicriteria approximation algorithm. The latter solution is based on the techniques we develop for for . These bounds are in stark contrast to unit-cost edit distance, where state-of-the-art algorithms are far from achieving -approximation in sublinear time, even for a favorable choice of .

生成讲解博客的中文版本

生成AI智能校验的中文版本