Let a text string T of n symbols and a pattern string P of m symbols from alphabet Σ be given. A swapped version T′ of T is a length n string derived from T by a series of local swaps (i.e., t′ℓ ← tℓ+1 and t′ℓ+1 ← tℓ) where each element can participate in no more than one swap. The Pattern Matching with Swaps problem is that of finding all locations i for which there exists a swapped version T′ of T where there is an exact matching of P at location i of T′. It was recently shown that the Pattern Matching with Swaps problem has a solution in time Q(nm1/3 log m log2 σ), where σ = min(|Σ|, m). We consider some interesting special cases of patterns, namely, patterns where there is no length-one run, i.e., there are no a, b, c ∈ Σ where b ≠ a and b ≠ c and where the substring abc appears in the pattern. We show that for such patterns the Pattern Matching with Swaps problem can be solved in time O(n log2 m).
Bibliographical noteFunding Information:
portedb y NSF grant CCR-96-10170 and the Israel Ministry of Science and the Arts grants 6297 and 8560. On leave from Georgia Institute of Technology, College of Computing, Atlanta, GA 30332-0280, USA. ’ Emaib landauQpoly.edu. Partially supported by NSF grants CCR-9305873 and CCR-9610238. 2 Email: firstname.lastname@example.org. 3 Email: email@example.com. Partially supported by the Israel Ministry of Science and the Arts grant 8560.
- Analysis of algorithms
- Approximate pattern matching
- Combinatorial algorithms on words
- Design of algorithms
- Generalized pattern matching
- Pattern Matching with Swaps
- Pattern matching
ASJC Scopus subject areas
- Theoretical Computer Science
- Signal Processing
- Information Systems
- Computer Science Applications