Tower of Hanoi

The Tower of Hanoi problem is based on a puzzle invented by the French mathematician Edouard Lucas in 1883. It consists of a stack of disks arranged from largest on the bottom to smallest on the top placed on a rod, and two empty rods. The agent’s task is to move the stack from one rod to another following the rules below:
  1. Only one disk can be moved at a time,
  2. A disk can only be moved if it is the uppermost disk on a stack,
  3. No disk may be placed on top of a smaller disk.
With three disks, the problem can be solved in seven steps.
Tower of Hanoi – Possible Initial and Goal States