Title
A linear time algorithm for consecutive permutation pattern matching.
Abstract
We say that two sequences x and w of length m are order-isomorphic (of the same “shape”) if w[i]⩽w[j] if and only if x[i]⩽x[j] for each i,j∈[1,m]. We present a simple linear time algorithm for checking if a given sequence y of length n contains a factor which is order-isomorphic to a given pattern x. A factor is a subsequence of consecutive symbols of y, so we call our problem the consecutive permutation pattern matching. The (general) permutation pattern matching problem is related to general subsequences and is known to be NP-complete. We show that the situation for consecutive subsequences is significantly different and present an O(n+m) time algorithm under a natural assumption that the symbols of x can be sorted in O(m) time, otherwise the time is O(n+mlogm). In our algorithm we use a modification of the classical Knuth–Morris–Pratt string matching algorithm.
Year
DOI
Venue
2013
10.1016/j.ipl.2013.03.015
Information Processing Letters
Keywords
Field
DocType
Permutation pattern matching,Pattern matching,Knuth–Morris–Pratt algorithm,Analysis of algorithms
Discrete mathematics,Knuth–Morris–Pratt algorithm,Combinatorics,Analysis of algorithms,Algorithm,If and only if,Permutation pattern,Subsequence,Time complexity,Pattern matching,Mathematics
Journal
Volume
Issue
ISSN
113
12
0020-0190
Citations 
PageRank 
References 
30
1.44
10
Authors
5
Name
Order
Citations
PageRank
Marcin Kubica162929.26
Tomasz Kulczynski2301.78
Jakub Radoszewski362450.36
Wojciech Rytter42290181.52
Tomasz Waleń570639.62