SlideShare a Scribd company logo
1 of 38
SRI KRISHNA COLLEGE OF ENGINEERING AND TECHNOLOGY
Kuniamuthur, Coimbatore, Tamilnadu, India
An Autonomous Institution, Affiliated to Anna University,
Accredited by NAAC with “A” Grade & Accredited by NBA (CSE, ECE, IT, MECH ,EEE, CIVIL& MCT)
SKCET- LECTURE
Course: Artificial Intelligence
Module: Agents & Its Techniques - Informed Search
Strategies
Faculty : Dr. P. Mohan Kumar,CSE
www.skcet.ac.in
SKCET- EEE MEASUREMENTS
AND INSTRUMENTATION
Completion of this lecture students will be able to :
◦ Understand Search Strategies of AI
◦ Students will be able to solve the
problems using Strategic approach
SKCET- CSE AI
SRI KRISHNA COLLEGE OF ENGINEERING AND TECHNOLOGY
Kuniamuthur, Coimbatore, Tamilnadu, India
An Autonomous Institution, Affiliated to Anna University,
Accredited by NAAC with “A” Grade & Accredited by NBA (CSE, ECE, IT, MECH ,EEE, CIVIL& MCT)
3
SKCET- VIDEO LECTURE
Animation
Lecture Video
 Heuristic Search
◦ Best-First Search Approach
◦ Greedy
◦ A*
◦ Heuristic Functions
 Local Search and Optimization
◦ Hill-climbing
◦ Simulated Annealing
◦ Local Beam
◦ Genetic Algorithms
6
 An informed search strategy uses knowledge
beyond the definition of the problem
 The word "heuristic" means trial-and-error,
exploratory, unguaranteed, rule of thumb.
 The knowledge is embodied in an evaluation
function f(n)
◦ Estimates the distance of node n from the goal
7
 A combination of DFS and BFS
 The idea of Best First Search is to use an
evaluation function to decide which adjacent is
most promising and then explore.
 At each step, using an appropriate heuristic
function, the most promising node is selected
 If the node is selected, quit
 Otherwise, add it to the set of nodes generated so
far, and carry on with generating & selecting the
next node
8
 An instance of tree or graph search
 Fringe is ordered by f(n)
 Several best-first algorithms
◦ Greedy, A*, …
 Key is the heuristic function h(n)
◦ Heuristic measures distance from n to goal based
solely on the state at n
◦ Problem specific
◦ Constraint: h(n) = 0 if n is a goal node
9
function BEST-FIRST SEARCH (problem, Eval fn) returns a solution
sequence
inputs: problem, a problem
Eval fn, an evaluation function
Queueing-Fn  a function that orders nodes by Eval fn
return GENERAL-SEARCH(problem,Queueing-Fn)
10
11
 Insert best nodes at beginning of nodes according to h,
that is, f(n)=h(n)
function Greedy-Search(problem) -> solution
input: a problem
best-first-search(problem,h) -> solution
 Consider the route finding problem.
◦ Can we use additional information to avoid costly paths that
lead nowhere?
◦ Consider using the straight line distance (SLD)
12
374
253
366
329
13
14
15
So is Arad->Sibiu->Fagaras->Bucharest optimal?
Possibilities from Arad: Go to Zerind, Timisoara, or Sibiu?
Take as heuristic the air distance:
Zerind (374), Timisoara (329), or Sibiu (253)
Closest air distance Sibiu, hence go to Sibiu.
Possibilities from Sibiu: Arad, Fagaras, Oradea, or Rimnicu Vilcea?
Take as heuristic the air distance:
Arad (366), Fagaras (176), Oradea (380), or Rimnicu Vilcea (193)
Closest air distance Fagaras, hence go to Fagaras.
Possibilities from Fagaras: Go to Sibiu or Bucharest?
Take as heuristic the air distance:
Sibiu (253) or Bucharest (0)?
Closest air distance Bucharest, hence go to Bucharest.
That is 140km +99km +211km = 450km .
 Not optimal.
 Not complete.
◦ Could go down a path and never return to try another.
 Time Complexity
◦ O(bm)
 Space Complexity
◦ O(bm)
16
 The greedy best-first search does not consider how costly it was to
get to a node.
 It insert best nodes at beginning of nodes according to,
f(n)=g(n)+h(n)
g(n) - actual cost to that node
h(n) - estimated cost to the goal.
 In the A* algorithm the heuristic function h must be optimistic in order
to find the best solution.
function A-star(problem) -> solution
input: a problem
best-first-search(problem, g+h) -> solution
17
18
19
Possibilities from Arad: Go to Zerind, Timisoara, or Sibiu?
Take as heuristic the air distance plus cost to town:
Zerind (374+75=449), Timisoara (329+118=447), or Sibiu
(253+140=393)
Most promising Sibiu, hence explore going to Sibiu.
Possibilities from Sibiu: Arad, Fagaras, Oradea, or Rimnicu Vilcea?
Take as heuristic the air distance plus cost to town:
Arad (140+140+366=646), Fagaras (140+99+176=415), Oradea
(140+151+380=671), or Rimnicu Vilcea (140+80+193=413)
Overall most promising not expanded Rimnicu Vilcea, hence explore going to
Rimnicu Vilcea
20
Possibilities from Rimnicu Vilcea: Sibiu, Pitesti, or Craiova?
Take as heuristic the air distance plus cost to town:
Sibiu (140+80+80+253=553), Pitesti (140+80+97+100=417), or Craiova
(140+80+146+160=526)
Overall most promising not expanded Fagaras, hence explore going to
Fagaras (from Sibiu)
Possibilities from Fagaras: Sibiu, or Bucharest?
Take as heuristic the air distance plus cost to town:
Sibiu (140+99+99+253=591), or Bucharest (140+99+211+0=450)
Overall most promising not expanded Pitesti, hence explore going to Pitesti
(from Rimnicu Vilcea)
21
Possibilities from Pitesti: Rimnicu Vilcea, Craiova, or Bucharest?
Take as heuristic the air distance plus cost to town:
Rimnicu Vilcea (140+80+97+97+193=607), Craiova
(140+80+97+138+160=615) or Bucharest (140+80+97+101+0=418)
Overall most promising go to Bucharest from Pitesti.
Since there is no way to get on a shorter route to Bucharest the last one is
taken.
 A heuristic function h(n) is admissible if the estimated cost is
never more than the actual cost from the current node to the
goal node.
 To understand this, we can imagine a diagram as depicted below.
The direct path (heuristic) from A to C will never be more than the
actual cost (distance taking the path A -> B -> C).
 Theorem:
If h(n) is consistent, A* using GRAPH-SEARCH is optimal
22
 A heuristic is consistent if the cost from the current node to a
successor node, plus the estimated cost from the successor node to
the goal is less than or equal to the estimated cost from the
current node to the goal
 In an equation, it would look like this: C(n, n’) + h(n’) ≤ h(n)
Theorem:
If h(n) is consistent, A* using GRAPH-SEARCH is optimal
23
 Consider the heuristic such that h(n) = the minimum cost
from a successor of n to one of its own successors,
unless the successor is a goal node, in which case it is 0.
 (i,e)h(n) = the minimum cost of it’s successor’s
successor.
 So if we were to traverse A -> B -> C, h(A) would be
calculated from B -> C and NOT from A -> B
24
 In this case h(1) =15 , but h(2) = 0 ,
so, 13, c(1,3) + h(3) > h(1)  20 >15
23 , c (2, 3) + h(3) > h(2)  15 > 0,
which violates consistency.
 Note that the heuristic is still admissible because
h(1) =15 ≤ 20 = g (1),
h(2) = 0 ≤15 = g(2)
 h(1) = 15 because by definition, h(1) is from 2 -> 3. C(1,
2) + h(2) = 5 because C(1, 2) = 5 and h(2) = 0 because
as stated above, since 3 is the goal node, as well as
2’s successor node, h(2) = 0.
25
 Complete
◦ Yes! Same as above.
 Time and Space Complexity
◦ Depends on h(n)
◦ Sub-exponential if where h*(n) is true cost of getting from n to
goal
◦ Optimally efficient
26
))
(
(log
)
(
)
( *
*
n
h
O
n
h
n
h 

27
 Expand S:
{S,A} f = 1+5 = 6
{S,B} f = 2+6 = 8
 Expand A:
{S,A} f = 1+5 = 6
{S,B} f = 2+6 = 8
{S,A,X} f = (1+4)+5 = 10
{S,A,Y} f = (1+7)+8 = 16
 Expand B:
{S,B} f = 2+6 = 8
{S,A,X} f = (1+4)+5 = 10
{S,B,C} f = (2+7)+4 = 13
{S,A,Y} f = (1+7)+8 = 16
{S,B,D} f = (2+1)+15 = 18
28
29
Nodes H value
S 7
A 6
B 2
C 1
G 0
A
S
B
C G
1
4
2
5
12
3
2
 h1 = number of misplaced tiles
 h2 = sum of distances of tiles to goal position.
30
 Is h1
◦ admissible?
◦ consistent?
 Is h2
◦ admissible?
◦ consistent?
31
 Heuristics are often obtained from relaxed
problem
◦ Simplify the original problem by removing constraints
◦ The cost of an optimal solution to a relaxed problem is an
admissible heuristic.
32
 Original
◦ A tile can move from A to B if A is horizontally or
vertically adjacent to B and B is blank.
 Relaxations
◦ Move from A to B if A is adjacent to B
 h2 by moving each tile in turn to destination
◦ Move from A to B if B is blank
◦ Move from A to B
 h1 by simply moving each tile directly to destination.
33
 What heuristic is obtained from
Move from A to B if B is blank?
 Gaschnig’s heuristic (1979)
34
 Suppose now that the bananas are hung from
the ceiling and the monkey needs to climb on a
box to get the bananas. In addition, walls exist in
the environment.
 Box, monkey, and bananas placed randomly
 Monkey can see the entire world.
 Actions: N,S,E,W,Grab,Drop,Climb,Eat
35
 Describe the problem as a search problem.
◦ Initial state, successor function, goal, path cost
 In what way(s) can we relax the problem to obtain
a heuristic?
36
 If h2(n)  h1(n) for all n, then h2 dominates h1
◦ h2 is better for use with searching
 For the 8-puzzle, h2 does dominate h1
◦ If a tile is out of place, it is at least a distance of 1 away
from its correct position. Since h1 counts the number of
out of place tiles, and h2 totals all of the distances,
h2(n)  h1(n) for all n.
37
38
ASSESSMENT
Assignment Quiz

More Related Content

Similar to Informed Search.pptx

module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfShiwani Gupta
 
Branch and bound method
Branch and bound methodBranch and bound method
Branch and bound methodVidhyaSenthil
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchPalGov
 
AI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAndrew Ferlitsch
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptxDrYogeshDeshmukh1
 
Combinatorial optimization CO-2
Combinatorial optimization CO-2Combinatorial optimization CO-2
Combinatorial optimization CO-2man003
 
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VECUnit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VECsundarKanagaraj1
 
Graph Edit Distance: Basics & Trends
Graph Edit Distance: Basics & TrendsGraph Edit Distance: Basics & Trends
Graph Edit Distance: Basics & TrendsLuc Brun
 
Route-Planning other sesion for Universal
Route-Planning other sesion for UniversalRoute-Planning other sesion for Universal
Route-Planning other sesion for UniversalDidik56
 
parameterized complexity for graph Motif
parameterized complexity for graph Motifparameterized complexity for graph Motif
parameterized complexity for graph MotifAMR koura
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.pptMIT,Imphal
 
Searching Informed Search.pdf
Searching Informed Search.pdfSearching Informed Search.pdf
Searching Informed Search.pdfDrBashirMSaad
 

Similar to Informed Search.pptx (20)

Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
 
Branch and bound method
Branch and bound methodBranch and bound method
Branch and bound method
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
 
AI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAI Greedy and A-STAR Search
AI Greedy and A-STAR Search
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
 
AI 4 | Informed Search
AI 4 | Informed SearchAI 4 | Informed Search
AI 4 | Informed Search
 
CS767_Lecture_03.pptx
CS767_Lecture_03.pptxCS767_Lecture_03.pptx
CS767_Lecture_03.pptx
 
Combinatorial optimization CO-2
Combinatorial optimization CO-2Combinatorial optimization CO-2
Combinatorial optimization CO-2
 
A Star Search
A Star SearchA Star Search
A Star Search
 
A Star Search
A Star SearchA Star Search
A Star Search
 
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VECUnit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
 
Graph Edit Distance: Basics & Trends
Graph Edit Distance: Basics & TrendsGraph Edit Distance: Basics & Trends
Graph Edit Distance: Basics & Trends
 
Route-Planning other sesion for Universal
Route-Planning other sesion for UniversalRoute-Planning other sesion for Universal
Route-Planning other sesion for Universal
 
AI Overview.pptx
AI Overview.pptxAI Overview.pptx
AI Overview.pptx
 
parameterized complexity for graph Motif
parameterized complexity for graph Motifparameterized complexity for graph Motif
parameterized complexity for graph Motif
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.ppt
 
Searching Informed Search.pdf
Searching Informed Search.pdfSearching Informed Search.pdf
Searching Informed Search.pdf
 
Lecture26
Lecture26Lecture26
Lecture26
 

Recently uploaded

Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 

Informed Search.pptx

  • 1. SRI KRISHNA COLLEGE OF ENGINEERING AND TECHNOLOGY Kuniamuthur, Coimbatore, Tamilnadu, India An Autonomous Institution, Affiliated to Anna University, Accredited by NAAC with “A” Grade & Accredited by NBA (CSE, ECE, IT, MECH ,EEE, CIVIL& MCT) SKCET- LECTURE Course: Artificial Intelligence Module: Agents & Its Techniques - Informed Search Strategies Faculty : Dr. P. Mohan Kumar,CSE www.skcet.ac.in SKCET- EEE MEASUREMENTS AND INSTRUMENTATION
  • 2. Completion of this lecture students will be able to : ◦ Understand Search Strategies of AI ◦ Students will be able to solve the problems using Strategic approach SKCET- CSE AI SRI KRISHNA COLLEGE OF ENGINEERING AND TECHNOLOGY Kuniamuthur, Coimbatore, Tamilnadu, India An Autonomous Institution, Affiliated to Anna University, Accredited by NAAC with “A” Grade & Accredited by NBA (CSE, ECE, IT, MECH ,EEE, CIVIL& MCT)
  • 4.
  • 5.
  • 6.  Heuristic Search ◦ Best-First Search Approach ◦ Greedy ◦ A* ◦ Heuristic Functions  Local Search and Optimization ◦ Hill-climbing ◦ Simulated Annealing ◦ Local Beam ◦ Genetic Algorithms 6
  • 7.  An informed search strategy uses knowledge beyond the definition of the problem  The word "heuristic" means trial-and-error, exploratory, unguaranteed, rule of thumb.  The knowledge is embodied in an evaluation function f(n) ◦ Estimates the distance of node n from the goal 7
  • 8.  A combination of DFS and BFS  The idea of Best First Search is to use an evaluation function to decide which adjacent is most promising and then explore.  At each step, using an appropriate heuristic function, the most promising node is selected  If the node is selected, quit  Otherwise, add it to the set of nodes generated so far, and carry on with generating & selecting the next node 8
  • 9.  An instance of tree or graph search  Fringe is ordered by f(n)  Several best-first algorithms ◦ Greedy, A*, …  Key is the heuristic function h(n) ◦ Heuristic measures distance from n to goal based solely on the state at n ◦ Problem specific ◦ Constraint: h(n) = 0 if n is a goal node 9
  • 10. function BEST-FIRST SEARCH (problem, Eval fn) returns a solution sequence inputs: problem, a problem Eval fn, an evaluation function Queueing-Fn  a function that orders nodes by Eval fn return GENERAL-SEARCH(problem,Queueing-Fn) 10
  • 11. 11
  • 12.  Insert best nodes at beginning of nodes according to h, that is, f(n)=h(n) function Greedy-Search(problem) -> solution input: a problem best-first-search(problem,h) -> solution  Consider the route finding problem. ◦ Can we use additional information to avoid costly paths that lead nowhere? ◦ Consider using the straight line distance (SLD) 12
  • 14. 14
  • 15. 15 So is Arad->Sibiu->Fagaras->Bucharest optimal? Possibilities from Arad: Go to Zerind, Timisoara, or Sibiu? Take as heuristic the air distance: Zerind (374), Timisoara (329), or Sibiu (253) Closest air distance Sibiu, hence go to Sibiu. Possibilities from Sibiu: Arad, Fagaras, Oradea, or Rimnicu Vilcea? Take as heuristic the air distance: Arad (366), Fagaras (176), Oradea (380), or Rimnicu Vilcea (193) Closest air distance Fagaras, hence go to Fagaras. Possibilities from Fagaras: Go to Sibiu or Bucharest? Take as heuristic the air distance: Sibiu (253) or Bucharest (0)? Closest air distance Bucharest, hence go to Bucharest. That is 140km +99km +211km = 450km .
  • 16.  Not optimal.  Not complete. ◦ Could go down a path and never return to try another.  Time Complexity ◦ O(bm)  Space Complexity ◦ O(bm) 16
  • 17.  The greedy best-first search does not consider how costly it was to get to a node.  It insert best nodes at beginning of nodes according to, f(n)=g(n)+h(n) g(n) - actual cost to that node h(n) - estimated cost to the goal.  In the A* algorithm the heuristic function h must be optimistic in order to find the best solution. function A-star(problem) -> solution input: a problem best-first-search(problem, g+h) -> solution 17
  • 18. 18
  • 19. 19 Possibilities from Arad: Go to Zerind, Timisoara, or Sibiu? Take as heuristic the air distance plus cost to town: Zerind (374+75=449), Timisoara (329+118=447), or Sibiu (253+140=393) Most promising Sibiu, hence explore going to Sibiu. Possibilities from Sibiu: Arad, Fagaras, Oradea, or Rimnicu Vilcea? Take as heuristic the air distance plus cost to town: Arad (140+140+366=646), Fagaras (140+99+176=415), Oradea (140+151+380=671), or Rimnicu Vilcea (140+80+193=413) Overall most promising not expanded Rimnicu Vilcea, hence explore going to Rimnicu Vilcea
  • 20. 20 Possibilities from Rimnicu Vilcea: Sibiu, Pitesti, or Craiova? Take as heuristic the air distance plus cost to town: Sibiu (140+80+80+253=553), Pitesti (140+80+97+100=417), or Craiova (140+80+146+160=526) Overall most promising not expanded Fagaras, hence explore going to Fagaras (from Sibiu) Possibilities from Fagaras: Sibiu, or Bucharest? Take as heuristic the air distance plus cost to town: Sibiu (140+99+99+253=591), or Bucharest (140+99+211+0=450) Overall most promising not expanded Pitesti, hence explore going to Pitesti (from Rimnicu Vilcea)
  • 21. 21 Possibilities from Pitesti: Rimnicu Vilcea, Craiova, or Bucharest? Take as heuristic the air distance plus cost to town: Rimnicu Vilcea (140+80+97+97+193=607), Craiova (140+80+97+138+160=615) or Bucharest (140+80+97+101+0=418) Overall most promising go to Bucharest from Pitesti. Since there is no way to get on a shorter route to Bucharest the last one is taken.
  • 22.  A heuristic function h(n) is admissible if the estimated cost is never more than the actual cost from the current node to the goal node.  To understand this, we can imagine a diagram as depicted below. The direct path (heuristic) from A to C will never be more than the actual cost (distance taking the path A -> B -> C).  Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal 22
  • 23.  A heuristic is consistent if the cost from the current node to a successor node, plus the estimated cost from the successor node to the goal is less than or equal to the estimated cost from the current node to the goal  In an equation, it would look like this: C(n, n’) + h(n’) ≤ h(n) Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal 23
  • 24.  Consider the heuristic such that h(n) = the minimum cost from a successor of n to one of its own successors, unless the successor is a goal node, in which case it is 0.  (i,e)h(n) = the minimum cost of it’s successor’s successor.  So if we were to traverse A -> B -> C, h(A) would be calculated from B -> C and NOT from A -> B 24
  • 25.  In this case h(1) =15 , but h(2) = 0 , so, 13, c(1,3) + h(3) > h(1)  20 >15 23 , c (2, 3) + h(3) > h(2)  15 > 0, which violates consistency.  Note that the heuristic is still admissible because h(1) =15 ≤ 20 = g (1), h(2) = 0 ≤15 = g(2)  h(1) = 15 because by definition, h(1) is from 2 -> 3. C(1, 2) + h(2) = 5 because C(1, 2) = 5 and h(2) = 0 because as stated above, since 3 is the goal node, as well as 2’s successor node, h(2) = 0. 25
  • 26.  Complete ◦ Yes! Same as above.  Time and Space Complexity ◦ Depends on h(n) ◦ Sub-exponential if where h*(n) is true cost of getting from n to goal ◦ Optimally efficient 26 )) ( (log ) ( ) ( * * n h O n h n h  
  • 27. 27
  • 28.  Expand S: {S,A} f = 1+5 = 6 {S,B} f = 2+6 = 8  Expand A: {S,A} f = 1+5 = 6 {S,B} f = 2+6 = 8 {S,A,X} f = (1+4)+5 = 10 {S,A,Y} f = (1+7)+8 = 16  Expand B: {S,B} f = 2+6 = 8 {S,A,X} f = (1+4)+5 = 10 {S,B,C} f = (2+7)+4 = 13 {S,A,Y} f = (1+7)+8 = 16 {S,B,D} f = (2+1)+15 = 18 28
  • 29. 29 Nodes H value S 7 A 6 B 2 C 1 G 0 A S B C G 1 4 2 5 12 3 2
  • 30.  h1 = number of misplaced tiles  h2 = sum of distances of tiles to goal position. 30
  • 31.  Is h1 ◦ admissible? ◦ consistent?  Is h2 ◦ admissible? ◦ consistent? 31
  • 32.  Heuristics are often obtained from relaxed problem ◦ Simplify the original problem by removing constraints ◦ The cost of an optimal solution to a relaxed problem is an admissible heuristic. 32
  • 33.  Original ◦ A tile can move from A to B if A is horizontally or vertically adjacent to B and B is blank.  Relaxations ◦ Move from A to B if A is adjacent to B  h2 by moving each tile in turn to destination ◦ Move from A to B if B is blank ◦ Move from A to B  h1 by simply moving each tile directly to destination. 33
  • 34.  What heuristic is obtained from Move from A to B if B is blank?  Gaschnig’s heuristic (1979) 34
  • 35.  Suppose now that the bananas are hung from the ceiling and the monkey needs to climb on a box to get the bananas. In addition, walls exist in the environment.  Box, monkey, and bananas placed randomly  Monkey can see the entire world.  Actions: N,S,E,W,Grab,Drop,Climb,Eat 35
  • 36.  Describe the problem as a search problem. ◦ Initial state, successor function, goal, path cost  In what way(s) can we relax the problem to obtain a heuristic? 36
  • 37.  If h2(n)  h1(n) for all n, then h2 dominates h1 ◦ h2 is better for use with searching  For the 8-puzzle, h2 does dominate h1 ◦ If a tile is out of place, it is at least a distance of 1 away from its correct position. Since h1 counts the number of out of place tiles, and h2 totals all of the distances, h2(n)  h1(n) for all n. 37