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

AIML Lec-3

Uploaded by

shubhodippal01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

AIML Lec-3

Uploaded by

shubhodippal01
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Artificial Intelligence

& Machine Learning


Dr. Sankhadeep Chatterjee
Department of Computer Science & Technology, UEMK
State Space Search

 A state is defined by the specification of the


values of all attributes of interest in the world
 An operator changes one state into the
other;
 it has a precondition which is the value of
certain attributes prior to the application of
the operator
 a set of effects, which are the attributes
altered by the operator
State Space Search contd.
 Example –
 If signal turns Red → Stop Car
 If signal turns Yellow → Drive Slow
 If Green → Safe to drive
 A goal directed agent needs to achieve certain
goals.
 Such an agent selects its actions based on the
goal it has.
 Each state is an abstract representation of the
agent's environment.
State Space Search contd.
 An action/ operator takes the agent from one state
to another state.
 A plan is a sequence of actions.
 A goal is a description of a set of desirable states of
the world. Goal states are often specified by a goal
test which any goal state must satisfy.
 An initial state is the description of the starting
configuration of the agent
State Space Search contd.

 Problem formulation means choosing a


relevant set of states to consider, and a feasible
set of operators for moving from one state to
another.

 Search is the process of considering various


possible sequences of operators applied to the
initial state, and finding out a sequence which
culminates in a goal state.
State Space Search contd.

Start State

Goal
States
State Space Search contd.

 A search problem consists of the following:


 S: the full set of states
 s0 : the initial state
 A:S → S is a set of operators
 G is the set of final states. Note that G S
State Space Search contd.

 Representation of search problems –


 A search problem is represented using a
directed graph.
 The states are represented as nodes.
 The allowed actions are represented as arcs.
State Space Search contd.

Start State

Goal
States
State Space Search contd.

 The search problem is to find a sequence of


actions which transforms the agent from the
initial state to a goal state g G.

 P = {a0, a1, … , aN} which leads to traversing


a number of states {s0, s1, … , sN+1 G}. A
sequence of states is called a path.
State Space Search Example

 Water Jug Problem –


 You are given two jugs, a 4-gallon one and a
3-gallon one,
 a pump which has unlimited water which you
can use to fill the jug, and the ground on
which water may be poured.
 Neither jug has any measuring markings on
it. How can you get exactly 2 gallons of water
in the 4-gallon jug?
State Space Search contd.

 We will represent a state of the problem as a


tuple (x, y) where x represents the amount
of water in the 4-gallon jug and y represents
the amount of water in the 3-gallon jug.
 Note 0 < x < 4, and 0 < y < 3.

 Example:
 Our initial state: (0,0)
 Goal state = (2,y) where 0 < y < 3.
State Space Search Example
No. Rule Condition Next State

1 Fill 4-gal jug (x, y) , x < 4 (4,y)

2 Fill 3-gal jug (x, y) , y < 3 (x, 3)

3 Empty 4-gal jug on ground (x, y) , x > 0 (0, y)

4 Empty 3-gal jug on ground (x, y) , y > 0 (x, 0)


Pour water from 3-gal jug to fill
5 (x, y) , x+y ≥ 4, x, y > 0 (4 , (y – (4 – x))
4-gal jug
Pour water from 4-gal jug to fill
6 (x, y) , x+y ≥ 3, x > 0 (x – (3 – y) , 3)
3-gal jug
Pour all of water from 3-gal jug (x, y) , 0 < x+y ≤ 4 and y
7 (x+y, 0)
into 4-gal jug ≥ 0
Pour all of water from 4-gal jug (x, y) , 0 < x+y ≤ 3 and x
8 (0, x+y)
into 3-gal jug ≥0
State Space Search Example
Water (in Gallon) in 4- Water (in Gallon) in 3-
Rule Applied
Gallon Jug Gallon Jug

0 0 1

4 0 6

1 3 4

1 0 8

0 1 1

4 1 6

2 3
State Space Search contd.

 Uninformed search
 Depth first search
 Breadth first search
 Iterative deepening search

 Informed Search
 Constraint Satisfaction Search

 Adversarial Search
Thank You

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy