Lune

STOC2025顶会

Bounded Edit Distance: Optimal Static and Dynamic Algorithms for Small Integer Weights

Egor Gorbachev, Tomasz Kociumaka

摘要

The edit distance (also known as the Levenshtein distance) of two strings is the minimum number of character insertions, deletions, and substitutions needed to transform one string into the other. The textbook algorithm determines the edit distance of two length-n strings in O(n2) time, and one of the foundational results of fine-grained complexity is that any polynomial-factor improvement upon this quadratic runtime would violate the Orthogonal Vectors Hypothesis. In the bounded version of the problem, where the complexity is parameterized by the value k of the edit distance, the classic algorithm of Landau and Vishkin [JCSS’88] achieves O(n+k2) time, which is optimal (up to sub-polynomial factors and conditioned on OVH) as a function of n and k. While the Levenshtein distance is a fundamental theoretical notion, most practical applications use weighted edit distance, where the weight (cost) of each edit can be an arbitrary real number in [1,∞) that may depend on the edit type and the characters involved. Unfortunately, the Landau–Vishkin algorithm does not generalize to the weighted setting and, for many decades, a simple O(nk)-time dynamic programming procedure remained the state of the art for bounded weighted edit distance. Only recently, Das, Gilbert, Hajiaghayi, Kociumaka, and Saha [STOC’23] provided an O(n+k5)-time algorithm; shortly afterward, Cassis, Kociumaka, and Wellnitz [FOCS’23] presented an Õ(n+√nk3)-time solution (where Õ(·) hides polylogn factors) and proved this runtime optimal for √n ≤ k ≤ n (up to sub-polynomial factors and conditioned on the All-Pairs Shortest Paths Hypothesis). Notably, the hard instances constructed to establish the underlying conditional lower bound use fractional weights with large denominators, reaching (n), which stands in contrast to weight functions used in practice (e.g., in bioinformatics) that, after normalization, typically attain small integer values. Our first main contribution is a surprising discovery that the Õ(n+k2) running time of the Landau–Vishkin algorithm can be recovered if the weights are small integers (e.g., if some specific weight function is fixed in a given application). In general, our solution takes Õ(n+minW,√k· k2) time for integer weights not exceeding a threshold W. Despite matching time complexities, we do not use the Landau–Vishkin framework; instead, we build upon the recent techniques for arbitrary weights. For this, we exploit extra structure following from integer weights and avoid further bottlenecks using several novel ideas to give faster and more robust implementations of multiple steps of the previous approach. Next, we shift focus to the dynamic version of the unweighted edit distance problem, which asks to maintain the edit distance of two strings that change dynamically, with each update modeled as a single edit (character insertion, deletion, or substitution). For many years, the best approach for dynamic edit distance combined the Landau–Vishkin algorithm with a dynamic strings implementation supporting efficient substring equality queries, such as one by Mehlhorn, Sundar, and Uhrig [SODA’94]; the resulting solution supports updates in Õ(k2) time. Recently, Charalampopoulos, Kociumaka, and Mozes [CPM’20] observed that a framework of Tiskin [SODA’10] yields a dynamic algorithm with an update time of Õ(n). This is optimal in terms of n: significantly faster updates would improve upon the static O(n2)-time algorithm and violate OVH. With the state-of-the-art update time at Õ(minn,k2), an exciting open question is whether Õ(k) update time is possible. Our second main contribution is an affirmative answer to this question: we present a deterministic dynamic algorithm that maintains the edit distance in Õ(k) worst-case time per update. Surprisingly, this result builds upon our new static solution and hence natively supports small integer weights: if they do not exceed a threshold W, the update time becomes Õ(W2 k).

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Pattern Matching under Weighted Edit Distance 引用了 Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation Matrices
  • Dynamic Dyck and Tree Edit Distance: Decompositions and Reductions to String Edit Distance 引用了 Dynamic algorithms for LIS and distance to monotonicity
  • Dynamic Dyck and Tree Edit Distance: Decompositions and Reductions to String Edit Distance 引用了 Sublinear-Time Algorithms for Computing & Embedding Gap Edit Distance
  • Dynamic Dyck and Tree Edit Distance: Decompositions and Reductions to String Edit Distance 引用了 Faster Weighted and Unweighted Tree Edit Distance and APSP Equivalence
  • Dynamic Dyck and Tree Edit Distance: Decompositions and Reductions to String Edit Distance 引用了 Does preprocessing help in fast sequence comparisons?
  • Sublinear-Time Algorithms for Computing & Embedding Gap Edit Distance 引用了 Does preprocessing help in fast sequence comparisons?
  • Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv Factorization 引用了 Sublinear-Time Algorithms for Computing & Embedding Gap Edit Distance
  • Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv Factorization 引用了 Does preprocessing help in fast sequence comparisons?
  • Faster Weighted and Unweighted Tree Edit Distance and APSP Equivalence 引用了 Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv Factorization
  • The Complexity of Dynamic LZ77 is ?Θ(n2/3) 引用了 Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv Factorization
  • The Complexity of Dynamic LZ77 is ?Θ(n2/3) 引用了 Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation Matrices
  • Approximation Schemes for Edit Distance and LCS in Quasi-Strongly Subquadratic Time 引用了 Sublinear-Time Algorithms for Computing & Embedding Gap Edit Distance
  • Approximation Schemes for Edit Distance and LCS in Quasi-Strongly Subquadratic Time 引用了 Does preprocessing help in fast sequence comparisons?
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper5

  1. Faster Weighted and Unweighted Tree Edit Distance and APSP EquivalenceJakob Nogler, Adam Polak, Barna Saha, Virginia Vassilevska Williams 等STOC 2025 · 4 次引用
  2. Approximation Schemes for Edit Distance and LCS in Quasi-Strongly Subquadratic TimeXiao Mao, Aviad RubinsteinSTOC 2026 · 4 次引用
  3. Pattern Matching under Weighted Edit DistancePanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2025 · 3 次引用
  4. Dynamic Dyck and Tree Edit Distance: Decompositions and Reductions to String Edit DistanceDebarati Das, Jacob Gilbert, MohammadTaghi Hajiaghayi, Tomasz Kociumaka 等FOCS 2025 · 1 次引用
  5. The Complexity of Dynamic LZ77 is ?Θ(n2/3)Itai Boneh, Shay Golan, Matan KrausSODA 2026

它引用的 Paper20

  1. Does preprocessing help in fast sequence comparisons?Elazar Goldenberg, Aviad Rubinstein, Barna SahaSTOC 2020 · 15 次引用
  2. Dynamic algorithms for LIS and distance to monotonicityMichael Mitzenmacher, Saeed SeddighinSTOC 2020 · 11 次引用
  3. Sublinear-Time Algorithms for Computing & Embedding Gap Edit DistanceTomasz Kociumaka, Barna SahaFOCS 2020 · 9 次引用
  4. Faster Pattern Matching under Edit Distance : A Reduction to Dynamic Puzzle Matching and the Seaweed Monoid of Permutation MatricesPanagiotis Charalampopoulos, Tomasz Kociumaka, Philip WellnitzFOCS 2022 · 8 次引用
  5. Near-Optimal Quantum Algorithms for Bounded Edit Distance and Lempel-Ziv FactorizationDaniel Gibney, Ce Jin, Tomasz Kociumaka, Sharma V. ThankachanSODA 2024 · 7 次引用

相关 Paper

  1. Optimal Algorithms for Bounded Weighted Edit DistanceAlejandro Cassis, Tomasz Kociumaka, Philip WellnitzFOCS 2023 · 4 次引用
  2. Weighted Edit Distance Computation: Strings, Trees, and DyckDebarati Das, Jacob Gilbert, MohammadTaghi Hajiaghayi, Tomasz Kociumaka 等STOC 2023 · 4 次引用
  3. Approximating Edit Distance in the Fully Dynamic ModelTomasz Kociumaka, Anish Mukherjee, Barna SahaFOCS 2023 · 1 次引用
  4. Almost-optimal sublinear-time edit distance in the low distance regimeKarl Bringmann, Alejandro Cassis, Nick Fischer, Vasileios NakosSTOC 2022 · 4 次引用
  5. Faster Sublinear-Time Edit DistanceKarl Bringmann, Alejandro Cassis, Nick Fischer, Tomasz KociumakaSODA 2024 · 3 次引用
黄昏的海面,两侧是细线勾勒的悬崖