4 - C Problem Solving Agents
4 - C Problem Solving Agents
Actions
A description of the possible actions available to the agent
Given a particular state s, ACTIONS(s) returns the set of actions that
can be executed in s.
Transition model
A description of what each action does - the transition model
Together, the initial state, actions, and transition model implicitly
define the state space of the problem
state space forms a directed network or graph
Goal test
determines whether a given state is a goal state.
Path cost
function that assigns a numeric cost to each path.
Problem Definition
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, and
an optimal solution has the lowest path cost among all
solutions.
Example Problems - 8-puzzle
9
8-puzzle
States: the location of each of the eight tiles and the blank in one of the
nine squares
Initial state: Any state can be designated as the initial state.
Actions: The simplest formulation defines the actions as movements of the
blank space Left, Right, Up, or Down.
Transition model: Given a state and action, this returns the resulting state;
for example, if apply Left to the start state, the resulting state has the 5 and the blank
switched.
Goal test: checks whether the state matches the goal configuration
Path cost: Each step costs 1, so the path cost is the number of steps in the
path
Example Problems - vacuum world
11
vacuum world
States: The state is determined by both the agent location and the dirt
locations.
Initial state: Any state can be designated as the initial state.
Actions: each state has just three actions: Left, Right, and Suck.
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.
• 8-queens problem
• route-finding problem
Searching for Solutions
A solution is an action sequence, so search algorithms work
by considering various possible action sequences.
The possible action sequences starting at the initial state
form a search tree with the initial state at the root;
the branches are actions and
the nodes correspond to states in the state space of the problem.
Steps in growing Search tree
root node of the tree corresponds to the initial state
to test whether this is a goal state
expanding the current state - generating a new set of states
The set of all leaf nodes available for expansion at any given point - the frontier
17