A maze is a grid of walls and paths with an entrance and a treasure. Solving it means finding adjacent positions that connect those two locations without teleportation. section 9.1
A practical maze representation can encode:
- Walls, paths, the entrance, and the treasure as pixel colors. section 9.1
- The entrance at one coordinate and the treasure either at an edge or inside the maze. section 9.1
- Four possible neighbors for each position: above, below, right, and left. section 9.3.1
- A loop-free structure with exactly one path from the entrance to each reachable point. section 9.1.2
Concurrent maze solving
A solver opens a PNG maze, locates the entrance by scanning for its palette color, explores branches concurrently with goroutines, and writes an image highlighting the path to the treasure. It can also generate a GIF of the exploration. section 9.0 section 9.3.1
Figure 9.1 Example of a small maze with a treasure (exit) on the edge
Use the small-maze figure to compare a treasure on the edge with the grid structure and route-finding goal. section 9.1

