0% found this document useful (0 votes)
4 views

Class-3_Problem Solving agent

Uploaded by

22r11a05t5
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Class-3_Problem Solving agent

Uploaded by

22r11a05t5
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

problem-solving agent

problem-solving agent:
• It is one kind of Goal based agent

• Problem-solving agents use atomic representations, that


is, states of the world are considered as wholes, with no
internal structure visible to the problem solving
algorithms.

• Goal-based agents that use more advanced factored or


structured representations are usually called planning
agents
• Goals help organize behavior by limiting the objectives
that the agent is trying to achieve and hence the actions
it needs to consider.

• Goal formulation, based on the current situation and


the agent’s performance measure, is the first step in
problem solving.

• Problem formulation is the process of deciding what


actions and states to consider, given a goal.
A problem can be defined formally by five components:
1. Initial state
2. Actions
3. transition model
4. goal test
5. path cost

Initial state: The initial state that the agent starts in.

Actions: A description of the possible actions available to


the agent.
Transition model: A description of what each action do,
can be represented as a transition. the transition model,
specified by a function RESULT(s,a) that returns the state
that results from doing action a in state s. We also use the
term successor to refer to any state reachable from a given
state by a single action.
state space of the problem—the set of all states reachable
from the initial state by any sequence of actions.
The state space forms a directed network or graph in
which the nodes are states and the links between nodes are
actions.
A path in the state space is a sequence of states connected
by a sequence of actions.
Goal test: It is a function which observe the current state
and returns whether the goal state is achieved or not.

Path Cost: It is a function which assigns a numeric cost to


each path.
RESULT(In(Arad),Go(Zerind)) = In(Zerind)
Transition model

nitial state Actions


{Go(Sibiu),Go(Timisoara),Go(Zerind)}

Pathcost

Goal
A simple problem-solving agent. It first formulates a goal and a problem, searches
for a sequence of actions that would solve the problem and then executes the actions
one at a time. When this is complete, it formulates another goal and starts over.
a problem can be gathered into a single data structure that is
given as input to a problem-solving algorithm. 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.
Ex: vacuum world
• 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 8 possible world 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
Ex: The goal of the 8-queens problem is to place eight
queens on a chessboard such that no queen attacks any
other.
States: Any arrangement of 0 to 8 queens on the board is a
state.
Initial state: No queens on the board.
Actions: Add a queen to any empty square.
Transition model: Returns the board with a queen added
to the specified square.
Goal test: 8 queens are on the board, none attacked.
Example: Solve the given problem using Breadth-first
search approach. Here
• States: A state description specifies 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. Note that any given goal can be reached from
exactly half of the possible initial states.

• Actions: The simplest formulation defines the actions as


movements of the blank space Left, Right, Up or Down.
Different subsets of these are possible depending on
where the blank is.
• Transition model: Given a state and action, this returns
the resulting state.

• Goal test: This 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.

You might also like