UNIT I Informed Search
UNIT I Informed Search
Outline
• Greedy best-first search
• A* search
• Memory-bound search
• Bidirectional heuristic search
• Heuristics
Review: Tree search
• A search strategy is defined by picking the
order of node expansion
•
Best-first search
• Idea: use an evaluation function f(n) for each node
– estimate of "desirability“
– Expand most desirable unexpanded node
• Implementation:
Order the nodes in fringe in decreasing order of
desirability
• Special cases:
– greedy best-first search
– A* search
•
Romania with step costs in km
Greedy best-first search
• Evaluation function f(n) = h(n) (heuristic) =
estimate of cost from n to goal
Underestimated
(1+3)B (1+4)C (1+5)D
(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.
Search contours
• A useful way to visualize a search is to draw contours in the state space, just like the
contours in a topographic map. Inside the contour labeled 400, all nodes have
Monotonicity
• A heuristic function h is monotone if
states Xi and Xj such that Xj is successor of
Xi
h(Xi)– h(Xj) ≤ cost (Xi, Xj)
where, cost (Xi, Xj) actual cost of going from Xi to Xj
– h (goal) = 0
Inadmissible heuristics
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.
• RBFS replaces the f-value of each node along the path with a
backed-up value—the best f-value of its children.
Stages in an RBFS search for the shortest route to Bucharest. The f-limit value for each
recursive call is shown on top of each current node, and every node is labeled with its -
cost. (a) The path via Rimnicu Vilcea is followed until the current best leaf (Pitesti) has
a value that is worse than the best alternative path (Fagaras). (b) The recursion unwinds
and the best leaf value of the forgotten subtree (417) is backed up to Rimnicu Vilcea;
then Fagaras is expanded, revealing a best leaf value of 450.
(c) The recursion unwinds and the best leaf value of the forgotten subtree
(450) is backed up to Fagaras; then Rimnicu Vilcea is expanded. This time,
because the best alternative path (through Timisoara) costs at least 447,
the expansion continues to Bucharest.
• RBFS is somewhat more efficient than IDA*, but still suffers from
excessive node regeneration.
• RBFS retains more information in memory, but it uses only linear space:
even if more memory were available, RBFS has no way to make use of it.
Because they forget most of what they have done.
• both algorithms may end up reexploring the same states many times over.
MA* (memory-bounded A*) and
SMA* (simplified MA*)
• SMA* proceeds just like A*, expanding the best leaf
until memory is full.
• At this point, it cannot add a new node to the search
tree without dropping an old one.
• SMA* always drops the worst leaf node—the one
with the highest f-value.
• Like RBFS, SMA* then backs up the value of the
forgotten node to its parent.
• SMA* is a fairly robust choice for finding optimal solutions, particularly
when the state space is a graph, action costs are not uniform, and node
generation is expensive compared to the overhead of maintaining the
frontier and the reached set.
Bidirectional heuristic search
• Nodes going in the forward direction (with the initial state
as root)
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.
•
•A better estimate function is to be thought.
h2 (X) = the sum of the distances of the tiles
from their goal position in a given state X
• Initial node has h2(initial_node) = 3+1+2+2+2+3+3+2 = 18
Admissible heuristics
E.g., for the 8-puzzle:
• h1(n) = number of misplaced tiles
• h2(n) = total Manhattan distance
(i.e., no. of squares from desired location of each tile)
• h1(S) = ? 8
• h2(S) = ? 3+1+2+2+2+3+3+2 = 18
•
Effect of heuristic accuracy on performance