Beruflich Dokumente
Kultur Dokumente
2. Problem formulation
3. Search algorithm
4. Execution
initial state
actions or successor function
goal test (explicit or implicit)
path cost ( c(x,a,y) sum of step costs)
Analysis
b = branching factor
d = depth
m = maximum depth
n
h(n)
S
5.8
A
3
B
2.2
C
2
G
0
Breadth-first search
Uniform-cost search
Depth-first search
Depth-limited search
Iterative deepening search
Complete?
No: fails in infinite-depth spaces, spaces with
loops
Modify to avoid repeated states along path
complete in finite spaces
Time?
O(bm): terrible if m is much larger than d
Space?
Recursive implementation:
For b = 10, d = 5,
Complete?
Yes
Time?
Space?
O(bd)
Optimal?
Only if step cost = 1; otherwise NO
Implementation:
Order the nodes in the Open List (fringe) in
decreasing order of desirability
Special cases:
Complete?
No can get stuck in loops,
e.g., Iasi Neamt Iasi Neamt
Time?
O(bm), but a good heuristic can give
dramatic improvement
Space?
O(bm) -- keeps all nodes in memory
Optimal?
No
heuristic estimate
of cost from n to G
for a node, N,
N
Ng(N)
h(N)
heuristic function
(superscript)
path-cost function
(subscript)
If h is consistent, we have
f(n') = g(n') + h(n')
= g(n) + c(n,a,n') + h(n')
g(n) + h(n) = f(n)
i.e., f(n) is non-decreasing along any path.
Which node (use the nodes letter) will be expanded next by each
of the following search algorithms?
A
h=20
(a) Depth-first search
h=14 B
19
C
5
h=10
h=12
G
h=8
D
h=18
H
h=10
h=15
Search
DFS
BFS
Uniform
Cost
g(n)
Depth Iterative
Limited Deepening
BMA*
BestFS
f(n)
Greedy
f(n) =h(n)
A*
f(n)=g(n)+h(n)