Professional Documents
Culture Documents
Lecture07 Search Uninformed
Lecture07 Search Uninformed
Lecture07 Search Uninformed
searching
Course Teacher: Moona
Kanwal
09/04/15
Outline
Well-defined Problems
Solutions (as a sequence of actions).
Examples
Search Trees
Uninformed Search Algorithms
09/04/15
Recall:Problem-Solving
09/04/15
Recall:
Well Defined Problems
A problem is defined by four items:
2.
initial state
actions or successor function S(x) = set of
3.
1.
actionstate pairs
state
09/04/15
State-Space
An Initial State, s0 S.
A Set of Operators (or Actions), {Ai|i = 1, 2, . . }
09/04/15
Solutions
09/04/15
09/04/15
Example: Romania
Formulate problem:
be in Bucharest
states: various cities
actions: drive between cities
Find solution:
09/04/15
Example: Romania
09/04/15
09/04/15
10
09/04/15
11
09/04/15
12
09/04/15
13
09/04/15
14
09/04/15
15
Basic idea:
offline, simulated exploration of state
space by generating successors of alreadyexplored states (a.k.a.expanding states)
09/04/15
16
09/04/15
17
09/04/15
18
09/04/15
19
09/04/15
20
09/04/15
21
09/04/15
22
Search strategies
Time and space complexity are measured in
terms of
b: maximum branching factor of the
search tree
d: depth of the least-cost solution
m: maximum depth of the state space
(may be )
09/04/15
23
09/04/15
24
09/04/15
25
Breadth-first search
Implementation:
09/04/15
26
Breadth-first search
Implementation:
09/04/15
27
Breadth-first search
09/04/15
28
Breadth-first search
09/04/15
29
09/04/15
30
09/04/15
31
09/04/15
32
09/04/15
33
09/04/15
34
09/04/15
35
09/04/15
36
09/04/15
37
09/04/15
38
09/04/15
39
09/04/15
40
09/04/15
41
09/04/15
42
09/04/15
43
Properties of breadth-first
search
09/04/15
44
Uniform-cost search
09/04/15
45
09/04/15
46
09/04/15
47
09/04/15
48
09/04/15
49
09/04/15
50
09/04/15
51
09/04/15
52
09/04/15
53
09/04/15
54
09/04/15
55
09/04/15
56
09/04/15
57
09/04/15
58
09/04/15
59
09/04/15
60
09/04/15
61
09/04/15
62
09/04/15
63
09/04/15
64
09/04/15
65
09/04/15
66
09/04/15
67
09/04/15
68
09/04/15
69
Depth-first search
09/04/15
70
Depth-first search
09/04/15
71
Depth-first search
09/04/15
72
Depth-first search
09/04/15
73
Depth-first search
09/04/15
74
Depth-first search
09/04/15
75
Depth-first search
09/04/15
76
Depth-first search
09/04/15
77
Depth-first search
09/04/15
78
Depth-first search
09/04/15
79
Depth-first search
09/04/15
80
Depth-first search
09/04/15
81
09/04/15
82
09/04/15
83
09/04/15
84
09/04/15
85
09/04/15
86
09/04/15
87
09/04/15
88
09/04/15
89
09/04/15
90
09/04/15
91
09/04/15
92
09/04/15
93
09/04/15
94
Depth-limited search
= depth-first search with depth limit l,
i.e., nodes at depth l have no successors
Recursive implementation:
09/04/15
95
09/04/15
96
09/04/15
97
09/04/15
98
09/04/15
99
09/04/15
100
For b = 10, d = 5,
NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 =
111,111
NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 =
123,456
09/04/15
101
Properties of iterative
deepening search
Complete? Yes
bd = O(bd)
Space? O(bd)
Optimal? Yes, if step cost = 1
09/04/15
102
Summary of algorithms
09/04/15
103
Repeated states
09/04/15
104
Graph search
09/04/15
105
Summary
09/04/15
106