Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Artificial Intelligence

Ms. Sania Yousuf


Covered Search Strategies so far
Uninformed Search Strategies

• Breadth First Search

• Depth First Search

• Depth Limited Search

• Iterative/Progressive Deepening Search

• Uniform Cost Search


Agenda for today’s class
Informed Search Techniques

• Best First Search

• A* Search
Heuristic in AI

Heuristic is a technique designed for solving a problem more quickly


when classic methods are too slow, or for finding an approximate
solution when classic methods fail to find any exact solution
Why we need heuristic?

• To solve NP problem in polynomial time. Time Complexity: O(bd)

2 1 3 1 2 3 8 Puzzle Problem
Time Complexity : O(320)
6 5 4 4 5 6
15 Puzzle Problem
8 7 7 8
Time Complexity : O(1013)
Initial State Goal State
24 Puzzle Problem
Time Complexity : O(1024)
How to calculate Heuristic?
30,20
Long,Lati
RMR
SF NMC • Euclidean
Euc distance 193.13 distance
20,10
Initial 100,200
206.15 G,B1 25,25
DHA Goal
CC SF B
190.39
191.37 UR X1 = 20
X2 = 100
35,20
Y1= 10
B Y2 =200
JC Bah
How to calculate Heuristic?
Manhattan Distance

2 1 3 1 2 3

6 5 4 4 5 6

8 7 7 8

Initial State Goal State

Calculate: (0+1) + (0+1) + (0+0) + (0+2)


+(0+0)+(0+2)+(0+2)+(0+0)  8
Best First Search

Path: SBG
Queue Priority Visited
S:10 S
A:2, B:3 A
C:1, B:3, D:4 C
B:3, D:4 B
G:0, D:4 G
Uniform Cost Search
A* search

You might also like