arXiv:2611.13984cs.DSNov 2026

Manuscript Offprint

arXiv:2611.13984

Bounded Weighted Edit Distance with Metric Costs

Jihan Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We give a deterministic O(n+k2)O(n+k^2)-time algorithm for bounded weighted edit distance when the input costs form an integer metric on the alphabet extended by a gap symbol. Here nn is the total input length and kk is the given threshold on the distance. If the distance is at most kk, the algorithm returns it with an optimal alignment. Otherwise, it reports that the distance exceeds kk. The running time matches the classical unit-cost bound and is independent of the alphabet size and of the largest cost. The algorithm keeps only the farthest-reaching prefix alignment for each cost and each difference between the total gap costs of the aligned prefixes. For real metrics whose nonzero costs are at least one, scaling and upward rounding give a (1+ε)(1+\varepsilon)-approximation for the bounded problem in O~(n+(k/ε)2)\widetilde{O}(n+(k/\varepsilon)^2) time. If insertions and deletions have integer costs, the running time improves to O~(n+k2/ε)\widetilde{O}(n+k^2/\varepsilon).

A PDF page turning into lines of clean text

Preparing the full text

It will appear here by itself. You can read the abstract meanwhile.