Boxed Permutation Pattern Matching

Given permutations T and P of length n and m, respectively, the Permutation Pattern Matching problem asks to find all m-length subsequences of T that are order-isomorphic to P. This problem has a wide range of applications but is known to be NP-hard. In this paper, we study the special case, where the goal is to only find the boxed subsequences of T that are order-isomorphic to P. This problem was introduced by Bruner and Lackner who showed that it can be solved in O(n^3) time. Cho et al. [CPM 2015] gave an O(n^2m) time algorithm and improved it to O(n^2 log m). In this paper we present a solution that uses only O(n^2) time. In general, there are instances where the output size is Omega(n^2) and hence our bound is optimal. To achieve our results, we introduce several new ideas including a novel reduction to 2D offline dominance counting. Our algorithm is surprisingly simple and straightforward to implement.

[1]  Wojciech Rytter,et al.  A linear time algorithm for consecutive permutation pattern matching , 2013, Inf. Process. Lett..

[2]  Joong Chae Na,et al.  A fast algorithm for order-preserving pattern matching , 2015, Inf. Process. Lett..

[3]  Timothy M. Chan,et al.  Counting inversions, offline orthogonal range counting, and related problems , 2010, SODA '10.

[4]  Jorma Tarhio,et al.  Order-Preserving Matching with Filtration , 2014, SEA.

[5]  Wojciech Rytter,et al.  Order-Preserving Incomplete Suffix Trees and Order-Preserving Indexes , 2013, SPIRE.

[6]  Sergey Kitaev,et al.  Patterns in Permutations and Words , 2011, Monographs in Theoretical Computer Science. An EATCS Series.

[7]  Mikkel Thorup,et al.  Dynamic Integer Sets with Optimal Rank, Select, and Predecessor Search , 2014, 2014 IEEE 55th Annual Symposium on Foundations of Computer Science.

[8]  Anders Claesson,et al.  Mesh Patterns and the Expansion of Permutation Statistics as Sums of Permutation Patterns , 2011, Electron. J. Comb..

[9]  Joong Chae Na,et al.  Improved Algorithms for the Boxed-Mesh Permutation Pattern Matching Problem , 2015, CPM.

[10]  Pawel Gawrychowski,et al.  Order-Preserving Pattern Matching with k Mismatches , 2014, CPM.

[11]  Alexandr Valyuzhenich,et al.  Avoidance of boxed mesh patterns on permutations , 2013, Discret. Appl. Math..

[12]  Sergey Kitaev,et al.  (2+2)-free Posets, Ascent Sequences and Pattern Avoiding Permutations , 2008, J. Comb. Theory, Ser. A.

[13]  Martin Lackner,et al.  The computational landscape of permutation patterns , 2013, ArXiv.

[14]  Simone Faro,et al.  Efficient Algorithms for the Order Preserving Pattern Matching Problem , 2016, AAIM.

[15]  Rudolf Fleischer,et al.  Order Preserving Matching , 2013, Theor. Comput. Sci..

[16]  Michael E. Saks,et al.  The cell probe complexity of dynamic data structures , 1989, STOC '89.

[17]  Pawel Gawrychowski,et al.  Order-preserving pattern matching with k mismatches , 2016, Theor. Comput. Sci..

[18]  Joong Chae Na,et al.  On Representations of Ternary Order Relations in Numeric Strings , 2017, Mathematics in Computer Science.

[19]  Louis Ibarra Finding Pattern Matchings for Permutations , 1997, Inf. Process. Lett..

[20]  Mike D. Atkinson,et al.  Algorithms for Pattern Involvement in Permutations , 2001, ISAAC.

[21]  Prosenjit Bose,et al.  Pattern Matching for Permutations , 1993, WADS.

[22]  Eric Babson,et al.  Generalized permutation patterns and a classification of the Mahonian statistics , 2000 .