Fast Algorithms for Finding Pattern Avoiders and Counting Pattern Occurrences in Permutations
Abstract
Given a set of permutation patterns of length at most k, we present an algorithm for building S n(), the set of permutations of length at most n avoiding the patterns in , in time O(|S n - 1()| · k + |Sn()|). Additionally, we present an O(n!k)-time algorithm for counting the number of copies of patterns from in each permutation in Sn. Surprisingly, when || = 1, this runtime can be improved to O(n!), spending only constant time per permutation. Whereas the previous best algorithms, based on generate-and-check, take exponential time per permutation analyzed, all of our algorithms take time at most polynomial per outputted permutation. If we want to solve only the enumerative variant of each problem, computing |S n()| or tallying permutations according to -patterns, rather than to store information about every permutation, then all of our algorithms can be implemented in O(nk+1k) space. Using our algorithms, we generated |S5()|, …, |S16()| for each ⊂eq S4 with || > 4, and analyzed OEIS matches. We obtained a number of potentially novel pattern-avoidance conjectures. Our algorithms extend to considering permutations in any set closed under standardization of subsequences. Our algorithms also partially adapt to considering vincular patterns.
Turn this paper into a lesson
ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.