[Paper Review] An efficient algorithm for computing the edit distance of a regular language via input-altering transducers
This paper presents an efficient algorithm, DistBestInpAlter, for computing the edit distance of a regular language specified by an NFA, achieving a worst-case time complexity of $O(n^2d)$, where $n$ is the number of transitions and $d$ is the computed edit distance. The method leverages an input-altering transducer to model error-detection properties, enabling significant performance improvements over prior approaches, with experimental validation showing orders-of-magnitude speedups.
We revisit the problem of computing the edit distance of a regular language given via an NFA. This problem relates to the inherent maximal error-detecting capability of the language in question. We present an efficient algorithm for solving this problem which executes in time $O(r^2n^2d)$, where $r$ is the cardinality of the alphabet involved, $n$ is the number of transitions in the given NFA, and $d$ is the computed edit distance. We have implemented the algorithm and present here performance tests. The correctness of the algorithm is based on the result (also presented here) that the particular error-detection property related to our problem can be defined via an input-altering transducer.
Motivation & Objective
- To address the computational challenge of determining the edit distance of a regular language given by an NFA, which reflects its inherent error-detection capability.
- To investigate whether the error-detection property for the sid(k) channel (allowing substitutions, insertions, deletions) can be formally captured using input-altering transducers.
- To develop a more efficient algorithm for edit distance computation by exploiting the structural properties of such transducers.
- To implement and empirically evaluate the new algorithm against prior approaches, demonstrating practical performance gains.
Proposed method
- The algorithm is based on a novel theoretical result: the error-detection property for the sid(k) channel is definable via an efficient input-altering transducer, as formally proven in Theorem 11.
- The core of the method involves constructing a transducer that models all possible edit strings of bounded weight (up to distance d), allowing the detection of minimal edit distances between words in the language.
- The algorithm uses dynamic programming over the state space of a product automaton combining the NFA and the transducer, tracking minimal edit costs between pairs of words.
- A key optimization involves eliminating redundant diagonal transitions in the transducer construction, which reduces state explosion without affecting correctness or weight computation.
- The method leverages the FAdo library for automata manipulation and implements multiple algorithmic variants, including intermediate and optimized versions, for comparative evaluation.
- The final algorithm, DistBestInpAlter, is derived by refining an initial error-detection-based approach through nontrivial use of the input-altering transducer structure.
Experimental results
Research questions
- RQ1Can the error-detection property for the sid(k) channel (supporting substitutions, insertions, and deletions) be formally defined using an input-altering transducer?
- RQ2Does such a transducer representation enable a more efficient algorithm for computing the edit distance of a regular language than existing methods?
- RQ3What is the theoretical and practical performance gain of using input-altering transducers in edit distance computation for NFAs?
- RQ4How does the algorithm scale with increasing edit distance and automaton size, particularly in comparison to prior $O(n^8)$-time approaches?
Key findings
- The proposed algorithm, DistBestInpAlter, achieves a worst-case time complexity of $O(n^2d)$, representing a substantial improvement over the prior $O(n^8)$ complexity for NFAs.
- Experimental results show that DistBestInpAlter is consistently faster than all prior variants, with running times reduced by up to two orders of magnitude on larger NFAs.
- For NFA $\mathbf{a}_{21}$ with 21 states, the previous best algorithm took over 3.4 hours, while DistBestInpAlter completed in just 0.029 seconds.
- On the larger NFA $\mathbf{b}_{8}$ with 73 states, DistBestInpAlter ran in 1.919 seconds, whereas the previous best algorithm exceeded 5 hours.
- The performance of DistBestInpAlter remains stable and efficient even as the edit distance $d$ increases, due to its $O(n^2d)$ dependence on $d$.
- The removal of diagonal transitions in the transducer construction was shown to be safe and effective, improving space efficiency without affecting correctness or output.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.