16 research outputs found

    The Complexity of Pattern Matching for 321321-Avoiding and Skew-Merged Permutations

    Full text link
    The Permutation Pattern Matching problem, asking whether a pattern permutation π\pi is contained in a permutation τ\tau, is known to be NP-complete. In this paper we present two polynomial time algorithms for special cases. The first algorithm is applicable if both π\pi and τ\tau are 321321-avoiding; the second is applicable if π\pi and τ\tau are skew-merged. Both algorithms have a runtime of O(kn)O(kn), where kk is the length of π\pi and nn the length of τ\tau

    The Möbius function of separable and decomposable permutations

    Get PDF
    We give a recursive formula for the Moebius function of an interval [σ,π][\sigma,\pi] in the poset of permutations ordered by pattern containment in the case where π\pi is a decomposable permutation, that is, consists of two blocks where the first one contains all the letters 1, 2, ..., k for some k. This leads to many special cases of more explicit formulas. It also gives rise to a computationally efficient formula for the Moebius function in the case where σ\sigma and π\pi are separable permutations. A permutation is separable if it can be generated from the permutation 1 by successive sums and skew sums or, equivalently, if it avoids the patterns 2413 and 3142. A consequence of the formula is that the Moebius function of such an interval [σ,π][\sigma,\pi] is bounded by the number of occurrences of σ\sigma as a pattern in π\pi. We also show that for any separable permutation π\pi the Moebius function of (1,π)(1,\pi) is either 0, 1 or -1

    Finding and Counting Permutations via CSPs

    Get PDF
    Permutation patterns and pattern avoidance have been intensively studied in combinatorics and computer science, going back at least to the seminal work of Knuth on stack-sorting (1968). Perhaps the most natural algorithmic question in this area is deciding whether a given permutation of length n contains a given pattern of length k. In this work we give two new algorithms for this well-studied problem, one whose running time is n^{k/4 + o(k)}, and a polynomial-space algorithm whose running time is the better of O(1.6181^n) and O(n^{k/2 + 1}). These results improve the earlier best bounds of n^{0.47k + o(k)} and O(1.79^n) due to Ahal and Rabinovich (2000) resp. Bruner and Lackner (2012) and are the fastest algorithms for the problem when k in Omega(log{n}). We show that both our new algorithms and the previous exponential-time algorithms in the literature can be viewed through the unifying lens of constraint-satisfaction. Our algorithms can also count, within the same running time, the number of occurrences of a pattern. We show that this result is close to optimal: solving the counting problem in time f(k) * n^{o(k/log{k})} would contradict the exponential-time hypothesis (ETH). For some special classes of patterns we obtain improved running times. We further prove that 3-increasing and 3-decreasing permutations can, in some sense, embed arbitrary permutations of almost linear length, which indicates that an algorithm with sub-exponential running time is unlikely, even for patterns from these restricted classes

    Finding and Counting Permutations via {CSPs}

    Get PDF

    Counting 4-Patterns in Permutations Is Equivalent to Counting 4-Cycles in Graphs

    Get PDF
    Permutation ? appears in permutation ? if there exists a subsequence of ? that is order-isomorphic to ?. The natural algorithmic question is to check if ? appears in ?, and if so count the number of occurrences. Only since very recently we know that for any fixed length k, we can check if a given pattern of length k appears in a permutation of length n in time linear in n, but being able to count all such occurrences in f(k)? n^o(k/log k) time would refute the exponential time hypothesis (ETH). Together with practical applications in statistics, this motivates a systematic study of the complexity of counting occurrences for different patterns of fixed small length k. We investigate this question for k = 4. Very recently, Even-Zohar and Leng [arXiv 2019] identified two types of 4-patterns. For the first type they designed an ??(n) time algorithm, while for the second they were able to provide an ??(n^1.5) time algorithm. This brings up the question whether the permutations of the second type are inherently harder than the first type. We establish a connection between counting 4-patterns of the second type and counting 4-cycles (not necessarily induced) in a sparse undirected graph. By designing two-way reductions we show that the complexities of both problems are the same, up to polylogarithmic factors. This allows us to leverage the work done on the latter to provide a reasonable argument for why there is a difference in the complexities for counting 4-patterns of the first and the second type. In particular, even for the seemingly simpler problem of detecting a 4-cycle in a graph on m edges, the best known algorithm works in ?(m^{4/3}) time. Our reductions imply that an ?(n^{4/3-?}) time algorithm for counting occurrences of any 4-pattern of the second type in a permutation of length n would imply an exciting breakthrough for counting (and hence also detecting) 4-cycles. In the other direction, by plugging in the fastest known algorithm for counting 4-cycles, we obtain an algorithm for counting occurrences of any 4-pattern of the second type in ?(n^1.48) time
    corecore