CH 2 (C) - Problem Solving State-Space Search and Control Strategies
CH 2 (C) - Problem Solving State-Space Search and Control Strategies
C1
7 12 15 11
20
C2 10 13 C3
12 C4 17
5
C5
D(C1,C2) = 7; D(C1,C3) = 11; D(C1,C4) = 12; D(C1,C5) = 15; D(C2,C3) =20;
D(C2,C4) = 10; D(C2,C5) =12; D(C3,C4) =13; D(C3,C5) = 17; D(C4,C5) =5;
Paths explored. Assume C1 to be the start city Distance
and Stop
W=2
Underestimation
(2+2) E
(3+1)F
(4+0) G
Explanation –Example of
Overestimation
A is expanded to B, C and D.
Now B is expanded to E, E to F and F to G for a solution
path of length 4.
Consider a scenario when there a direct path from D to
G with a solution giving a path of length 2.
We will never find it because of overestimating h(D).
Thus, we may find some other worse solution without
ever expanding D.
So by overestimating h, we can not be guaranteed to
find the cheaper path solution.
Admissibility of A*
3 7 6 5 3 6
5 1 2 7 2
4 8 4 1 8
results.
Example: Eight puzzle problem
(EPP)
3 7 6 5 3 6
5 1 2 7 2
4 8 4 1 8
Evaluation function - f for
EPP
The choice of evaluation function critically
determines search results.
Consider Evaluation function
f (X) = g (X) + h(X)
h (X) = the number of tiles not in their goal
position in a given state X
g(X) = depth of node X in the search tree
For Initial node
f(initial_node) = 4
Apply A* algorithm to solve it.
Start State
Search Tree f = 0+4
3 7 6
5 1 2
4 8
up left right
(1+3) (1+5) (1+5)
3 7 6 3 7 6 3 7 6
5 2 5 1 2 5 1 2
4 1 8 4 8 4 8
up left right
(2+3) (2+3) (2+4)
3 6 3 7 6 3 7 6
5 7 2 5 2 5 2
4 1 8 4 1 8 4 1 8
left right
(3+2) (3+4)
3 6 3 6
5 7 2 5 7 2
4 1 8 4 1 8
down
(4+1)
5 3 6 right 5 3 6 Goal
7 2 7 2 State
4 1 8 4 1 8
Harder Problem
Harder problems (8 puzzle) can’t be solved by
heuristic function defined earlier.
Initial State Goal State
2 1 6 1 2 3
4 8 8 4
7 5 3 7 6 5
O O O O O
6 8 4 8 9
O O
O O O O O O
7 5 9 8 4 7
O O
O O O
O O O O O O Goal
8 9 4 4 8
Contd..
Given an admissible monotone cost function, IDA*
will find a solution of least cost or optimal solution if
one exists.
IDA* not only finds cheapest path to a solution but
uses far less space than A* and it expands
approximately the same number of nodes as A* in a
tree search.
An additional benefit of IDA* over A* is that it is
simpler to implement, as there are no open and
closed lists to be maintained.
A simple recursion performs DFS inside an outer
loop to handle iterations.