Can you solve the classic AI planning puzzle? Help the monkey reach the bananas ā or let search algorithms find the optimal path.
A monkey must plan actions to reach bananas hanging from the ceiling using a box as a tool.
Starts at A, height Low. Can walk, push the box, climb it, and grasp.
Hanging at location B, height High. Cannot be moved ā monkey must come to them.
At location C, height Low. Monkey can push it anywhere and climb on top.
Monkey on box at B, height High, banana grasped: (B,High,B,T)
(A, Low, C, false)(B, High, B, true)3 Ć 2 Ć 3 Ć 2 = 36Solve manually, watch AI algorithms solve it, or compare all six algorithms side by side.
Run all 6 algorithms simultaneously and compare nodes explored, optimality, and efficiency. Complete the manual puzzle first to include your own score!
The 4-step optimal path found by A* and BFS.
| Step | Action | Monkey | Height | Box | Banana? |
|---|---|---|---|---|---|
| 0 | Initial | A | Low | C | No |
| 1 | Walk(AāC) | C | Low | C | No |
| 2 | Push(CāB) | B | Low | B | No |
| 3 | Climb | B | High | B | No |
| 4 | Grasp | B | High | B | Yes ā |
Each action has preconditions and effects on the state.
at(X) Height=Lowat(X) Box at X Height=Lowat(X) Box at X Height=Lowat(B) Height=High Banana at BPurple path = optimal solution. Dashed = pruned (already visited). Green = goal.
Six search strategies compared ā each with different tradeoffs in optimality, completeness, and efficiency.
Four AI paradigms that can represent and solve this problem.
Represents the world as states (4-tuples) and operators as transitions. Graph search algorithms (BFS, A*) find a path from initial to goal state.
Uses IF-THEN rules (productions). A recognize-act cycle matches preconditions against working memory and fires the best rule.
The standard for classical AI planning. Defines domain (predicates, operators with pre/effects) and problem (objects, init, goal).
Identifies difference between current and goal state, selects operator to reduce that difference. Recursively sets subgoals.