Ai 2
Ai 2
Agents
Search
fl
What if environment is partially observable…?
• A solution is a sequence of actions (a plan/path) which transforms the start state to a goal state
Example: Travelling in Romania
Oradea
• State space: 71
Neamt
• Cities
Zerind 87
151
• Actions: 75
Iasi
• Go to adjacent city Arad
140
92
• Transition model Sibiu
99 Fagaras
118
• Result(A, Go(B)) = B 80
Vaslui
86
• Goal test: 75
120
138 Bucharest
Drobeta
• Is state == Bucharest? 90
Craiova Eforie
Giurgiu
• Find the optimal solution?
How to reach the destination…. Problem solving process
Oradea
71
Neamt
• Goal formulation Zerind 87
151
75
• Problem formulation Arad
140
Iasi
92
Sibiu
• Abstraction 118
99 Fagaras
Vaslui
80
• Search Timisoara
Rimnicu Vilcea
142
211
•
111
Execution Lugoj 97
Pitesti
70 98
Hirsova
• Evaluation and adjustments Mehadia 146 101 85
Urziceni
75 138 86
Bucharest
Drobeta 120
90
Craiova Eforie
Giurgiu
What’s in a State Space?
The real-world state includes every detail of the environment
A search state abstracts away details not needed to solve the problem
• How many
• World states?
120x(230)x(122)x4
• States for pathing?
120
• States for eat-all-dots?
120x(230)
State Space Graphs and Search Trees
State Space Graphs
Zerind 87
151
75
Iasi
Arad
140
92
Sibiu Fagaras
99
118
Vaslui
80
Rimnicu Vilcea
Timisoara
142
111 Pitesti 211
Lugoj 97
70 98
85 Hirsova
Mehadia 146 101 Urziceni
75 138 86
Bucharest
Drobeta 120
90
Craiova Eforie
Giurgiu
More Examples
R
L R
L
S S
R R
L R L R
L L
S S
S S
R
L R
S S
State Space Graphs vs. Search Trees
Consider this 4-state graph: How big is its search tree (from S)?
S
a
a b
S G
b G G a
b
G a b G
∞
Important: Lots of repeated structure in the search tree!
Understanding terminologies in Search Trees
• node.STATE
Oradea
• node.PARENT 71
Neamt
Zerind 87
151
• node.ACTION
75
Iasi
Arad
140
92
• node.PATH_COST
Sibiu Fagaras
99
118
Vaslui
80
• Child/successor node
Rimnicu Vilcea
Timisoara
142
111 Pitesti 211
Lugoj 97
• Frontier of search tree 70 98
Hirsova
Mehadia 146 101 85
Urziceni
90
• Exterior region of states Craiova Giurgiu
Eforie
• The frontier states separate the explored states from never seen states
• Frontier is sub-set of Explored, as loop progresses, number of explored states will be
more than the number of states in frontier
• Nodes that are not explored (Never Seen) are distinct from the other two
Understanding terminologies in Search Trees
• Loopy path — repeated state
Oradea
• Redundant path 71
Neamt
87
• Frontiers are organised using
Zerind 151
75
Iasi
queues Arad
140
92
Sibiu Fagaras
99
Rimnicu Vilcea
Timisoara
• LIFO queue 70
Mehadia 146 101 85
Urziceni
98
Hirsova
75 138 86
Bucharest
Drobeta 120
90
Craiova Eforie
Giurgiu
fi
Properties of a Search Algorithm
Zerind 87
151
75
Iasi
Arad
140
92
Sibiu Fagaras
99
118
Vaslui
80
Rimnicu Vilcea
Timisoara
142
111 Pitesti 211
Lugoj 97
70 98
85 Hirsova
Mehadia 146 101 Urziceni
75 138 86
Bucharest
Drobeta 120
90
Craiova Eforie
Giurgiu
Uninformed search algorithms are also known as blind search algorithms
• Complexity — O(bm)
ffi
fi
fi
Bidirectional search simultaneously searches forward and backward