A Comparative Analysis of DFS, Eller’s and Wilson’s Algorithms for Maze Generation
DOI:
https://doi.org/10.54097/7zpwee86Keywords:
Maze generation algorithm, DFS, Eller’s algorithm, Wilson’s algorithm.Abstract
Due to their theoretical importance and wide range of practical applications, maze generation algorithms have received significant attention. The generation of a perfect maze, which is defined as a structure with only one path between any two points, can be done using different algorithms that have distinct features and trade-offs. The purpose of this paper is to evaluate the performance of three widely studied methods, Deep-first Search (DFS), Eller's algorithm, and Wilson's algorithm, across time complexity, space complexity, and randomness. DFS is fast and simple, but tends to create long winding paths with structural bias. Eller’s algorithm constructs mazes row by row, ensuring efficiency and memory savings while balancing connectivity and randomness. Wilson’s algorithm, though slower and more memory demanding, is capable of producing uniform mazes with high randomness, making it useful for benchmarking and testing scenarios. The comparative results show that all three algorithms achieve linear time complexity but differ substantially in spatial efficiency and maze characteristics. These findings highlight the practical importance of algorithm choice: DFS is suited for real-time applications requiring speed, Eller’s provides a compromise between efficiency and diversity, and Wilson’s offers unbiased randomness for research or AI applications. Insights from this study are used to guide the selection of maze generation algorithms for different computational and applied contexts.
Downloads
References
[1] Gabrovšek P. Analysis of maze generating algorithms. In: Proceedings of ICUSI 2024. p. 2 – 3.
[2] Elkari B, Ourabah L, Sekkat H, Hsaine A, Essaïouad C, Bouargane Y, El Moutaouakil K. Exploring maze navigation: a comparative study of DFS, BFS, and A* search algorithms. Stat Optim Inf Comput. 2024; 12 (3): 761 – 8. doi: 10.19139/soic-2310 - 5070 - 1939.
[3] Pasca M, Nandra C. Design and implementation of a 2D game engine: algorithmic approaches and performance optimization. In: Proceedings of ICUSI 2024. p. 74 – 5.
[4] Karlsson A. Evaluation of the complexity of procedurally generated maze algorithms [bachelor’s thesis]. Blekinge: Blekinge Institute of Technology; 2018.
[5] Čarapina M, Staničić O, Dodig I, Cafuta D. A comparative study of maze generation algorithms in a game-based mobile learning application for learning basic programming concepts. Algorithms. 2024; 17 (9): 404. doi: 10.3390/a17090404.
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.







