Heuristic Search Strategies
Heuristic Search Strategies
Artificial Intelligence
Heuristic Search Strategies
Heuristic Search Techniques in AI
• Heuristic Search is also known as:
Informed Search
Heuristic Control Strategy
• These are effective if applied correctly to the right types of tasks.
• Usually demand domain-specific information.
• Extra information need to compute preference among child nodes to explore
and expand.
• Each node has a heuristic function associated with it.
What is a Heuristic Search?
b
𝑥
1 𝑦1 S G 𝑥 2 𝑦 2
4 5 6 6 5 4
7 8 8 7
Types of Heuristic Functions
• Admissible
This Function Never overestimate the cost of
reaching the goal
H(n) is always less than or equal to the actual A
cost of lowest path from N to Goal Node 1 1
• Non Admissible 1
5 3
2
H(F)=1 F G
Types of Heuristic Functions
• Admissible
This Function Never overestimate the cost of
reaching the goal
H(n) is always less than or equal to the actual cost
A
of lowest path from N to Goal Node
1 1
• Non Admissible 1
This Function overestimate the cost of reaching the H(B)=3 B C D
goal
H(n) is always greater than the actual cost of lowest 3 H(C)=4 H(D)=5
path from N to Goal Node
H(E)=2 E
• Pure heuristic search is the simplest form of heuristic search algorithms that
expands nodes based on their heuristic value h(n).
• It maintains two lists, OPEN and CLOSED list.
CLOSED list contains those nodes which have already expanded
OPEN list, contains those 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.
• In the pure heuristic search two main algorithms will discussed which are given
below:
Best First Search Algorithm
A* Search Algorithm
Best-first Search Algorithm (Greedy Search)
Path [A , C, F, G ]
Best-first Search Algorithm (Class Activity)
(Straight Line Distance)
Best-first Search Algorithm
• Time Complexity
The worst case time complexity of best first search is O(b d).
• Space Complexity
The worst case space complexity of best first search is O(b d).
Where, d is the maximum depth of the search space.
• Complete
Best-first search is also incomplete, even if the given state space is finite.
• Optimal
Best first search algorithm is not optimal.
Best-first Search Algorithm (Class Activity)
(Straight Line Distance)
• Expand the nodes of S and put in the CLOSED list
• Initialization:
Open [A, B], Closed [S]
• Iteration 1:
Open [A], Closed [S, B]
• Iteration 2:
Open [E, F, A], Closed [S, B]
Open [E, A], Closed [S, B, F]
• Iteration 3:
Open [I, G, E, A], Closed [S, B, F]
Open [I, E, A], Closed [S, B, F, G]
• Hence the final solution path will be: S----> B----->F----> G
Hill Climbing in Artificial Intelligence
4 6
5
Simplest Ascent Hill Climbing A =4
g
bin
im
• In Steepest Ascent Hill Climbing
Cl
ll
Hi
Multiple points are checked. B=5
p le
Sim
• In Steepest Ascent Hill Climbing, A=4
Algorithms select the best among the
children states that are better than D=6
current State.
• All moves are considered and best one B=5 C=6
No
Generate All Successor
No
Better
than Yes, Solution / Quit
CS
Problems with Hill Climbing in AI
Local Maximum
A local maximum is a peak state in the landscape which
is better than each of its neighboring states, but there is
another state also present which is higher than the local
maximum.
Plateau
A plateau is the flat area of the search space in which all
the neighbor states of the current state contains the
same value, because of this algorithm does not find any
best direction to move. A hill-climbing search might be Ridge
lost in the plateau area.
Ridge
A ridge is a special form of the local maximum. It has an
area which is higher than its surrounding areas, but itself
has a slope, and cannot be reached in a single move.