Solving Problems by Searching
Solving Problems by Searching
Solving Problems by Searching
• State space – initialstate, actions, transition model together form a graph (nodes:
states, link:actions, path: sequence of states connected by a sequence of actions
Solution
• A solution to a problem is an action sequence that leads from the
initial state to a goal state.
• Solution quality is measured by the path cost function,
• optimal solution has the lowest path cost among all solutions
Problem formulation
• Toy problem – exact descriptions, compare the performance of
various algorithms
• Real world problem – no single exact definition, can have general
flavour of their formulation
Vacuum Cleaner
Vacuum Cleaner
• States: The state is determined by both the agent location and the dirt locations. The
agent is in one of two locations, each of which might or might not contain dirt.
• Thus,there are 2 × 22 = 8 possible world states.
• A larger environment with n locations has n * 2n states.
• Initial state: Any state can be designated as the initial state.
• Actions: In this simple environment, each state has just three actions: Left, Right, and
Suck. Larger environments might also include Up and Down.
• Transition model: The actions have their expected effects, except that moving Left in
the leftmost square, moving Right in the rightmost square, and Sucking in a clean square
have no effect.
• Goal test: This checks whether all the squares are clean.
• Path cost: Each step costs 1, so the path cost is the number of steps in the path.
States: A state description specifies the location of each
• Path cost: This depends on monetary cost, waiting time, flight time, customs and
immigration procedures, seat quality, time of day, type of airplane, frequent-flyer mileage
awards, and so on.