Abstract
Analogical planning—the process of solving new problems by adapting solutions from previously encountered cases—offers a path toward flexible AI problem-solving. However, traditional approaches are often hampered by the computational expense of graph matching and the requirement for a single, near-perfect base case. This paper presents ANAGRAM (ANAlogical GRAph Match), a system that addresses these bottlenecks through massive parallelism and a novel base-case merging algorithm. By utilizing the Connection Machine 2 for parallel graph matching and implementing strategies to synthesize "virtual" base cases from multiple partial matches, ANAGRAM achieves significant performance gains and increased flexibility in plan generation.
Introduction
Analogical reasoning is a cornerstone of human intelligence, allowing for the transfer of knowledge across domains. In AI, analogical planning aims to leverage this by reusing past solutions. Historically, the "base selection" phase—finding the most relevant past case—has been the primary bottleneck. The complexity of graph matching often leads to quadratic growth in computation time as databases expand. Furthermore, most systems are brittle, failing when no single case provides a complete solution. ANAGRAM is designed to overcome these limitations by rethinking both the hardware architecture and the logic of case retrieval.
Methods
ANAGRAM introduces two primary innovations to the analogical planning pipeline:
1. Parallel Graph Matching
The system leverages the Connection Machine 2, a massively parallel SIMD (Single-Instruction-Multiple-Data) architecture with over 32,000 processors. By mapping each node of a plan graph to an individual processor, ANAGRAM can perform graph matching across an entire database simultaneously. This architectural shift reduces the complexity of base selection from $O(n^2)$ to nearly linear or constant time, provided sufficient hardware resources are available.
2. Base-Case Merging
To address the inflexibility of single-case matching, ANAGRAM can merge multiple "congruent" base cases into a single virtual case. This process involves identifying distinct differences that do not overlap, relaxing ordering constraints between operators, and using inductive generalization to abstract subgraphs. This allows the system to piece together a solution from several partially relevant experiences.
The internal representation of these graphs, as shown in the figure above, uses a tuple-based structure that facilitates efficient parallel processing and matching logic.
Results
The system was evaluated using both synthetic graph databases and real-world automatic programming tasks. In performance benchmarks, the parallel implementation on the Connection Machine significantly outperformed sequential baselines. While sequential matching time grew quadratically with node count, the parallel execution time remained relatively flat.
In synthesis tasks, ANAGRAM successfully merged "pre-order" and "post-order" tree traversal algorithms to generate an "in-order" traversal program. By identifying that the operators were identical but their sequence varied, the system was able to re-order the steps to satisfy the target goal. Another successful application involved adapting a cube-root program to perform division, leveraging structural similarities in their iterative approximation logic.
Discussion and Conclusion
The development of ANAGRAM highlights that base selection is a more significant barrier to scaling analogical planning than the subsequent mapping phase. By moving to parallel hardware, the computational complexity of the task is fundamentally altered. Additionally, the ability to merge multiple base cases represents a convergence of analogy and induction, where the system begins to learn general patterns from multiple examples. Future research will focus on improving indexing for even larger databases and exploring "fuzzy" matching techniques to handle less structured domains.
Summary updated