English

Language Edit Distance & Scored Parsing: Faster Algorithms & Connection to Fundamental Graph Problems

Data Structures and Algorithms 2024-10-25 v4 Formal Languages and Automata Theory

Abstract

Given a context free language L(G)\mathcal{L(G)} over alphabet Σ\Sigma and a string sΣs \in \Sigma^*, {\em the language edit distance} problem seeks the minimum number of edits (insertions, deletions and substitutions) required to convert ss into a valid member of L(G)\mathcal{L(G)}. The well-known dynamic programming algorithm solves this problem in O(n3)O(n^3) time (ignoring grammar size) where nn is the string length [Aho, Peterson 1972, Myers 1985]. Despite its numerous applications, to date there exists no algorithm that computes exact or approximate language edit distance problem in true subcubic time. In this paper we give the first such algorithm that approximates language edit distance in subcubic time. For any arbitrary ϵ>0\epsilon > 0, our algorithm runs in O~(n2.491ϵ2)\tilde{O}(\frac{n^{2.491}}{\epsilon^2}) time and returns an estimate within a multiplicative approximation factor of (1+ϵ)(1+\epsilon). Moreover, an additive ϵn\epsilon n approximation can be computed in O(n2ϵ0.825)O(\frac{n^2}{\epsilon^{0.825}}) time. To complement our upper bound results, we show that exact computation of language edit distance with insertion-only edits in truly subcubic time will imply a truly subcubic algorithm for all-pairs shortest paths which is a long-standing open question in computer science.

Keywords

Cite

@article{arxiv.1411.7315,
  title  = {Language Edit Distance & Scored Parsing: Faster Algorithms & Connection to Fundamental Graph Problems},
  author = {Tomasz Kociumaka and Barna Saha},
  journal= {arXiv preprint arXiv:1411.7315},
  year   = {2024}
}

Comments

The original conference version had an error in the main upper bound. This updated paper corrects it albeit with a slower running time. However, the new algorithm is deterministic and has better dependency on the grammar size. The current version also gives a new additive approximation algorithm. The remaining lower bound proofs remain same as the conference version

R2 v1 2026-06-22T07:13:28.703Z