This article deals with deciding whether a permutation is sortable with two stacks in series. Whether this decision problem lies in P or is NP-complete is a longstanding open problem since the introduction of serial compositions of stacks by Knuth in The Art of Computer Programming in 1973. We hereby prove that this decision problem lies in P by giving a polynomial algorithm to solve it. This algorithm uses the concept of pushall sorting, which was previously defined and studied by the authors.
@InProceedings{pierrot_et_al:LIPIcs.STACS.2014.614, author = {Pierrot, Adeline and Rossin, Dominique}, title = {{2-Stack Sorting is polynomial}}, booktitle = {31st International Symposium on Theoretical Aspects of Computer Science (STACS 2014)}, pages = {614--626}, series = {Leibniz International Proceedings in Informatics (LIPIcs)}, ISBN = {978-3-939897-65-1}, ISSN = {1868-8969}, year = {2014}, volume = {25}, editor = {Mayr, Ernst W. and Portier, Natacha}, publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik}, address = {Dagstuhl, Germany}, URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.STACS.2014.614}, URN = {urn:nbn:de:0030-drops-44927}, doi = {10.4230/LIPIcs.STACS.2014.614}, annote = {Keywords: permutation, stack, sort, NP-complete} }
Feedback for Dagstuhl Publishing