Artificial Intelligence: Uninformed Search
Artificial Intelligence: Uninformed Search
UNINFORMED SEARCH
ENG P KADEBU
Recap on Search
2
Is A a goal state?
Breadth-first search
Expand:
fringe = [B,C]
Is B a goal state?
7
Breadth-first search
8
Expand:
fringe=[C,D,E]
Is C a goal state?
Breadth-first search
9
Expand:
fringe=[D,E,F,G]
Is D a goal state?
Example
BFS
10
Practice BFS
11
Properties of breadth-first search
12
Is A a goal state?
Depth-first search
17
queue=[B,C]
Is B a goal state?
Depth-first search
18
queue=[D,E,C]
Is D = goal state?
Depth-first search
19
queue=[H,I,E,C]
Is H = goal state?
Depth-first search
20
queue=[I,E,C]
Is I = goal state?
Depth-first search
21
queue=[E,C]
Is E = goal state?
Depth-first search
22
queue=[J,K,C]
Is J = goal state?
Depth-first search
23
queue=[K,C]
Is K = goal state?
Depth-first search
24
queue=[C]
Is C = goal state?
Depth-first search
25
queue=[F,G]
Is F = goal state?
Depth-first search
26
queue=[L,M,G]
Is L = goal state?
Depth-first search
27
queue=[M,G]
Is M = goal state?
Example DFS
28
Properties of depth-first search
29
Complete? Yes
Time? (d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd)
Space? O(bd)
Optimal? Yes, if step cost = 1 or increasing function of
depth.
Example IDS
36
Bidirectional Search
37
Idea
simultaneously search forward from S and backwards from G
stop when both “meet in the middle”
need to keep track of the intersection of 2 open sets of nodes
What does searching backwards from G mean
need a way to specify the predecessors of G
this can be difficult,
e.g., predecessors of checkmate in chess?
what if there are multiple goal states?
what if there is only a goal test, no explicit list?
Bi-Directional Search
38
C C S B S
State Space
Example of a Search Tree
Method 1 suboptimal but practical
do not create paths containing cycles (loops)
Method 2 optimal but memory inefficient
never generate a state generated before
must keep track of all possible states (uses a lot of memory)
e.g., 8-puzzle problem, we have 9! = 362,880 states
Summary
43