A path is an ordered sequence of nodes and edges connecting a starting point to a goal. In a maze, it records the moves needed to reach the destination. section 2.7
Search problems compare possible paths toward a goal. One path may be shorter, cheaper to execute, or otherwise better for the situation. section 1.8
A path connects the following tree concepts:
- Nodes represent positions or states. section 2.7
- Edges represent connections between nodes. section 2.7
- A parent link records the node from which a neighbor was reached, allowing the route to be traced back toward the start. section 2.10
Tracing a maze path with BFS
Breadth-first search explores a maze with a queue. After discovering an unvisited neighbor, it marks the neighbor, stores the current node as its parent, and enqueues it. When the goal is found, following parent links backward reconstructs the path from the goal to the starting point. section 2.10 section 2.7
Figure 2.13 A solution to the maze problem represented as a tree
Visualize a maze solution as a tree path from the start point to the goal. section 2.7



