Complexity Comparison and Analysis of Maze Algorithms
DOI:
https://doi.org/10.54097/2ek2wj49Keywords:
Algorithms, complexity, maze generation, maze solving.Abstract
Maze generation and solving algorithms are widely used in areas such as path planning and game design. However, existing research has primarily focused on optimizing the performance of individual algorithms. To address this limitation, this study analyzes four maze generation algorithms and four maze-solving algorithms. The article firstly introduces the core principles, implementation and key characteristics of each algorithm. It then systematically evaluates their time complexity and space complexity. The results show that among the generation algorithms, the binary tree algorithm is the most efficient but produces biased maze structures. The Prim's algorithm generates highly complex mazes at the expense of substantial space and time requirements. Among solving algorithms, A-star algorithm achieves optimal ideal efficiency Ω(n) when equipped with a well-designed heuristic function. BFS and DFS are highly efficient, but they can only fit unweighted paths. This study provides a theoretical basis for algorithm selection. Future work will involve experimental measurements of the actual runtime performance of these algorithms.
Downloads
References
[1] Prim RC. Shortest connection networks and some generalizations. Bell Syst Tech J. 1957; 36 (6): 1389 - 401.
[2] Dijkstra EW. A note on two problems in connexion with graphs. Numer Math. 1959; 1 (1): 269 - 71.
[3] Hart PE, Nilsson NJ, Raphael B. A formal basis for the heuristic determination of minimum cost paths. IEEE Trans Syst Sci Cybern. 1968; 4 (2): 100 - 7.
[4] Babior L, Sayyadzadeh I. Optimizing Dijkstra’s algorithm: Enhancing pathfinding efficiency through heuristics and structural techniques. In: Proc IEEE Syst Inf Eng Design Symp (SIEDS). Charlottesville, VA, USA; 2025. p. 313 - 7.
[5] Kim PH. Intelligent maze generation [PhD dissertation]. Columbus (OH): The Ohio State University; 2019.
[6] Wilson DB. Generating random spanning trees more quickly than the cover time. In: Proc 28th Annu ACM Symp Theory Comput. Philadelphia, PA, USA; 1996. p. 296 - 303.
[7] Tarjan R. Depth-first search and linear graph algorithms. SIAM J Comput. 1972; 1 (2): 146 - 60.
[8] Kumar N, Kaur S. A review of various maze solving algorithms based on graph theory. IJSRD - Int J Sci Res Dev. 2019; 6 (12): 431. ISSN (online): 2321 - 0613.
[9] Wang SX. The improved Dijkstra's shortest path algorithm and its application. Procedia Eng. 2012; 29: 1186 - 90.
[10] Xie CL, Gao SH, Sun XZ. Path planning algorithm fusing improved A* algorithm and Bezier curve optimization. J Chongqing Univ Technol (Nat Sci). 2022; 36 (7).
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Highlights in Science, Engineering and Technology

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.







