Recent Progress in Heuristic Search: A Case Study of the Four-Peg Towers of Hanoi Problem

Richard E. Korf, Ariel FelnerIJCAI 2007

Introduction: The Four-Peg Towers of Hanoi Challenge

The "standard" Towers of Hanoi with three pegs has a well-known optimal solution of $2^n - 1$ moves. However, the four-peg variant, known as Reve’s Puzzle, presents a significantly greater challenge. While the Frame-Stewart conjecture (1941) provides a recursive strategy for an optimal solution, a general mathematical proof remains elusive. Verifying this conjecture for larger numbers of discs requires exhaustive search across a state space that grows as $4^n$. For 30 discs, this space encompasses approximately $1.15 \times 10^{18}$ states, far exceeding the RAM capacity of modern supercomputers and necessitating advanced heuristic search techniques.

Methodology: Scaling Heuristic Search to $10^{18}$ States

To address the computational bottleneck, the authors integrated several state-of-the-art search algorithms:

  • Half-Depth Search: Reduces search depth by targeting a "middle state" where the largest disc is positioned for its move.
  • Multiple-Goal Pattern Databases (PDBs): The core innovation of this work. Unlike traditional PDBs that estimate distance to a single goal, these PDBs are seeded with all possible valid middle-state configurations, allowing the heuristic to return the distance to the nearest target.
  • Frontier Search and Disk-Based Storage: To manage memory, only the search frontier is stored. Since even the frontier exceeds RAM, nodes are stored on disk using "delayed duplicate detection" to minimize slow random I/O through bulk sequential processing.
  • Breadth-First Heuristic Search (BFHS): A BFS variant that employs a cost threshold ($f = g + h$) to prune the search tree effectively.

Key Insights: Beyond Single-Goal Heuristics

A critical finding involves the structural properties of the state space. In the 3-peg version, the goal state is the most distant from the start. In the 4-peg version, the "radius" of the state space—the distance to the furthest possible state—actually exceeds the optimal path length to the goal.

Comparison of optimal path length and state space radius for 21 and 22 discs.

Furthermore, the implementation of multiple-goal PDBs proved to be a game-changer. By seeding the PDB with a set of acceptable target configurations, the search can efficiently navigate toward any valid "middle state," drastically reducing the search effort.

Results: Verifying the Frame-Stewart Conjecture

The research successfully verified the Frame-Stewart conjecture as optimal for up to 30 discs. The scale of this achievement is significant: the 30-disc problem represents a 4096-fold increase in size over previous benchmarks.

Search statistics for verifying the Frame-Stewart conjecture for 25 to 30 discs.

As shown in the data, the 30-disc verification required over 17 days of computation, expanding 4.3 trillion unique nodes and utilizing nearly 400 GB of disk space. The efficiency gains from the multiple-goal PDBs were stark; for instance, the 25-disc problem's search time was reduced from 100 hours (brute-force) to just 2.6 minutes.

Conclusion and Future Directions

While this work pushes the boundaries of heuristic search and confirms the Frame-Stewart conjecture for specific cases, a general proof for all $n$ remains an open problem. The exponential growth of the state space continues to pose a formidable "wall," with the 31-disc problem requiring significantly more resources. Future work may explore integrating "Perimeter Search"—combining backward BFS with forward heuristic search—to further enhance efficiency in these massive state spaces.

Summary updated

BibTeX
@inproceedings{korf2007recent,
  author = {Richard E. Korf and Ariel Felner},
  title = {{Recent Progress in Heuristic Search: A Case Study of the Four-Peg Towers of Hanoi Problem}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2007},
}
Figure