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:
- Only one disk can be moved at a time,
- A disk can only be moved if it is the uppermost disk on a stack,
- No disk may be placed on top of a smaller disk.
With three disks, the problem can be solved in seven steps.