arXiv:2610.37940cs.CCOct 2026

Manuscript Offprint

arXiv:2610.37940

Enumeration Complexity of Permutation Classes

Manuel Bodirsky, Mohamed Elsheikh

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

We study classes of permutations that are defined by avoidance of forbidden patterns. For each fixed finite set BB of forbidden patterns, we study the avoider enumeration problem: given an integer nn, output all BB-avoiding permutations of length nn. Avoider enumeration is output-polynomial for every fixed BB. However, our main notion of efficiency is polynomial delay. We use the insert-maximum tree as a search tree for enumeration, in which permutations are built by repeatedly inserting a new maximum element while preserving pattern avoidance. This leads to the insert-maximum extension problem, which asks whether a given permutation has an avoiding descendant at a specified depth. An algorithm for this problem can be used to prune branches in the search tree that cannot reach the target length. Hence, if this problem is in P, we obtain polynomial-delay enumeration.

To investigate the complexity of the insert-maximum extension problem, we introduce and study pockets, the maximal finite subtrees of the insert-maximum tree. For fixed BB, if there is a polynomial pp such that every pocket rooted at ρ\rho in its insert-maximum tree has at most p(∣ρ∣)p(|\rho|) nodes, then the extension problem is solvable in polynomial time and enumeration has polynomial delay. In particular, it suffices that every pocket has depth at most a constant depending only on BB. We prove such a bound if the class is well-quasi-ordered, has a regular insertion encoding, or if BB omits one of the three maximum-position types: leftmost, interior, or rightmost. We also prove that the extension problem is in NP for every fixed BB, even if the target depth is encoded in binary.

On the negative side, we construct a fixed set of 55 forbidden patterns for which extension is NP-complete. Consequently, enumerating valid extensions from a given starting permutation cannot have polynomial delay unless P=NPP=\mathrm{NP}. This also answers a question of Hanika by showing that the forbidden permutation constraint satisfaction problem can be NP-complete for a fixed forbidden set.

2012 ACM Subject Classification Theory of computation →\to Problems, reductions and completeness; Theory of computation →\to Enumeration; Mathematics of computing →\to Permutations and combinations

Keywords and phrases Permutation patterns, enumeration complexity, polynomial delay, extension problems, constraint satisfaction

Funding Manuel Bodirsky: Funded by the European Union (project POCOCOP, ERC Synergy grant No. 101071674). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.

Disclosure of AI assistance.

ChatGPT with the GPT 5.6 Sol model was used during development of the fixed forbidden set BfinalB_{\text{final}}. The interaction used Generalized Coloring of Permutations by Jélinek, Opler, and Valtr [12] as background and involved about 150 prompts over about four days. An initial suggested construction had 224 forbidden patterns, the longest of length 481. The suggestions to use increasing oscillations and simple permutations came from ChatGPT. The routing idea came from the provided paper. The construction was subsequently checked and simplified by the authors. The entire paper was thoroughly revised by the authors, and GPT 6 Astra and Claude Opus 5.5 were used for proofreading. The authors take full responsibility for the final text.

Enumeration Complexity of Permutation Classes

References (71)