Heuristic Algorithm Lecture
Heuristic Algorithm Lecture
Search Strategies
Lec#4
• Heuristic Search: Tries to optimize a problem using heuristic
function.
• Optimization: Tries to solve a problem in minimum number of steps or cost.
• Heuristic Function: It is a function H(n), that given as estimation on
the cost of getting from node ‘n’ to the GOAL state.
• ADVANTAGE: It helps in selecting optimal node for expansion.
• Consider every cost for reaching goal state.
Working of Heuristic Search Algorithm:
• It expands nodes based on their heuristic value h(n).
• It maintains two lists, OPEN and CLOSED list.
• In the CLOSED list, it places those nodes which have already expanded and
• in the OPEN list, it places nodes which have yet not been expanded.
• On each iteration, each node n with the lowest heuristic value is
expanded and generates all its successors and n is placed to the
closed list.
• The algorithm continues unit a goal state is found.
Types of Heuristic approaches
Admissible Non-admissible
• Never overestimates the cost of • Overestimate the path cost
reaching the goal.
h(n) > h*(n)
h(n) <= h*(n)
• Here h(n) is heuristic cost, and h*(n)
• Hence heuristic cost should be
is the estimated cost. Hence heuristic greater than estimated cost.
cost should be less than or equal to the
estimated cost.
• It underestimates the path cost.
Best First Search
• Category of Informed or Heuristic Algorithm:
Search
• Tries to expand the node that is
closest to the goal which leads to a
solution quickly.
• Thus, it evaluates nodes by using
just the heuristic function; that is,
f(n) = h(n)
• Also called Greedy Best First Search
Algorithm
• Here, Straight Line distance method is used by
Best first search to reach A to G.
• These values are already provided since you
cannot determine it here from figure in x-y
coordinate system.
• These distances are considered as heuristic
values.
• A to B = cost 11. It is not a heuristic values
• We will only consider heuristic values in Best first
search
1. B,C and D are connected to A
7. Final Path