## Abstract

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(nm^{1/3} log m log^{2} σ), 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 log^{2} m).

Original language | English |
---|---|

Pages (from-to) | 125-132 |

Number of pages | 8 |

Journal | Information Processing Letters |

Volume | 68 |

Issue number | 3 |

DOIs | |

State | Published - 15 Nov 1998 |

### Bibliographical note

Funding 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: moshe@cs.biu.ac.il. 3 Email: noa@cs.biu.ac.il. Partially supported by the Israel Ministry of Science and the Arts grant 8560.

## Keywords

- 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