Efficient Special Cases of Pattern Matching with Swaps

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

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review


Let a text string T of n symbols and a pattern string P of m symbols from alphabet ∑ be given. A swapped versionT′ of T is a length n string derived from T by a series of local swaps (i.e., t′l ← tl + 1 and t′l + 1 ← tl) 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 Full-size image (<1 K), 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(nlog2m).
Original languageAmerican English
Title of host publication9th Annual Combinatorial Pattern Matching Conference (CPM)
StatePublished - 1998

Bibliographical note

Place of conference:New Jersey, USA


Dive into the research topics of 'Efficient Special Cases of Pattern Matching with Swaps'. Together they form a unique fingerprint.

Cite this