Efficient special cases of pattern matching with swaps

A. Amihood, G. M Landau, M Lewenstein, N Lewensteint

Research output: Chapter in Book/Report/Conference proceedingChapterpeer-review


Let a text string 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 in location i of T′. It was recently shown that the Pattern Matching with Swaps problem has a solution in time O(nm 1/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).
Original languageAmerican English
Title of host publicationCombinatorial Pattern Matching
EditorsMartin Farach-Colton
PublisherSpringer Berlin Heidelberg
ISBN (Print)978-3-540-69054-2
StatePublished - 1998

Publication series

NameLecture Notes in Computer Science


Dive into the research topics of 'Efficient special cases of pattern matching with swaps'. Together they form a unique fingerprint.

Cite this