Search and planning
Search formulation, BFS and UCS, A* with admissible heuristics, STRIPS/PDDL and links to LM planning.
From agents to search
A goal-based agent is told which states it wants. When the world is fully observable, deterministic and known, it can invent action sequences with its model, find one that reaches a goal, and then execute with eyes closed. Finding that sequence is search.
Formulating a search problem
A search problem has five parts: states and initial ; a goal test; Actions; Result; step costs . A solution is a path to a goal; an optimal one has cost . In the 8-puzzle the reachable component has states. Formulation is abstraction: leave out what does not affect reachability of the goal.
A search keeps a frontier of reached-but-unexpanded nodes and expands one at a time. Graph search also remembers the cheapest path to each reached state.
Breadth-first and uniform-cost
Breadth-first search expands the shallowest node. With equal step costs the shallowest goal is optimal; memory is . With unequal costs it need not be optimal.
Uniform-cost search expands least (Dijkstra). Test the goal when a node is expanded, not generated. With the first expanded goal is optimal. UCS is blind: it spreads in every direction in order of cost.
A* and admissible heuristics
Key idea. Expand the node with smallest . If never overestimates remaining cost, the first expanded goal is optimal, and a better expands fewer nodes.
is admissible if and . It is consistent if . Consistency implies admissibility; for graph search it makes nondecreasing along paths, so each node expands with best , and the first goal has cost . Tree search needs only admissibility.
On a grid with walls, Manhattan distance is consistent: UCS expanded cells, A* , same path length . Weighted A* with saves more work but guarantees only cost .
Heuristics and STRIPS/PDDL
Good heuristics are exact costs of relaxed problems (e.g. ignore walls → Manhattan). If admissible everywhere, dominates and A* never expands a node that would skip (up to ties).
STRIPS/PDDL factored states as sets of facts and actions as preconditions, add and delete lists: Result. Ignoring deletes yields planning heuristics. The Sussman anomaly needs a whole-state search: C to table, B onto C, A onto B.
LM planners and next
Language models often emit invalid plans in one pass. Reuse the pieces: LLM+P lets the model write PDDL and a planner search; Tree of Thoughts uses the model as successor and heuristic inside BFS/DFS; LLM-Modulo pairs a proposer with an external verifier.
Search assumed one known outcome per action. When outcomes are random, the object to compute is a policy — next: Markov decision processes.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Go deeper — optional
Code and labs do not count toward the main percentage or the certificate.
- BFS shortest path on a gridoptional
NumPy/queue: find shortest-path length and recover the route on a 5×5 grid with one obstacle.
~20 min · easier on a computer · The matching course topic has been read.
Self-check in the notebook — not part of mastery or the certificate.
Answers are saved on the server and tied to this browser until you sign in.