TY - GEN

T1 - On Sorting with a Network of Two Stacks

AU - Mihalák, Matúš

AU - Pont, Marc

N1 - Publisher Copyright:
© Matúš Mihalák and Marc Pont; licensed under Creative Commons License CC-BY

PY - 2019/11

Y1 - 2019/11

N2 - Sorting with stacks is a collection of problems that deal with sorting a sequence of numbers by pushing and popping the numbers to and from a given set of stacks. Multiple concrete decision or optimization questions are formed by restricting the access to the stacks. The motivation comes, e.g., from shunting train wagons in shunting yards, shunting trams in depots, or in stacking cargo containers on cargo ships or storage yards in transshipment terminals. We consider the problem of sorting a permutation of n integers 1, 2, . . ., n using k ≥ 2 stacks. In this problem, elements from the input sequence are pushed one-by-one (in the order of the elements in the sequence) to one of the k stacks. At any time, an element from a stack can be popped and pushed to another stack; such an operation is called a shuffle. Also, at any time, an element can be popped from a stack and placed to the output sequence. We can only place the elements to the output in the increasing order of their value such that at the end the output is the ordered sequence of the elements. The problem asks to minimize the number of shuffles in the process. It is known that for k ≥ 4, the problem is NP-hard, and that there is no approximation algorithm unless P=NP. For k ≥ 3, it is known that at most O(n log n) shuffles are needed for any input sequence. For the case when k = 2, there exist input sequences that require Ω(n
2−
ε) shuffles, for any ε > 0. Nothing substantially more is known for the case of k = 2. In this paper, we study the following variant of the problem with k = 2 stacks: no shuffle and no placement to the output sequence can happen before every element is in one of the two stacks. We show that our problem can be seen as the MinUnCut problem by providing a polynomial-time reduction, and thus we show that there exists a randomized O(√log n)-approximation algorithm and a deterministic O(log n)-approximation algorithm for our problem.

AB - Sorting with stacks is a collection of problems that deal with sorting a sequence of numbers by pushing and popping the numbers to and from a given set of stacks. Multiple concrete decision or optimization questions are formed by restricting the access to the stacks. The motivation comes, e.g., from shunting train wagons in shunting yards, shunting trams in depots, or in stacking cargo containers on cargo ships or storage yards in transshipment terminals. We consider the problem of sorting a permutation of n integers 1, 2, . . ., n using k ≥ 2 stacks. In this problem, elements from the input sequence are pushed one-by-one (in the order of the elements in the sequence) to one of the k stacks. At any time, an element from a stack can be popped and pushed to another stack; such an operation is called a shuffle. Also, at any time, an element can be popped from a stack and placed to the output sequence. We can only place the elements to the output in the increasing order of their value such that at the end the output is the ordered sequence of the elements. The problem asks to minimize the number of shuffles in the process. It is known that for k ≥ 4, the problem is NP-hard, and that there is no approximation algorithm unless P=NP. For k ≥ 3, it is known that at most O(n log n) shuffles are needed for any input sequence. For the case when k = 2, there exist input sequences that require Ω(n
2−
ε) shuffles, for any ε > 0. Nothing substantially more is known for the case of k = 2. In this paper, we study the following variant of the problem with k = 2 stacks: no shuffle and no placement to the output sequence can happen before every element is in one of the two stacks. We show that our problem can be seen as the MinUnCut problem by providing a polynomial-time reduction, and thus we show that there exists a randomized O(√log n)-approximation algorithm and a deterministic O(log n)-approximation algorithm for our problem.

U2 - 10.4230/OASIcs.ATMOS.2019.3

DO - 10.4230/OASIcs.ATMOS.2019.3

M3 - Conference article in proceeding

SN - 978-3-95977-128-3

VL - 75

T3 - OASICS

SP - 3:1-3:12

BT - 19th Symposium on Algorithmic Approaches for Transportation Modelling, Optimization, and Systems (ATMOS 2019)

A2 - Cacchiani, Valentina

A2 - Marchetti-Spaccamela, Alberto

PB - Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik

ER -