Complexity of the Path Multi-Peg Tower of Hanoi Daniel Berend * Amir Sapir ** ¶ Abstract The Tower of Hanoi problem with h ≥ 4 pegs is long known to require a sub-exponential number of moves in order to transfer a pile of n disks from one peg to another. In this paper we discuss the Path h variant, where the pegs are placed along a line, and disks can be moved from a peg to its nearest neighbor(s) only. Whereas in the simple variant there are h(h - 1)/2 bi-directional interconnections among pegs, here there are only h - 1 of them. Despite the significant reduction in the number of interconnections, the task of moving n disks between any two pegs is still shown to grow sub-exponentially as a function of the number of disks. 1 Introduction In the well-known Tower of Hanoi problem, composed over a hundred years ago by Lucas [8], a player is given 3 pegs and a certain number n of disks of distinct sizes, and is required to transfer them from one peg to another. Initially all disks are stacked (composing a tower) on the first peg (the source) ordered by size, with the smallest at the top and the largest at the bottom. The goal is to transfer them to the third peg (the destination), moving only topmost disks, and never placing a disk on top of a smaller one. The known recursive algorithm, which may be easily shown to be optimal, takes 2 n - 1 steps to accomplish the task. Work on this problem still goes on, studying prop- erties of solution instances, as well as variants of the original problem. Connections between Pascal’s trian- gle, the Sierpi´ nski gasket and the Tower of Hanoi are established in [6]. In [1] it is shown that, with a certain way of coding the moves, a string which represents an optimal solution is square-free. Another direction was concerned with various generalizations, such as having any initial and final configurations [4], and assigning colors to disks [9]. * Departments of Mathematics and Computer Sci- ence, Ben-Gurion University, Beer-Sheva, 84105, Israel. Email:berend@cs.bgu.ac.il ** Department of Computer Science, Ben-Gurion University, Beer-Sheva, 84105, Israel. Email:amirsa@cs.bgu.ac.il ¶ Supported in part by the Lynn and William Frankel Center for Computer Sciences. A natural extension of the original problem is obtained by adding pegs. One of the earliest versions is “The Reve’s Puzzle” [3, pp. 1-2]. There it was presented in a limited form: 4 pegs and specified numbers of disks. The general setup of the problem, with any number h> 3 of pegs and any number of disks, was suggested in [12], with solutions in [13] and [5], shown recently to be identical [7]. An analysis of the algorithm reveals, somewhat surprisingly, that the solution grows sub-exponentially, at the rate of Θ( √ n2 √ 2n ) for h =4 (cf. [14]). The lower bound issue was considered in [15] and [2], where it has been shown to grow roughly at the same rate. An imposition of movement restrictions among pegs generates many variants, and calls for representing variants by di-graphs, where a vertex designates a peg, and an edge - the permission to move a disk in the appropriate direction. In [11] the “three-in-a-row” arrangement (the Path 3 ) is discussed, as well as the (uni-directional) Cyclic 4 . In [14], other 4-peg variants are dealt with: the Star 4 and the Path 4 . Whereas for Star 4 a sub-exponential algorithm is presented, the complexity issue for Path 4 is left open. In this paper, we prove that the number of moves required to transfer n disks between any two pegs, in Path h , grows sub-exponentially as a function of n, for any h ≥ 4. We present an algorithm which accomplishes the task. 2 Some notations A configuration is any legal distribution of the disks among the pegs. A perfect configuration is one in which all disks reside on the same peg. Such a configuration will be denoted by R i,n , where n is the number of disks and i is the peg containing the disks. A problem instance is given by the number h of vertices, the number n of disks and two specified pegs src and dst, and we are required to move from the configuration R src,n to the configuration R dst,n , in a minimal number of moves. We denote this task by R src,n → R dst,n . Set t h,n = max 1≤i,j≤h |R i,n → R j,n |. Given a di-graph G and a positive integer n, the corresponding configuration graph is the graph whose