Solving Problems by Searching
Solving Problems by Searching
3 4
5 6
8
7
• states??: discrete: dirt and robot locations (ignore dirt amounts etc.)
• actions??: Left, Right, Suck, NoOp
• goal test??: no dirt
• path cost??: 1 per action (0 for NoOp)
2/7/2016 CSE-345: Artificial Intelligence 15
Example: The 8-puzzle
The EXPAND function creates new nodes, filling in the various fields & using the
SUCCESSORFN of the problem to create the corresponding states.
2/7/2016 CSE-345: Artificial Intelligence 23
Implementation: General Tree Search
Is B a goal state?
Is C a goal state?
Is D a goal state?
Is B a goal state?
Is D = goal state?
Is H = goal state?
Is I = goal state?
Is E = goal state?
Is J = goal state?
Is K = goal state?
Is C = goal state?
A D Backwards
B D A E
C E E B B F
11
D F B F C E A C G
14 17 15 15 13
G C G F
19 19 17
G 25
2/7/2016 CSE-345: Artificial Intelligence 60
Evaluation of Search Strategies
A B C
3
15
7 20 5
D E G
A B C
3
15
7 20 5
D E G
A B C
3
15
7 20 5
D E G