Papers › Fast Algorithms for Finding Pattern Avoiders and Counting Pattern Occurrences in Permutations

Fast Algorithms for Finding Pattern Avoiders and Counting Pattern Occurrences in Permutations

28 Sep 2015arXiv:1509.08216links table onlyarchive 2025-07-28

William Kuszmaul

The archive published only this paper's code-link row. Authors, date and abstract are from arXiv's metadata (CC0), read from the Kaggle arXiv metadata snapshot of 2026-09-12 where its title matched the archive's; the title is the archive's.

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 + |Sₙ(Π)|). Additionally, we present an O(n!k)-time algorithm for counting the number of copies of patterns from Π in each permutation in Sₙ. 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(nᵏ⁺¹k) space. Using our algorithms, we generated |S₅(Π)|, …, |S₁₆(Π)| for each Π⊆S₄ 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.

PaperPDFCode

Code

williamkuszmaul/patternavoidance officialmentioned in paper report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections