Professional Documents
Culture Documents
Start
State
Goal
State
Graph of Romania (Heuristic Function)
in Romania, one might estimate the cost of the cheapest path from
Arad to Bucharest via the straight-line distance from Arad to Bucharest.
Algorithms Of Heuristics
Search
Hill Climbing
• Expand current state and evaluate its
children
• The best child is selected for further
expansion
• Neither its sibling nor its parents are
retained
• Because it keeps no history, it can be
caught in local maxima
Best First Search
• Also called greedy best first search
• Uses the approach of hill climbing strategy
but maintain the record
• open: to maintain the current fringe of
search
• close: to record the stated already
visited
• It arranges the states in open list
according to some heuristic estimate of
their closeness towards the goal
• On each iteration algorithm considers the
most promising state on basis of
evaluation function f(n)
• Note in this algorithm f(n)=h(n)
Romania with step costs in km
12
Greedy best-first search
Evaluation function f(n) = h(n) (heuristic)
◦= estimate of cost from n to goal
e.g., hSLD(n) = straight-line distance from n to
Bucharest
Greedy best-first search expands the node
that appears to be closest to goal
13
Greedy best-first search example
Greedy best-first search example
15
Greedy best-first search example
16
Greedy best-first search example
17
Properties of greedy best-first search
18
Implementing Heuristic
Evaluation Function
• Consider the 8-puzzle game
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
h2(n): 1+2+1+1=5