Maze as a Graph
Walkable cells become graph vertices.
Adjacent walkable cells become edges.
BFS gives the shortest number-of-moves path.
DFS can find whether a path exists.
A* can accelerate target-directed pathfinding with a suitable heuristic.
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.