Pattern matching with swaps

A. Amir, Y. Aumann, G.M. Landau, M. Lewenstein, N. Lewenstein
Proceedings 38th Annual Symposium on Foundations of Computer Science  
248 amir et al. 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 with an exact matching of P in location i of T . It has been an open problem whether
more » ... apped matching can be done in less than O nm time. In this paper we show the first algorithm that solves the pattern matching with swaps problem in time o nm . We present an algorithm whose time complexity is O nm 1/3 log m log σ for a general alphabet , where σ = min m .
doi:10.1109/sfcs.1997.646103 dblp:conf/focs/AmirALLL97 fatcat:bhnpza5p7zhgjkpvdmiva4ktb4