314

On Rearrangement of Items Stored in Stacks

Jingjin Yu
Abstract

There are n2n \ge 2 stacks, each filled with dd items (its full capacity), and one empty stack with capacity dd. A robot arm, in one stack operation (move), may pop one item from the top of a non-empty stack and subsequently push it into a stack that is not at capacity. In a {\em labeled} problem, all ndnd items are distinguishable and are initially randomly scattered in the nn stacks. The items must be rearranged using pop-and-push moves so that at the end, the kthk^{\rm th} stack holds items (k1)d+1,,kd(k-1)d +1, \ldots, kd, in that order, from the top to the bottom for all 1kn1 \le k \le n. In an {\em unlabeled} problem, the ndnd items are of nn types of dd each. The goal is to rearrange items so that items of type kk are located in the kthk^{\rm th} stack for all 1kn1 \le k \le n. In carrying out the rearrangement, a natural question is to find the least number of required pop-and-push moves. In terms of the required number of moves for solving the rearrangement problems, the labeled and unlabeled version have lower bounds Ω(nd+ndlogdlogn)\Omega(nd + nd{\frac{\log d}{\log n}}) and Ω(nd)\Omega(nd), respectively. Our main contribution is the design of an algorithm with a guaranteed upper bound of O(nd)O(nd) for both versions when dcnd \le cn for arbitrary fixed positive number cc. In addition, a subroutine for a problem that we call the Rubik table problem is of independent interest, with applications to problems including multi-robot motion planning.

View on arXiv
Comments on this paper