Maze Solving Using Breadth-First Search in OCaml
Ailun Zheng
Key points
From the paper's conclusion- The project provided practical experience in implementing graph-search techniques in OCaml and demonstrated the suitability of BFS for solving grid-based maze problems.
Abstract
Solving mazes is a standard problem having many uses— among them robotics, navigation, artificial intelligence, and game design. For this project, the Breadth - FirstSearch (BFS) method was applied in OCaml to handle grid - based mazes. The maze itself was taken as a two - dimensional array with each cell being either solid (wall) or passable (path). To keep track of unvisited locations, a queue was used to guide the search of adjacent cells until some connection between start and goal has been established. Several mazes of different sizes were tested to examine the behavior of the algorithm. In all cases, BFS was able to find a valid solution and produced the shortest path whenever one existed. The experiments also showed that larger mazes required more explored cells and longer execution times, which matched the expected behavior of BFS. Although additional memory was needed to store nodes waiting to be explored, the algorithm remained reliable across all test cases. The project provided practical experience in implementing graph-search techniques in OCaml and demonstrated the suitability of BFS for solving grid-based maze problems.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Left-Hand Rule versus BFS: A Trade-Off Study in Maze SolvingITM Web of Conferences · 2026
- From Classical Search to Intelligent Agents: An Investigation of Maze Solving AlgorithmsITM Web of Conferences · 2026
- Fast Algorithm for Centralized Multi-Agent Maze ExplorationMathematics · 2026
- Graph-Based Heuristics for Minimum Constraint Removal in Cluttered Robot Motion PlanningarXiv · 2026
- Maze Runner: Autonomous Maze Navigation with Line-Based Localization and Control Barrier FunctionsarXiv · 2026
- ARRIVAL in cube-root subexponential timearXiv · 2026