Search Problem Formulation

Context: FIT1061_MOC Β· Block A’s shared vocabulary (AI Algorithm Blocks (Search, Uncertainty, Learning)) β€” every W2–W5 algorithm inherits this structure and differs only in strategy

Quick Revision

  • 🎯 Objective: name states Β· actions Β· successor Β· goal test βž” any puzzle, route or game collapses to a Graph one algorithm can search.
  • ⚠️ Key Constraint: the tree is never built βž” states are generated on demand, because makes storage impossible past trivial depth.

πŸ“ Core

  • States βž” configurations of the world β€” a board position, a grid cell, a road intersection.
  • Actions βž” legal transitions out of a state β€” a legal chess move, a tile slide, driving one edge.
  • Successor function βž” which state lands in; the only operation an algorithm needs is given a node, return its neighbours.
  • Goal test βž” predicate deciding β€œdone” β€” checkmate? tiles sorted? at ?
  • Path cost βž” price of the route taken; uniform per step this week β€” edge weights and arrive with weighted search.
  • Game tree βž” node state, edge action, root start position, leaf state with no move left (someone wins, or the board is full).
  • Branching factor βž” actions available per state βž” depth- level holds states.
  • Grids are graphs βž” each walkable cell is a node, each edge a step to a -neighbour; walls are simply nodes that do not exist. Direction is irrelevant β€” the graph is undirected.

Three instantiations

ProblemStatesActionsGoal testCost
8-puzzle tile configurationsslide blank up/down/left/righttiles in sorted order? per slide
GPS routingintersections –drive along an edgeat ?edge travel time
Chessboard positionslegal moves ()checkmate? per move

Why the tree explodes

DepthTic-tac-toe (shrinking )Chess ()
full / (whole game)
  • Solved vs unsearchable βž” at ops/s all tic-tac-toe leaves take s β€” tic-tac-toe is solved; takes years, and a real game runs moves deep.
  • Consequence βž” exhaustive checking is off the table βž” every later algorithm is a rule for deciding what to explore first.

⚠️ Common Mistakes

  • πŸ’‘ Formulating the algorithm, not the problem βž” β€œuse BFS” earns nothing; marks come from naming states, actions and goal test for this domain.
  • πŸ’‘ Reading as the tree size βž” is the count at one depth; the tree to depth is , dominated by the last layer.
  • πŸ’‘ Assuming constant βž” tic-tac-toe’s branching shrinks (); is an average, and the chess figure is an estimate.

🧠 Active Recall