Comparative Performance Analysis of BFS and Left-Hand Rule Algorithms for Autonomous Maze Navigation in OCaml
Abstract
Compare the Performance of Global and Local Navigation Paradigms in Autonomous Spatial Path Planning in this Study. The first purpose is to explore the efficiency of algorithms, memory scaling and structure robustness for discrete maze-solving agents built in functional programming languages. Mechanistically, in this way, binary weights are used to convert a continuous environment into a structured two-dimensional grid matrix, the starting coordinate of the entrance is fixed at the lower-right corner, and the target destination is placed on the upper-left boundary of the exit. The two frameworks for modelling path planning are as follows: First, a state-exhaustive Breadth-First Search (BFS) tracking model is employed to use a first-in, first-out queue and a boolean tracking matrix for uniform radial, layer-by-layer exploration; second, a localized Left-Hand Rule algorithm is used, which is structured as a memoryless Finite State Machine that executes a deterministic relative turning priority queue based on real-time directional vectors, prioritising relative left turns and straight movements over relative right turns and backward turnarounds. Benchmarking in OCaml shows that BFS ensures the shortest path by exploring uniformly outwards but is space-intensive; the Left-Hand Rule is very memory-efficient but may lead to non-optimal routing or cyclic deadlocks in multiply connected topologies. BFS is very suitable for resource-intensive applications that require high precision in the end, and the Left-Hand Rule provides an efficient and light-weight paradigm only for simply connected geometric boundaries.
References
- Gross, J. L., Yellen, J., & Anderson, M. (2018). Graph theory and its applications. Chapman and Hall/CRC.
- Russell, S., & Norvig, P. (2021). Artificial Intelligence: A Modern Approach, 4/E.
- LaValle, S. (2006). Planning algorithms: Cambridge university press, 2006.
- Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2022). Introduction to algorithms. MIT press.
- Niemczyk, R., & Zawiślak, S. (2019, April). Review of Maze Solving Algorithms. In Engineer of the XXI Century: Proceedings of the VIII International Conference of Students, PhD Students and Young Scientists (p. 239). Springer.
- Madhavapeddy, A., & Minsky, Y. (2022). Real World OCaml: Functional programming for the masses. Cambridge University Press.
- Banerjee, N., Chakraborty, S., Raman, V., & Satti, S. R. (2018). Space efficient linear time algorithms for BFS, DFS and applications. Theory of Computing Systems, 62(8), 1736-1762.
- Khuller, S., & Raghavachari, B. (2010). Basic graph algorithms. In Algorithms and theory of computation handbook: general concepts and techniques (pp. 7-7).
- Banerjee, N., Chakraborty, S., & Raman, V. (2016). Improved space efficient algorithms for BFS, DFS and applications. In International Computing and Combinatorics Conference (pp. 119-130). Cham: Springer International Publishing.
- Cai, J., Wan, X., Huo, M., & Wu, J. (2010). An algorithm of micromouse maze solving. In 2010 10th IEEE International Conference on Computer and Information Technology (pp. 1995-2000). IEEE.