AISC-L4-L5-Problem Solving Agents - Uninformed Search
AISC-L4-L5-Problem Solving Agents - Uninformed Search
AGENTS
TAKEN FROM RUSSELS AND NORWIG
RESOURCES
w, c
F, G
F, W, C
G
C w
F, W, G F, G, C
F, G, C F, W, G
w C
G
F, W, C
F, G
w, c
F, W, G, C
The Farmer-Wolf-Goat-Cabbage riddle
• States: F, W, G and C are in Left or Right bank
(FWGC - Φ) start state
(Φ - FWGC ) end state
(WC – FG) intermediate state
L R
L R
7
0 0 QJ 0 0
0 0 0 0 0
0 0 QJ 0 0
··,tart ,tate o:a.l .t:ate
• PARENT NODE: the node I the search tree that generated this node
• ACTION: the action that was applied to the parent node to generate
this node
• PATH COST: the path from initial state to the node g(n)
• DEPTH: the number of steps along the path from the initial state
• FRINGE: collection of nodes that have been generated but not yet
expanded. Each element of fringe is a leaf node
Evaluating Search strategies
• Completeness: Is the strategy guaranteed to find a
solution if one exists?
if ode is a g:oal
then Ieturn the path :fi~on1 initial state to ode
1
Loop
1
E·ndLoop
Depth-First Iterative Deepening (DFID)
• First do DFS to depth 0 (i.e., treat start node as having no
successors), then, if no solution
found, do DFS to depth 1, etc
DFID
until soluti,o,n f oun,d do,
DFS with depth c·u toff c
,c = c+l
Advantage
• Linear memory requirements of depth-first
search
• Guarantee for goal node of minimal depth
Successive depth-first searches are conducted
– each with depth bounds increasing by 1
States examined by
forward search only
States examined by
combination of
forward and
Goal backward search
Properties of Bidirectional Search
• The algorithm works well only when there are unique start and
goal states.
Time bd bd bd bd/2
Space bd bm bd bd/2
Optimum? Yes No Yes Yes
Complete? Yes No Yes Yes
Activity Time (5 mins)
Give the initial state, goal test, successor function, and cost
function for the following.
S0 = <3, 3, L>
G = < 0, 0, R >
Activity Time (10 mins)
Suppose you have the following search space:
a) Draw the state space of this problem.
tat@ nre .t co.st
b) Assume that the initial state is A and
A H 4
the goal state is G.
A C l
H'
. D ], Show how each of the following search
H :E I strategies would create a search tree to
C C 0 find a path from the initial state to the
goal state:
C D l
• Breadth-first search
C :F
' • Depth-first search
D C l
• Uniform cost search
D :E 4 • Iterative deepening search
:E G' l
• •
33
Any Questions?