This agent solves the Tower of Hanoi problems. This puzzle "involves three vertical pegs or posts and a number of doughnut-like disks of graduated sizes that fit on the pegs. At the outset, all the disks are arranged pyramidally on one of the pegs, say A, with the largest disk on the bottom. The task is to move all of the disks to another peg, C, say, under the constraints that (1) only one disk may be moved at a time, and (2) a disk may never be placed on top of another smaller than itself. Any number of disks may be used; the minimum number of moves for a solution is (2n - 1), where n is the number of disks" (Simon, 1975/1979, pp. 230-231).

This version uses search control rules to solve the TOH in the minimum number of moves.

The search control is as follows:
  • Always alternate between moving the smallest disk and the other exposed disk that can move.
  • Move the exposed disk to the one place it can move (the other disk that is bigger than it or an empty peg).
  • Move the smallest disk to the peg it was not at last. This requires remembering the last peg the smallest disk was on and initializing this to the appropriate peg (the destination peg if there is an even number of disks, and the other peg if there is an odd number of disks).
Soar capabilities
  • Basic PSCM functions: State Elaboration, Operator Proposal, Operator Evaluation, Internal Operator Application
Download LinksExternal Environment
  • None.
Default Rules
  • None.
Associated Publications
  • None.
  • John Laird
Soar Versions
  • Soar 7-9
Project Type
  • VisualSoar