You are on page 1of 1

Case Study on Tower of Hanoi game

Abstract Introduction The Tower of Hanoi is one of the truly classic puzzle games, challenging players with its seemingly simple but frustratingly difficult goal. In the Tower of Hanoi puzzle a player attempts to move a large pile of disks, known as the Tower, from the leftmost peg to the rightmost on the puzzle board. The rules of the puzzle state that the player can only move one disk per turn and can never place a larger disk onto a smaller one at any time. A third spare peg is available for the intermediate placement of the disks. The three pegs are numbered 1, 2 and 3. It is assumed that the starting peg is 1, the goal peg is 3 and the spare peg is 2. Disks are numbered consecutively from the smallest to the largest from 1 to n. Initially they are all stacked on peg 1, disk n stands at its bottom and disk 1 on the top. The puzzle was invented by the French mathematician Edouard Lucas in 1883 and is often described as a mathematical puzzle, although solving the Tower of Hanoi doesn't require any mathematical equations at all for a human player. The main idea of all the iterative algorithms of the towers of Hanoi is based on the disk transfers which can occur in cyclically moves in two directions. For an even n the direction of disk transfers with odd-numbers is 1 2 3 1, and for evennumbered disks is 1 numbered disks is 1 3 2 2 3 1. Reversely, for the odd n the directions are reversed: for the even1, and for the odd-numbered disks is 1 3 2 1.

Linear Programming Model Let x be the disk number i = 1< i < 5 xj be the current present of the disk j = 1,2,3 xk be the destination of the disk from jth position xl be the nth move n = number of moves Minimize z= xijkl x1 < x2 x2 < x3 x3 < x4 x4 < x5 xijkl > 0