Pattern Matching for Separable Permutations
Given a permutation \(\pi \) (called the text) of size n and another permutation \(\sigma \) (called the pattern) of size k, the NP-complete permutation pattern matching problem asks whether \(\sigma \) occurs in \(\pi \) as an order-isomorphic subsequence. In this paper, we focus on separable permutations (those permutations that avoid both 2413 and 3142, or, equivalently, that admit a separating tree). The main contributions presented in this paper are as follows.
We simplify the algorithm of Ibarra (Finding pattern matchings for permutations, Information Processing Letters 61 (1997), no. 6) to detect an occurrence of a separable permutation in a permutation and show how to reduce the space complexity from \(O(n^3 k)\) to \(O(n^3 \log k)\).
In case both the text and the pattern are separable permutations, we give a more practicable \(O(n^2 k)\) time and O(nk) space algorithm. Furthermore, we show how to use this approach to decide in \(O(n k^3 \ell ^2)\) time whether a separable permutation of size n is a disjoint union of two given permutations of size k and \(\ell \).
Given a permutation of size n and a separable permutation of size k, we propose an \(O(n^ 6k)\) time and \(O(n^4 \log k)\) space algorithm to compute the largest common separable permutation that occurs in the two input permutations. This improves upon the existing \(O(n^8)\) time algorithm by Rossin and Bouvel (The longest common pattern problem for two permutations, Pure Mathematics and Applications 17 (2006)).
Finally, we give a \(O(n^6 k)\) time and space algorithm to detect an occurrence of a bivincular separable permutation in a permutation. (Bivincular patterns generalize classical permutations by requiring that positions and values involved in an occurrence may be forced to be adjacent).
We thank the anonymous reviewers whose comments and suggestions helped improve and clarify this manuscript.
- 7.Brändén, P., Claesson, A.: Mesh patterns and the expansion of permutation statistics as sums of permutation patterns, ArXiv e-prints (2011)Google Scholar
- 11.Guillemot, S., Marx, D.: Finding small patterns in permutations in linear time. In: Chekuri, C. (ed.) Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), SIAM 2014, Portland, Oregon, USA, pp. 82–101 (2014)Google Scholar
- 16.Vatter, V.: Permutation classes. In: Bóna, M. (ed.) Handbook of Enumerative Combinatorics, pp. 753–818. Chapman and Hall/CRC (2015)Google Scholar