Research Article

Maze Generation and Structural Simplification for Maze Solving: A Graph Theoretical Viewpoint

Bolin Lyu*
Changchun College of Electronic Technology

* Corresponding author: [email protected]

Abstract

Maze generation and maze solving are two well-known issues in computer science. At first glance they seem to be easy puzzles, but in fact, they involve many concepts from graph theory and algorithm design. This paper introduces some common methods for maze generation, such as Binary Tree algorithm, Recursive Backtracking and the Aldous–Broder algorithm. These methods generate mazes in various ways, thus the final structures of the mazes differ in terms of randomness, bias and complexity. Concerning maze solving, traditional search methods like Breadth-First Search (BFS) and Depth-First Search (DFS) are briefly mentioned. However, the main attention is paid to the Dead-End Filling algorithm. Unlike BFS or DFS, the Dead-End Filling does not search for a direct path. It eliminates the dead ends step by step until the remaining part shows the solution path. From a graph viewpoint, this procedure can be considered as simplifying the graph structure instead of exploring possible routes. The discussion indicates that the method used for generating a maze has an important effect on its solving way. This is particularly obvious for the reduction-based methods like Dead-End Filling, since their performance depends largely on the distribution of dead ends in the maze. In perfect mazes, where the maze structure is equivalent to a spanning tree, the Dead-End Filling works most effectively. In summary, this paper reviews several typical generation and solving methods and expounds their connections from a graph-theoretical perspective.

Keywords: Maze solving; maze generation; BFS; DFS
Published: July 14, 2026
DOI: 10.54254/2753-8818/2026.PU35188
Volume: TNS Vol.175
pp. 42-49
Download PDF

References

  1. Gabrovšek, P. (2019). Analysis of maze generating algorithms. IPSI Transactions on Internet Research, 15(1), 23-30.
  2. Li, J. (2025). Maze Generation Algorithms: A Comparative Research with a Focus on Recursive Backtracking in OCaml. In Proceedings of the 2nd International Conference on Engineering Management, Information Technology and Intelligence (EMITI 2025), 432-437.
  3. Even, S., & Tarjan, R. E. (1975). Network flow and testing graph connectivity. SIAM journal on computing, 4(4), 507-518.
  4. de Oliveira Nunes, I. (2020).A StudyofRandom Walk Based AlgorithmsforEfficient Generationof Uniform Spanning Trees(Doctoral dissertation, Universidade Federal do Rio de Janeiro).
  5. Kim, P. H. (2019).Intelligent maze generation. The Ohio State University.
  6. Čarapina, M., Staničić, O., Dodig, I., & Cafuta, D. (2024). A comparative study of maze generation algorithms in a game-based mobile learning application for learning basic programming concepts.Algorithms,17(9), 404.
  7. Wang, X. (2024). OCaml-based Recursive Backtracking and Aldous Broder algorithms in solving maze challenges. InAIP Conference Proceedings(Vol. 3194, No. 1, p. 050011). AIP Publishing LLC.
  8. Yang, K., Lin, S., Dai, Y., & Li, W. (2024). Optimization and comparative analysis of maze generation algorithm hybrid.Applied and Computational Engineering,79(1), 20-33.
  9. Shi, L. (2024). Research on path planning method based on graph search algorithm.Highlights in Science, Engineering and Technology,97, 267-274.
  10. Emelianov, S. G., Bobyr, M. V., & Kryukov, A. G. (2022). Research of the properties of the breadth-first search algorithm for finding the movement route of robots. Southwestern State University, 40.
  11. Cong, G., Kodali, S., Krishnamoorthy, S., Lea, D., Saraswat, V., & Wen, T. (2008). Solving large, irregular graph problems using adaptive work-stealing. In2008 37th International Conference on Parallel Processing(pp. 536-545). IEEE.
  12. Sharma, M., & Jindal, H. (2022). Pathfinding Visualizer. http: //www.ir.juit.ac.in: 8080/jspui/bitstream/123456789/3757/1/Pathfinding%20Visualizer.pdf
  13. Vijaya, J., Baghel, A. K., & Mishra, A. S. (2024). Dynamic Maze Solver: Integrating Advanced Algorithms for Optimal Path-finding in Varied Environments. In2024 IEEE International Conference on Interdisciplinary Approaches in Technology and Management for Social Innovation (IATMSI)(Vol. 2, pp. 1-6). IEEE.
  14. Martín-Nieto, M., Castaño, D., Horta Muñoz, S., & Ruiz, D. (2024). Solving Mazes: A New Approach Based on Spectral Graph Theory.Mathematics,12(15), 2305.