Dual Lookups in Pattern Databases

Ariel Felner, Uzi Zahavi, Jonathan Schaeffer, Robert C. HolteIJCAI 2005

Heuristic search algorithms like A and IDA are the workhorses of automated problem solving, relying on heuristic functions ($h(n)$) to estimate the distance to a goal. Pattern Databases (PDBs) have long been a gold standard for generating these heuristics by pre-calculating exact distances for sub-problems. However, increasing the accuracy of a PDB typically requires exponentially more memory. This paper introduces a breakthrough technique: dual lookups, which extract a second, admissible heuristic from an existing PDB without any additional memory overhead.

The Object-Location Duality

The fundamental insight of this work is the symmetry between objects and their locations. In many combinatorial puzzles, asking "Where is object $X$?" is functionally equivalent to asking "What object is at location $Y$?"

A Regular Lookup in a PDB asks: "What is the cost to move a specific set of objects from their current positions to their goal positions?" A Dual Lookup flips this perspective, asking: "What is the cost to move the objects currently occupying those goal positions back to their own respective homes?"

Figure 1: Comparison of regular and dual lookups in a grid-based puzzle.

In domains with perfect symmetry, these two questions are equivalent in terms of the underlying state space, allowing the same PDB to provide two different heuristic estimates. By taking the maximum of the regular and dual lookups, solvers can achieve much tighter bounds on the distance to the goal.

Handling Inconsistency with Bidirectional Pathmax (BPMX)

While regular PDB lookups are typically "consistent" (the heuristic value changes by at most the cost of a move), dual lookups can be highly inconsistent. A single move might significantly change the set of objects occupying the target locations, causing the dual heuristic value to "jump."

To turn this potential weakness into a strength, the authors developed Bidirectional Pathmax (BPMX). Unlike standard pathmax, which only propagates heuristic values from parent to child, BPMX propagates values in both directions. If a high heuristic value is discovered in one branch, BPMX pushes that information back up to the parent and then down to sibling nodes. This allows the search to prune large subtrees that would otherwise have been explored based on lower, local heuristic estimates.

Performance in "Wide" Domains

The power of dual lookups is most evident in domains with "wide" operators—moves that affect many objects simultaneously. In the TopSpin puzzle, for example, a single move reverses a segment of the circular track.

Figure 2: Goal state and lookups for the Top Spin puzzle.

In such domains, a single move can drastically alter the dual lookup's result, leading to frequent "jumps" in the heuristic value that BPMX can then exploit. For the (17,4) TopSpin puzzle, adding a single dual lookup reduced the number of nodes generated by IDA by a factor of 28x*.

Key Results and Benchmarks

The authors evaluated their approach across several classic benchmarks:

  • Rubik’s Cube: The most dramatic results were seen here, where multiple dual lookups reduced the search tree by 250x, yielding a 55x speedup in total search time.
  • 15-Puzzle and 24-Puzzle: Even in these "narrow" domains where only one tile moves at a time, the technique provided a 2x speedup. The gains are more modest here because the unique "blank" tile breaks perfect symmetry, requiring specialized PDBs.

While powerful, the technique is not without limits. The authors observed diminishing returns as more lookups were added, as the overhead of performing multiple lookups can eventually exceed the time saved by pruning nodes. Additionally, the method requires a clear object-location symmetry, making it inapplicable to domains like the Towers of Hanoi where multiple disks can occupy one location.

Conclusion

Dual lookups represent a significant advancement in heuristic search, offering a way to effectively "double" the information available from a PDB for free. By leveraging the inherent duality of objects and locations and managing inconsistency through BPMX, this approach provides a scalable way to optimize solvers for complex combinatorial problems.

Summary updated

BibTeX
@inproceedings{felner2005dual,
  author = {Ariel Felner and Uzi Zahavi and Jonathan Schaeffer and Robert C. Holte},
  title = {{Dual Lookups in Pattern Databases}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2005},
}
Figure