Skip to main content
QUICK REVIEW

[Paper Review] 2-stack pushall sortable permutations

Adeline Pierrot, Dominique Rossin|arXiv (Cornell University)|Mar 18, 2013
Advanced Combinatorial MathematicsMathematics16 references5 citations
TL;DR

This paper introduces 2-stack pushall sortable permutations, a restricted subclass of 2-stack sortable permutations, and presents an optimal O(n²) algorithm to determine whether a given permutation of size n is 2-stack pushall sortable. The method uses a bi-coloring model of permutations to characterize valid sorting sequences and computes all possible valid colorings efficiently via ⊖-decomposition and dynamic programming, providing a polynomial-time solution to a key subproblem of the broader 2-stack sorting problem.

ABSTRACT

In the 60's, Knuth introduced stack-sorting and serial compositions of stacks. In particular, one significant question arise out of the work of Knuth: how to decide efficiently if a given permutation is sortable with 2 stacks in series? Whether this problem is polynomial or NP-complete is still unanswered yet. In this article we introduce 2-stack pushall permutations which form a subclass of 2-stack sortable permutations and show that these two classes are closely related. Moreover, we give an optimal O(n^2) algorithm to decide if a given permutation of size n is 2-stack pushall sortable and describe all its sortings. This result is a step to the solve the general 2-stack sorting problem in polynomial time.

Motivation & Objective

  • To define and study a new subclass of 2-stack sortable permutations, called 2-stack pushall sortable permutations, to simplify the general 2-stack sorting problem.
  • To provide a polynomial-time decision algorithm for 2-stack pushall sortability, addressing a long-standing open problem in combinatorial algorithms.
  • To characterize all valid sorting sequences for a given permutation using a bi-coloring model of permutation diagrams.
  • To establish a linear-time representation of all valid colorings, enabling efficient enumeration and decision.
  • To lay a foundation for solving the general 2-stack sorting problem by resolving a tractable, yet structurally rich, variant.

Proposed method

  • The paper models 2-stack pushall sorting as a bi-coloring of permutation points (red and green), where each coloring corresponds to a valid sequence of push and pop operations.
  • It defines four forbidden patterns (132, 213, 2/13, 1X2) that must be avoided in a valid coloring to ensure correct sorting behavior.
  • The ⊖-decomposition of a permutation into ⊖-indecomposable blocks is computed in linear time, enabling recursive processing.
  • A recursive algorithm computes the set of valid colorings for each ⊖-indecomposable block using dynamic programming and pattern avoidance.
  • The algorithm combines colorings of blocks via a product construction, leveraging a bijection between colorings of the full permutation and tuples of block colorings.
  • The overall algorithm runs in O(n²) time by processing each block and aggregating results, with total work bounded by O(n²).

Experimental results

Research questions

  • RQ1Can a restricted variant of 2-stack sorting—2-stack pushall sorting—be decided in polynomial time?
  • RQ2What structural properties characterize 2-stack pushall sortable permutations?
  • RQ3How can all valid sorting sequences be efficiently enumerated for a given permutation?
  • RQ4Is there a combinatorial model (e.g., bi-coloring) that captures all valid 2-stack pushall sorting operations?
  • RQ5Can this restricted model serve as a stepping stone toward solving the general 2-stack sorting problem?

Key findings

  • The paper establishes that 2-stack pushall sortable permutations are characterized by the avoidance of four specific patterns in a bi-coloring model: 132, 213, 2/13, and 1X2.
  • An optimal O(n²) algorithm is presented to decide whether a permutation is 2-stack pushall sortable, with the algorithm returning a linear description of all valid colorings.
  • The algorithm uses ⊖-decomposition to break permutations into indecomposable blocks, enabling efficient recursive processing and composition of valid colorings.
  • For permutations of size 2n, the paper exhibits a family of simple permutations with at least 2n−3 valid colorings, demonstrating that linear-sized solution sets exist beyond trivial cases.
  • The complexity of the algorithm is proven to be optimal, as it matches the input size in terms of output description length and processing time.
  • The result provides a crucial step toward solving the general 2-stack sorting problem, which remains open for decades.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.