Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

3.1problem Solving Agent

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 38

Vidya Vikas Education Trust’s

Universal College of Engineering, Vasai(E)

AI
CH:03
Solving Problems by Searching
• Definition,
• State space representation,
• Problem as a state space search,
• Problem formulation,
• Well-defined problems
• Solving Problems by Searching,
• Performance evaluation of search strategies,
• Time Complexity, Space Complexity, Completeness,
Optimality
The reflex agents are known as the simplest agents because they
directly map states into actions.
Unfortunately, these agents fail to operate in an environment
where the mapping is too large to store and learn.
Goal-based agent, on the other hand, considers future actions
and the desired outcomes.

Here, we will discuss one type of goal-based agent known as a


problem-solving agent, which uses atomic representation with no
internal states visible to the problem-solving algorithms.
Problem-solving agent
• The problem-solving agent performs precisely by defining
problems and its several solutions.
• A problem-solving refers to a state where we wish to reach
to a definite goal from a present state or condition
• Problem solving is mostly based on searching.

.”
Steps performed by Problem-solving agent

1. Goal Formulation:
• It is the first and simplest step in problem-
solving.
• It organizes the steps/sequence required to
formulate one goal out of multiple goals as well
as actions to achieve that goal.
• Goal formulation is based on the current
situation and the agent’s performance measure.
2. Problem Formulation:

It is the most important step of problem-solving


which decides what actions should be taken to
achieve the formulated goal.
There are following five components involved in
problem formulation:
1. Initial State: It is the starting state or initial step
of the agent towards its goal.
2. Actions: It is the description of the possible
actions available to the agent.
3. Transition Model: It describes what each action
does.
4. Goal Test: It determines if the given state is a
goal state.
5. Path cost: It assigns a numeric cost to each
path that follows the goal.
The problem-solving agent selects a cost
function, which reflects its performance
measure.
Remember, an optimal solution has the lowest
path cost among all the solutions.
State space search
• Important in AI is problem solving
• Earlier days AI focus games
• Set of state in which problem can be.
State space search
• It is a method used for searching path from start
state to goal state while solving a problem.
• Initial state, actions, and transition model together
define the state-space of the problem implicitly.
• State-space of a problem is a set of all states which
can be reached from the initial state followed by any
sequence of actions.
• The state-space forms a directed map or graph
where nodes are the states, links between the nodes
are actions, and the path is a sequence of states
connected by the sequence of actions
• When we don't have an algorithm which tells us definitively
how to negotiate the state-space we need to search the state-
space to find an optimal path from a start state to a goal state.

•We can only decide what to do (or where to go), by considering


the possible moves from the current state, and trying to look
ahead as far as possible.
Search: It identifies all the best possible sequence of
actions to reach the goal state from the current state.
It takes a problem as an input and returns solution as
its output.
Solution: It finds the best algorithm out of various
algorithms, which may be proven as the best optimal
solution.
Execution: It executes the best optimal solution from
the searching algorithms to reach the goal state from
the current state.
Example Problems
Toy Problem: It is a concise and exact description
of the problem which is used by the researchers
to compare the performance of algorithms.

Real-world Problem: It is real-world based


problems which require solutions. Unlike a toy
problem, it does not depend on descriptions,
but we can have a general formulation of the
problem.
8 Puzzle Problem
• Here, we have a 3×3 matrix with movable tiles
numbered from 1 to 8 with a blank space.
• The tile adjacent to the blank space can slide
into that space.
• The objective is to reach a specified goal state
similar to the goal state, as shown in the below
figure.
• In the figure, our task is to convert the current
state into goal state by sliding digits into the
blank space.
The problem formulation is as follows:
● States: It describes the location of each numbered tiles and the blank

tile.
● Initial State: We can start from any state as the initial state.

● Actions: Here, actions of the blank space is defined, i.e., either left,

right, up or down
● Transition Model: It returns the resulting state as per the given state

and actions.
● Goal test: It identifies whether we have reached the correct goal-state.

● Path cost: The path cost is the number of steps in the path where the

cost of each step is 1.


States: Locations of tiles
Initial state: Any state
Actions: Move blank left,right, up, down
Goal state: Goal State (Given)
Path Cost: 1 per move
8-queens problem:
• The aim of this problem is to place eight
queens on a chessboard in an order where no
queen may attack another.
• A queen can attack other queens either
diagonally or in same row and column.
States: Arrangement of any 0 to 8 queens on the
chessboard.
Initial State: An empty chessboard
Actions: Add a queen to any empty box.
Transition model: Returns the chessboard with the
queen added in a box.
Goal test: Checks whether 8-queens are placed on
the chessboard without any attack.
Path cost: There is no need for path cost because
only final states are counted.
State Space
Initial State
Final State
Actions
Path Cost
The state space for this problem can be described as the set of ordered pairs of
integers (X, Y) such that X = 0, 1, 2, 3 or 4 and Y = 0, 1, 2 or 3; X is the number of
gallons of water in the 4-gallon jug and Y the quantity of water in the 3-gallon jug.

The start state is (0, 0) and the goal state is (2, n) for any value of n, as the problem
does not specify how many gallons need to be filled in the 3-gallon jug (0, 1, 2, 3). So
the problem has one initial state and many goal states. Some problems may have
many initial states and one or many goal states.
Some Real-world problems

Traveling salesperson problem(TSP): It is a


touring problem where the salesman can visit
each city only once. The objective is to find the
shortest tour and sell-out the stuff in each city.
state space: Initial state( starts 1)
(1-2, 1-4,1-3)
Possible routes:
1-2-4-3-1= 10+ 1-4-2-3-1=
1-2-3-4-1= 1-4-3-2-1=
1-3-4-2-1=
1-3-2-4-1=
VLSI Layout problem:

In this problem, millions of components and


connections are positioned on a chip in order to
minimize the area, circuit-delays, stray-
capacitances, and maximizing the manufacturing
yield.
Robot navigation:

Automatic assembly sequencing:


In assembly problems, the aim is to find an order in
which to assemble the parts of some object.
If the wrong order is chosen, there will be no way to
add some part later in the sequence without
undoing some of the work already done.
Thank you !

39

You might also like