Research Article

Learning to Slide: Cross-Size Graph Neural Heuristics for Optimal Puzzle Solving

Simon Cui1,*, Keyin Liu2, Mingyang Lian3
1. New York University
2. University of Toronto Mississauga,
3. University of Ningbo

* Corresponding author: [email protected]

Abstract

Heuristic techniques such as A* and IDA* with Manhattan distance or linear conflict as heuristics fall short for larger sliding-tile puzzles. This is quite unfortunate as the sliding-tile puzzle is often used as a heuristic search benchmark. We introduce PuzzleGNN, a size-adaptive graph neural network that learns cross-size heuristics for puzzles ranging from 3× 3 to 7 × 7. By encapsulating tiles and adjacencies as graph nodes and edges and embedding the board size into the model, PuzzleGNN functions as a predictor of optimal step counts for puzzles. After being trained on solutions generated by IDA*, PuzzleGNN achieved R2 ≥ 0.85 within its trained range, performing 10 to 30 times faster in inference compared to A*, and excelling on mid-sized boards with a mean absolute error (MAE) of 0.62 on 6 × 6. Nonetheless, while generalizing PuzzleGNN to unseen configurations remains challenging, a promising approach is to fuse neural and admissible heuristics as a means to achieving optimal, scalable search in combinatorial domains.

Keywords: Graph Neural Network; Sliding-tile puzzle; Heuristic search; Machine learning
Published: November 19, 2025
DOI: 10.54254/2753-8818/2025.DL29641
Volume: TNS Vol.142
pp. 101-110
Download PDF

References

  1. Korf, R. E. (1985). Iterative-Deepening A*. Artificial Intelligence, 27(1), 97–109.
  2. Hansson, O., Mayer, A., & Valtorta, M. (1992). A new result on the complexity of heuristic estimates for the A* algorithm. Artificial Intelligence, 55(1), 129–143.
  3. Culberson, J. C., & Schaeffer, J. (1998). Pattern databases. Computational Intelligence, 14(3), 318–334.
  4. Felner, A., Korf, R. E., & Hanan, S. (2004). Additive pattern database heuristics. Journal of Artificial Intelligence Research, 22, 279–318.
  5. Zhou, R., & Hansen, E. A. (2012). Parallel structured duplicate detection for A* graph search. AAAI Conference on Artificial Intelligence.
  6. Agostinelli, F., McAleer, S., Shmakov, A., & Baldi, P. (2019). Solving the Rubik's Cube with Deep Reinforcement Learning and Search. Nature Machine Intelligence, 1(8), 356–363.
  7. Kipf, T. N., & Welling, M. (2017). Semi-Supervised Classification with Graph Convolutional Networks. International Conference on Learning Representations (ICLR).
  8. Hart, P. E., Nilsson, N. J., & Raphael, B. (1968). A Formal Basis for the Heuristic Determination of Minimum Cost Paths. IEEE Transactions on Systems Science and Cybernetics, 4(2), 100–107.
  9. Korf, R. E., & Reid, M. (1997). Complexity Analysis of Admissible Heuristic Search. AAAI/IAAI, 305–310.
  10. Thayer, J. T., Dionne, A. J., & Ruml, W. (2009). Learning Inadmissible Heuristics During Search. ICAPS.
  11. Yang, F., Culberson, J., Holte, R., Zahavi, U., & Felner, A. (2011). A general theory of additive state space abstractions. Journal of Artificial Intelligence Research, 32, 631–662.
  12. Arora, S., et al. (2019). Theoretical limitations of self-attention in neural sequence models. Transactions of the Association for Computational Linguistics.
  13. Bershatsky, D., et al. (2022). Generalization in graph neural networks: Improved PAC-Bayesian bounds on graph diffusion. NeurIPS.
  14. Liu, J., et al. (2020). Certified robustness of graph neural networks against adversarial structural perturbation. KDD.