Artificial Intelligence
Heuristic Search
Heuristic Search and Heuristic Function
▪ Heuristic Search and Heuristic function are used in informed search.
▪ Heuristic search is a simple searching technique that tries to optimize a
problem using Heuristic Function.
▪ Optimization means that we will try to solve a problem in minimum number
of steps or cost.
Heuristic Function h(n)
▪ It is a function H(n) that gives an estimation on the cost of getting from
node ‘n’ to the goal state.
▪ It helps in selecting optimal node for expansion.
R1
R2
Mumbai GOA
R1= 340 Km
R2= 270Km
H(300)
H(200)
Heuristic Function h(n)
X
Y
Z
(Number of steps to reach the
goal state) or Heuristic value
of x will be :
h(x)=2
(Number of steps to reach the
goal state) or Heuristic value
of x will be :
h(y)=1
Goal State
Start Sate
Types of Heuristic Function h(n)
▪ There are two types of Heuristic Functions:
1. Admissible
2. Non-Admissible
Admissible Heuristic Function h(n)
▪ A heuristic function is admissible if it never overestimates the cost of
reaching the goal .
h(n) < = h*(n)
Here h(n) is heuristic cost, and h*(n) is the
estimated cost.
So heuristic cost should be less than or
equal to the estimated cost.
Non-Admissible Heuristic Function h(n)
▪ A non-admissible heuristic may overestimate the cost of reaching the
goal.
h(n) > h*(n)
Here h(n) is heuristic cost, and h*(n) is the
estimated cost.
So heuristic cost may be greater then to
the estimated cost.
total cost = search cost + path cost
Admissible Heuristic Function h(n)
A
B
1
E
Heuristic Cost
Start Sate
G
C
D
F Goal State
B= 1+3=4
3
2
5
1
1
H(C)=4 H(D)=5
H(B)=3 H(D)=5
H(C)=4
H(E)=2
H(F)=3
F(n) = H(n) + G(n)
Cost = Heuristic cost + Actual cost
C= 1+4=5
H(B)=3
D= 1+5=6
Actual cost fromA to G = 1+3+5+2= 11
H(B)=3 so h(n) =3 and h*(n)=11
H(n)<=h*(n)
3<=11
ADMISSIBLE
Non-Admissible Heuristic Function h(n)
A
B
1
E
Heuristic Cost
Start Sate
G
C
D
F Goal State
3
2
5
1
1
H(D)=5
H(B)=3 H(D)=5
H(C)=4
H(E)=3
H(F)=3
F(n) = H(n) + G(n)
Cost = Heuristic cost + Actual cost
Actual cost from A to G(via D) = 1+3= 4
H(D)=5 so h(n) =5 and h*(n)=4
H(n)<=h*(n)
5<=4
NON-ADMISSIBLE
3
THANK YOU
➢ Subscribe our channel
➢ Follow us on Facebook
✓ Page name : Digital
Wave ( Link in
Description Box)

Heuristic Search in Artificial Intelligence | Heuristic Function in AI | Admissible & Non-admissible |Digital Wave

  • 1.
  • 2.
    Heuristic Search andHeuristic Function ▪ Heuristic Search and Heuristic function are used in informed search. ▪ Heuristic search is a simple searching technique that tries to optimize a problem using Heuristic Function. ▪ Optimization means that we will try to solve a problem in minimum number of steps or cost.
  • 3.
    Heuristic Function h(n) ▪It is a function H(n) that gives an estimation on the cost of getting from node ‘n’ to the goal state. ▪ It helps in selecting optimal node for expansion. R1 R2 Mumbai GOA R1= 340 Km R2= 270Km H(300) H(200)
  • 4.
    Heuristic Function h(n) X Y Z (Numberof steps to reach the goal state) or Heuristic value of x will be : h(x)=2 (Number of steps to reach the goal state) or Heuristic value of x will be : h(y)=1 Goal State Start Sate
  • 5.
    Types of HeuristicFunction h(n) ▪ There are two types of Heuristic Functions: 1. Admissible 2. Non-Admissible
  • 6.
    Admissible Heuristic Functionh(n) ▪ A heuristic function is admissible if it never overestimates the cost of reaching the goal . h(n) < = h*(n) Here h(n) is heuristic cost, and h*(n) is the estimated cost. So heuristic cost should be less than or equal to the estimated cost.
  • 7.
    Non-Admissible Heuristic Functionh(n) ▪ A non-admissible heuristic may overestimate the cost of reaching the goal. h(n) > h*(n) Here h(n) is heuristic cost, and h*(n) is the estimated cost. So heuristic cost may be greater then to the estimated cost. total cost = search cost + path cost
  • 8.
    Admissible Heuristic Functionh(n) A B 1 E Heuristic Cost Start Sate G C D F Goal State B= 1+3=4 3 2 5 1 1 H(C)=4 H(D)=5 H(B)=3 H(D)=5 H(C)=4 H(E)=2 H(F)=3 F(n) = H(n) + G(n) Cost = Heuristic cost + Actual cost C= 1+4=5 H(B)=3 D= 1+5=6 Actual cost fromA to G = 1+3+5+2= 11 H(B)=3 so h(n) =3 and h*(n)=11 H(n)<=h*(n) 3<=11 ADMISSIBLE
  • 9.
    Non-Admissible Heuristic Functionh(n) A B 1 E Heuristic Cost Start Sate G C D F Goal State 3 2 5 1 1 H(D)=5 H(B)=3 H(D)=5 H(C)=4 H(E)=3 H(F)=3 F(n) = H(n) + G(n) Cost = Heuristic cost + Actual cost Actual cost from A to G(via D) = 1+3= 4 H(D)=5 so h(n) =5 and h*(n)=4 H(n)<=h*(n) 5<=4 NON-ADMISSIBLE 3
  • 10.
    THANK YOU ➢ Subscribeour channel ➢ Follow us on Facebook ✓ Page name : Digital Wave ( Link in Description Box)