Left-Hand Rule versus BFS: A Trade-Off Study in Maze Solving
Weijing Huang
Key points
From the paper's conclusion- The results empirically confirm the fundamental trade-off between optimality and resource efficiency.
Abstract
The maze-solving process is a fundamental benchmark for evaluating path search algorithms and is closely related to robot navigation, circuit routing, and network routing. This paper conducts an experimental comparison of two fundamentally different methods: the left-hand along the wall rule (a purely reactive, memory-efficient approach) and breadth-first search (BFS, a globally optimal graph traversal algorithm). Both algorithms are implemented in OCaml and tested in three large multi-loop grid mazes encoded by bitmask wall strings. The left-hand rule successfully reached the goal in each instance, but the generated path lengths were 2.8 to 10 times the optimal solution, with step counts being 1161, 188, and 623 respectively, while BFS corresponded to 117, 68, and 69. BFS always outputs the shortest path, but it requires O(W×H) memory to store the access matrix and parent node matrix, while the left-hand rule only consumes a very small amount of incremental memory. The results empirically confirm the fundamental trade-off between optimality and resource efficiency. This paper also describes the elimination of recursion and the adoption of array queues and other engineering adaptations, which ensure that the code can run stably in both local and Try OCaml environments.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Fast Algorithm for Centralized Multi-Agent Maze ExplorationMathematics · 2026
- Size-Independent Survival Bounds for Routing Without a MaparXiv · 2026
- From Classical Search to Intelligent Agents: An Investigation of Maze Solving AlgorithmsITM Web of Conferences · 2026
- Scalable Multi-Agent Maze Traversal with Local CommunicationarXiv · 2026
- ARRIVAL in cube-root subexponential timearXiv · 2026
- Two-Dimensional Search for a Moving Target on Rectangular and Cylindrical GridsarXiv · 2026