- Conference Article
32
- 10.1109/focs46700.2020.00095
Faster Approximate Pattern Matching: A Unified Approach
- Nov 01, 2020
- Panagiotis Charalampopoulos + 2 more +2
In the approximate pattern matching problem, given a text $T$ , a pattern $P$ , and a threshold $k$ , the task is to find (the starting positions of) all substrings of $T$ that are at distance at most $k$ from $P$ . We consider the two most fundamental string metrics: Under the Hamming distance, we search for substrings of $T$ that have at most $k$ mismatches with $P$ , while under the edit distance, we search for substrings of $T$ that can be transformed to $P$ with at most $k$ edits. Exact occurrences of $P$ in $T$ have a very simple structure: If we assume for simplicity that $\vert P\vert and that $P$ occurs both as a prefix and as a suffix of $T$ , then both $P$ and $T$ are periodic with a common period. However, an analogous characterization for occurrences with up to $k$ mismatches was proved only recently by Bringmann et al. [SODA'19]: Either there are $\mathcal{O}(k^{2}) k$ -mismatch occurrences of $P$ in $T$ , or both $P$ and $T$ are at Hamming distance $\mathcal{O}(k)$ from strings with a common string period of length $\mathcal{O}(m/k)$ . We tighten this characterization by showing that there are $\mathcal{O}(k) k$ -mismatch occurrences in the non-periodic case, and we lift it to the edit distance setting, where we tightly bound the number of $k$ -edit occurrences by $\mathcal{O}(k^{2})$ in the non-periodic case. Our proofs are constructive and let us obtain a unified framework for approximate pattern matching for both considered distances. In particular, we provide meta-algorithms that only rely on a small set of primitive operations. We showcase the generality of our meta-algorithms with results for the fully compressed setting, the dynamic setting, and the standard setting.
Read more