An optimal path is a sequence of actions or transitions from an initial state to a goal, chosen as best according to a relevant criterion such as distance. Searching evaluates future states and looks for a path that reaches the goal; changing conditions may require adjusting the plan. section 2.1
A road trip makes the idea intuitive: when a lodge becomes unavailable or time is lost, the route and activities change. The best path is therefore tied to the current situation and goal, not fixed forever. section 2.1
For path problems, the practical challenge is choosing how to search:
- Represent locations or attractions as nodes and their connections as edges, with distances or other costs attached to paths. section 6.2
- Compare candidate paths against the optimization criterion, such as total travel distance. section 6.2
- Recognize that brute force can generate every tour and select the best one, but becomes expensive as the dataset grows. section 6.2
Carnival attractions
For six attractions, one optimal visiting sequence is swings, Ferris wheel, circus, carousel, balloons, and bumper cars. With 15 attractions, the possibilities increase substantially; with 48, brute-force evaluation can take tens of hours. section 6.2
Figure 6.6 Distances between attractions and an optimal path
Use the diagram to compare path distances and see which complete attraction route is identified as optimal. section 6.2
