Pattern Matching under Weighted Edit Distance
Abstract
In Pattern Matching with Weighted Edits (PMWED), we are given a pattern of length , a text of length , a positive threshold , and oracle access to a weight function that specifies the costs of edits (depending on the involved characters, and normalized so that the cost of each edit is at least ). The goal is to compute the starting positions of all fragments of that can be obtained from with edits of total cost at most . PMWED captures typical real-world applications more accurately than its unweighted variant (PMED), where all edits have unit costs. We obtain three main results: (a) a conceptually simple -time algorithm for PMWED, very different from that of Landau and Vishkin for PMED; (b) a significantly more complicated -time algorithm for PMWED under the assumption that the weight function is a metric with integer values between and ; and (c) an -time algorithm for PMWED for the case of arbitrary weights. In the setting of metrics with small integer values, we nearly match the state of the art for PMED where .
Cite
@article{arxiv.2510.17752,
title = {Pattern Matching under Weighted Edit Distance},
author = {Panagiotis Charalampopoulos and Tomasz Kociumaka and Philip Wellnitz},
journal= {arXiv preprint arXiv:2510.17752},
year = {2025}
}
Comments
96 pages + bibliography + index of results, 8 figures. Sections 7 and 8 of this article generalize and heavily draw from our earlier works arXiv:2004.08350 and arXiv:2204.03087