Professional Documents
Culture Documents
Chapter 3
Problem Solving using Search
Goal
1 2 3
4
8
1 2 3
4 5 6
7 8
7 6 5
Example: N Queens
4 Queens problem
(Place queens such that no queen attacks any other)
Example: N Queens
4 Queens
Successor function
N, 1.0
E, 1.0
Start state
Goal test
Search Trees
N, 1.0
E, 1.0
A search tree:
Root = Start state
Children = successor states
Edges = actions and costs
Path from Start to a node is a plan to get to that state
For most problems, we can never actually build the
whole tree (why?)
a
c
d
S
h
p
a
c
h
p
S
e
Search Tree
a h
p q
q
p q
c G
a
11
12
Search:
Expand out possible nodes
Maintain a fringe of as yet unexpanded nodes
Try to expand as few tree nodes as possible
14
15
GOAL
expand
expand
17
18
19
20
10
21
22
11
23
24
12
25
26
13
27
28
14
O(bC
O(bC
/ 1
/ 1
29
30
15
31
32
16
33
34
17
35
36
18
37
38
19
39
40
20
41
42
21
43
44
22
45
46
23
47
48
24
49
50
25
51
52
26
53
54
27
55
56
28
57
29
Bidirectional Search
59
Can we do better?
All these methods are slow (because they are blind)
Solution
use problem-specific knowledge to
guide search (heuristic function)
informed search (next lecture)
To Do
Start Project #1
Read Chapter 3
60
30