SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Heuristic Search Algorithm
Lecture-12
Hema Kashyap
1
Best First Search
• Uniform Cost Search is a special case of the best first search algorithm. The algorithm
maintains a priority queue of nodes to be explored. A cost function f(n) is applied to each
node. The nodes are put in OPEN in the order of their f values. Nodes with smaller f(n)
values are expanded earlier. The generic best first search algorithm is outlined below.
2
Concept
Step 1: Traverse the root node
Step 2: Traverse any neighbour of the root node, that is maintaining a least distance
from the root node
and insert them in ascending order into the queue.
Step 3: Traverse any neighbour of neighbour of the root node, that is maintaining a
least distance from
the root node and insert them in ascending order into the queue
Step 4: This process will continue until we are getting the goal node
3
Example
Step 1:
Consider the node A as our root node. So the first element of the queue is A whish is not our
goal node, so remove it from the queue and find its neighbour that are to inserted in ascending
order.
A
Step 2:
The neighbours of A are B and C. They will be inserted into the queue in ascending order.
B C A(Expanded Node)
Step 3:
Now B is on the FRONT end of the queue. So calculate the neighbours of B that are maintaining
a least distance from the roof.
F E D C B(Expanded Node)
4
Step 4:
Now the node F is on the FRONT end of the queue. But as it has no further children, so remove it
from the queue and proceed further.
E D C F (Expanded Node)
Step 5:
Now E is the FRONT end. So the children of E are J and K. Insert them into the queue in
ascending order.
K J D C E(Expanded Node)
Step 6:
Now K is on the FRONT end and as it has no further children, so remove it and proceed further
J D C K(Expanded Node)
Step7:
Also, J has no corresponding children. So remove it and proceed further.
D C J(Expanded Node)
Step 8:
Now D is on the FRONT end and calculates the children of D and put it into the queue.
I C D(Expanded Node)
Step9:
Now I is the FRONT node and it has no children. So proceed further after removing this node
from the queue.
C I(Expanded Node)
5
Step 10:
Now C is the FRONT node .So calculate the neighbours of C that are to be inserted in
ascending order into the queue.
G H C(Expanded Node)
Step 11:
Now remove G from the queue and calculate its neighbour that is to insert in ascending
order into the queue.
M L H G(Expanded Node)
Step12:
Now M is the FRONT node of the queue which is our goal node. So stop here and exit.
L H M(Expanded Node)
6
Advantages
• It is more efficient than that of
BFS and DFS.
• Time complexity of Best first
search is much less than Breadth
first search.
• The Best first search allows us
to switch between paths by
gaining the benefits of both
breadth first and depth first
search. Because, depth first is
good because a solution can be
found without computing all
nodes and Breadth first search is
good because it does not get
trapped in dead ends.
Disadvantages
• Sometimes, it covers more distance than
our consideration.
7
Branch and Bound
• Branch and Bound is an algorithmic technique which finds the optimal solution by
keeping the best solution found so far.
• If partial solution can’t improve on the best it is abandoned, by this method the
number of nodes which are explored can also be reduced.
• It also deals with the optimization problems over a search that can be presented as
the leaves of the search tree.
• The usual technique for eliminating the sub trees from the search tree is called
pruning.
• For Branch and Bound algorithm we will use stack data structure.
8
Concept
Step 1: Traverse the root node.
Step 2: Traverse any neighbour of the root node that is maintaining least distance from
the root node.
Step 3: Traverse any neighbour of the neighbour of the root node that is maintaining
least distance from
the root node.
Step 4: This process will continue until we are getting the goal node.
9
Algorithm
Step 1: PUSH the root node into the stack.
Step 2: If stack is empty, then stop and return failure.
Step 3: If the top node of the stack is a goal node, then stop and return success.
Step 4: Else POP the node from the stack. Process it and find all its successors. Find
out the path containing all its successors as well as predecessors and then PUSH the
successors which are belonging to the minimum or shortest path.
Step 5: Go to step 5.
Step 6: Exit.
10
ExampleStep 1:
Consider the node A as our root node. Find its successors
i.e. B, C, F. Calculate the distance from the root and PUSH
them according to least distance.
A
B: 0+5 = 5 (The cost of A is 0 as it is the starting node)
F: 0+9 = 9
C: 0+7 = 7
Here B (5) is the least distance.
Step 2:
Now the stack will be
C F B(Top) A(Expanded)
As B is on the top of the stack so calculate the neighbours
of B.
D: 0+5+4 = 9
E: 0+5+6 = 11
The least distance is D from B. So it will be on the top of
the stack. 11
Step 3:
As the top of the stack is D. So calculate neighbours of D.
C F D(Top) B(Expanded)
C: 0+5+4+8 = 17
F: 0+5+4+3 = 12
The least distance is F from D and it is our goal node. So stop and return success.
Step 4:
C F(Top) D(Expanded)
Hence the searching path will be A-B -D-F
12
Advantages/Disadvantages
Advantages:
• As it finds the minimum path instead of finding the minimum successor so there
should not be any repetition.
• The time complexity is less compared to other algorithms.
Disadvantages:
• The load balancing aspects for Branch and Bound algorithm make it parallelization
difficult.
• The Branch and Bound algorithm is limited to small size network. In the problem
of large networks, where the solution search space grows exponentially with the
scale of the network, the approach becomes relatively prohibitive.
13

Weitere ähnliche Inhalte

Was ist angesagt?

Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First SearchKevin Jadiya
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AIvikas dhakane
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceJay Nagar
 
Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbingHema Kashyap
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)Bablu Shofi
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtrackingmandlapure
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AIKirti Verma
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms Syed Ahmed
 
Intro to-iterative-deepening
Intro to-iterative-deepeningIntro to-iterative-deepening
Intro to-iterative-deepeningAdel Totott
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
 

Was ist angesagt? (20)

AD3251-Data Structures Design-Notes-Tree.pdf
AD3251-Data Structures  Design-Notes-Tree.pdfAD3251-Data Structures  Design-Notes-Tree.pdf
AD3251-Data Structures Design-Notes-Tree.pdf
 
Breadth First Search & Depth First Search
Breadth First Search & Depth First SearchBreadth First Search & Depth First Search
Breadth First Search & Depth First Search
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
A Star Search
A Star SearchA Star Search
A Star Search
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Insertion Sorting
Insertion SortingInsertion Sorting
Insertion Sorting
 
Informed search
Informed searchInformed search
Informed search
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
AD3251-Data Structures Design-Notes-Searching-Hashing.pdf
AD3251-Data Structures  Design-Notes-Searching-Hashing.pdfAD3251-Data Structures  Design-Notes-Searching-Hashing.pdf
AD3251-Data Structures Design-Notes-Searching-Hashing.pdf
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbing
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
Tower Of Hanoi
Tower Of HanoiTower Of Hanoi
Tower Of Hanoi
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtracking
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
Intro to-iterative-deepening
Intro to-iterative-deepeningIntro to-iterative-deepening
Intro to-iterative-deepening
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 

Andere mochten auch

Lecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingLecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingHema Kashyap
 
Lecture 23 alpha beta pruning
Lecture 23 alpha beta pruningLecture 23 alpha beta pruning
Lecture 23 alpha beta pruningHema Kashyap
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculusRajendran
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2chandsek666
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based systemTianlu Wang
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence Muhammad Ahad
 
Advanced java practical semester 6_computer science
Advanced java practical semester 6_computer scienceAdvanced java practical semester 6_computer science
Advanced java practical semester 6_computer scienceNiraj Bharambe
 
Heuristic Search
Heuristic SearchHeuristic Search
Heuristic Searchbutest
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed SearchHema Kashyap
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 aiRadhika Srinivasan
 
Lecture 30 introduction to logic
Lecture 30 introduction to logicLecture 30 introduction to logic
Lecture 30 introduction to logicHema Kashyap
 

Andere mochten auch (20)

Lecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingLecture 09 uninformed problem solving
Lecture 09 uninformed problem solving
 
AI Lesson 08
AI Lesson 08AI Lesson 08
AI Lesson 08
 
Lecture 23 alpha beta pruning
Lecture 23 alpha beta pruningLecture 23 alpha beta pruning
Lecture 23 alpha beta pruning
 
Alpha beta pruning
Alpha beta pruningAlpha beta pruning
Alpha beta pruning
 
15 predicate
15 predicate15 predicate
15 predicate
 
Ai 02
Ai 02Ai 02
Ai 02
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
 
Core java tutorial
Core java tutorialCore java tutorial
Core java tutorial
 
The Unified Modelling Lanage (UML)
The Unified Modelling Lanage (UML)The Unified Modelling Lanage (UML)
The Unified Modelling Lanage (UML)
 
Alphabeta
AlphabetaAlphabeta
Alphabeta
 
Advanced java practical semester 6_computer science
Advanced java practical semester 6_computer scienceAdvanced java practical semester 6_computer science
Advanced java practical semester 6_computer science
 
Heuristic Search
Heuristic SearchHeuristic Search
Heuristic Search
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
Uml
UmlUml
Uml
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai
 
Lecture 30 introduction to logic
Lecture 30 introduction to logicLecture 30 introduction to logic
Lecture 30 introduction to logic
 

Ähnlich wie Lecture 12 Heuristic Searches

Uniformed tree searching
Uniformed tree searching Uniformed tree searching
Uniformed tree searching Ayaelshiwi
 
HEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptxHEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptxrakeshkumar12020604
 
AI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxAI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxCS50Bootcamp
 
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdfAI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdfAsst.prof M.Gokilavani
 
Best First Search.pptx
Best First Search.pptxBest First Search.pptx
Best First Search.pptxMuktarulHoque1
 
2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt
2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt
2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.pptmmpnair0
 
uniformed (also called blind search algo)
uniformed (also called blind search algo)uniformed (also called blind search algo)
uniformed (also called blind search algo)ssuser2a76b5
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsSigSegVSquad
 
RPT_AI_03_PartB_UNINFORMED_FINAL.pptx
RPT_AI_03_PartB_UNINFORMED_FINAL.pptxRPT_AI_03_PartB_UNINFORMED_FINAL.pptx
RPT_AI_03_PartB_UNINFORMED_FINAL.pptxRahulkumarTivarekar1
 
General methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptxGeneral methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptxLakshmiSamivel
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsSlimAmiri
 
Lec 2 1 informed search
Lec 2 1  informed searchLec 2 1  informed search
Lec 2 1 informed searchEyob Sisay
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptxDrYogeshDeshmukh1
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxRaviKiranVarma4
 
Y11 m02 networks
Y11 m02  networksY11 m02  networks
Y11 m02 networksXu Wei
 
Artificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxArtificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxRatnakar Mikkili
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesHema Kashyap
 
Breadth first search (bfs)
Breadth first search (bfs)Breadth first search (bfs)
Breadth first search (bfs)Bishal Bhandari
 

Ähnlich wie Lecture 12 Heuristic Searches (20)

A star algorithms
A star algorithmsA star algorithms
A star algorithms
 
Uniformed tree searching
Uniformed tree searching Uniformed tree searching
Uniformed tree searching
 
HEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptxHEURISTIC SEARCH and other technique.pptx
HEURISTIC SEARCH and other technique.pptx
 
AI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxAI unit-2 lecture notes.docx
AI unit-2 lecture notes.docx
 
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdfAI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
 
Best First Search.pptx
Best First Search.pptxBest First Search.pptx
Best First Search.pptx
 
2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt
2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt
2012wq171-03-UninformedSeknlk ;lm,l;mk;arch.ppt
 
uniformed (also called blind search algo)
uniformed (also called blind search algo)uniformed (also called blind search algo)
uniformed (also called blind search algo)
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
 
RPT_AI_03_PartB_UNINFORMED_FINAL.pptx
RPT_AI_03_PartB_UNINFORMED_FINAL.pptxRPT_AI_03_PartB_UNINFORMED_FINAL.pptx
RPT_AI_03_PartB_UNINFORMED_FINAL.pptx
 
General methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptxGeneral methodin Data Structure for UG.pptx
General methodin Data Structure for UG.pptx
 
Unit ii-ppt
Unit ii-pptUnit ii-ppt
Unit ii-ppt
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , probloms
 
Lec 2 1 informed search
Lec 2 1  informed searchLec 2 1  informed search
Lec 2 1 informed search
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
 
Y11 m02 networks
Y11 m02  networksY11 m02  networks
Y11 m02 networks
 
Artificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxArtificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptx
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
 
Breadth first search (bfs)
Breadth first search (bfs)Breadth first search (bfs)
Breadth first search (bfs)
 

Mehr von Hema Kashyap

Lecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-exampleLecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-exampleHema Kashyap
 
Lecture 28 genetic algorithm
Lecture 28 genetic algorithmLecture 28 genetic algorithm
Lecture 28 genetic algorithmHema Kashyap
 
Lecture 27 simulated annealing
Lecture 27 simulated annealingLecture 27 simulated annealing
Lecture 27 simulated annealingHema Kashyap
 
Lecture 26 local beam search
Lecture 26 local beam searchLecture 26 local beam search
Lecture 26 local beam searchHema Kashyap
 
Lecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithmLecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithmHema Kashyap
 
Lecture 22 adversarial search
Lecture 22 adversarial searchLecture 22 adversarial search
Lecture 22 adversarial searchHema Kashyap
 
Lecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchLecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchHema Kashyap
 
Lecture 20 problem reduction search
Lecture 20 problem reduction searchLecture 20 problem reduction search
Lecture 20 problem reduction searchHema Kashyap
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithmHema Kashyap
 
Lecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithmLecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithmHema Kashyap
 
Lecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmLecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmHema Kashyap
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded searchHema Kashyap
 
Lecture 15 monkey banana problem
Lecture 15 monkey banana problemLecture 15 monkey banana problem
Lecture 15 monkey banana problemHema Kashyap
 
Lecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problemLecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problemHema Kashyap
 
Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..Hema Kashyap
 
Lecture 07 search techniques
Lecture 07 search techniquesLecture 07 search techniques
Lecture 07 search techniquesHema Kashyap
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production systemHema Kashyap
 
Lecture 05 problem solving through ai
Lecture 05 problem solving through aiLecture 05 problem solving through ai
Lecture 05 problem solving through aiHema Kashyap
 
Lecture 04 intelligent agents
Lecture 04 intelligent agentsLecture 04 intelligent agents
Lecture 04 intelligent agentsHema Kashyap
 
Lecture 03 introduction to artificial intelligence
Lecture 03 introduction to artificial intelligenceLecture 03 introduction to artificial intelligence
Lecture 03 introduction to artificial intelligenceHema Kashyap
 

Mehr von Hema Kashyap (20)

Lecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-exampleLecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-example
 
Lecture 28 genetic algorithm
Lecture 28 genetic algorithmLecture 28 genetic algorithm
Lecture 28 genetic algorithm
 
Lecture 27 simulated annealing
Lecture 27 simulated annealingLecture 27 simulated annealing
Lecture 27 simulated annealing
 
Lecture 26 local beam search
Lecture 26 local beam searchLecture 26 local beam search
Lecture 26 local beam search
 
Lecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithmLecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithm
 
Lecture 22 adversarial search
Lecture 22 adversarial searchLecture 22 adversarial search
Lecture 22 adversarial search
 
Lecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star searchLecture 21 problem reduction search ao star search
Lecture 21 problem reduction search ao star search
 
Lecture 20 problem reduction search
Lecture 20 problem reduction searchLecture 20 problem reduction search
Lecture 20 problem reduction search
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithm
 
Lecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithmLecture 18 simplified memory bound a star algorithm
Lecture 18 simplified memory bound a star algorithm
 
Lecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithmLecture 17 Iterative Deepening a star algorithm
Lecture 17 Iterative Deepening a star algorithm
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
Lecture 15 monkey banana problem
Lecture 15 monkey banana problemLecture 15 monkey banana problem
Lecture 15 monkey banana problem
 
Lecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problemLecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problem
 
Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..Lecture 10 Uninformed Search Techniques conti..
Lecture 10 Uninformed Search Techniques conti..
 
Lecture 07 search techniques
Lecture 07 search techniquesLecture 07 search techniques
Lecture 07 search techniques
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
 
Lecture 05 problem solving through ai
Lecture 05 problem solving through aiLecture 05 problem solving through ai
Lecture 05 problem solving through ai
 
Lecture 04 intelligent agents
Lecture 04 intelligent agentsLecture 04 intelligent agents
Lecture 04 intelligent agents
 
Lecture 03 introduction to artificial intelligence
Lecture 03 introduction to artificial intelligenceLecture 03 introduction to artificial intelligence
Lecture 03 introduction to artificial intelligence
 

Kürzlich hochgeladen

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 

Kürzlich hochgeladen (20)

Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

Lecture 12 Heuristic Searches

  • 2. Best First Search • Uniform Cost Search is a special case of the best first search algorithm. The algorithm maintains a priority queue of nodes to be explored. A cost function f(n) is applied to each node. The nodes are put in OPEN in the order of their f values. Nodes with smaller f(n) values are expanded earlier. The generic best first search algorithm is outlined below. 2
  • 3. Concept Step 1: Traverse the root node Step 2: Traverse any neighbour of the root node, that is maintaining a least distance from the root node and insert them in ascending order into the queue. Step 3: Traverse any neighbour of neighbour of the root node, that is maintaining a least distance from the root node and insert them in ascending order into the queue Step 4: This process will continue until we are getting the goal node 3
  • 4. Example Step 1: Consider the node A as our root node. So the first element of the queue is A whish is not our goal node, so remove it from the queue and find its neighbour that are to inserted in ascending order. A Step 2: The neighbours of A are B and C. They will be inserted into the queue in ascending order. B C A(Expanded Node) Step 3: Now B is on the FRONT end of the queue. So calculate the neighbours of B that are maintaining a least distance from the roof. F E D C B(Expanded Node) 4
  • 5. Step 4: Now the node F is on the FRONT end of the queue. But as it has no further children, so remove it from the queue and proceed further. E D C F (Expanded Node) Step 5: Now E is the FRONT end. So the children of E are J and K. Insert them into the queue in ascending order. K J D C E(Expanded Node) Step 6: Now K is on the FRONT end and as it has no further children, so remove it and proceed further J D C K(Expanded Node) Step7: Also, J has no corresponding children. So remove it and proceed further. D C J(Expanded Node) Step 8: Now D is on the FRONT end and calculates the children of D and put it into the queue. I C D(Expanded Node) Step9: Now I is the FRONT node and it has no children. So proceed further after removing this node from the queue. C I(Expanded Node) 5
  • 6. Step 10: Now C is the FRONT node .So calculate the neighbours of C that are to be inserted in ascending order into the queue. G H C(Expanded Node) Step 11: Now remove G from the queue and calculate its neighbour that is to insert in ascending order into the queue. M L H G(Expanded Node) Step12: Now M is the FRONT node of the queue which is our goal node. So stop here and exit. L H M(Expanded Node) 6
  • 7. Advantages • It is more efficient than that of BFS and DFS. • Time complexity of Best first search is much less than Breadth first search. • The Best first search allows us to switch between paths by gaining the benefits of both breadth first and depth first search. Because, depth first is good because a solution can be found without computing all nodes and Breadth first search is good because it does not get trapped in dead ends. Disadvantages • Sometimes, it covers more distance than our consideration. 7
  • 8. Branch and Bound • Branch and Bound is an algorithmic technique which finds the optimal solution by keeping the best solution found so far. • If partial solution can’t improve on the best it is abandoned, by this method the number of nodes which are explored can also be reduced. • It also deals with the optimization problems over a search that can be presented as the leaves of the search tree. • The usual technique for eliminating the sub trees from the search tree is called pruning. • For Branch and Bound algorithm we will use stack data structure. 8
  • 9. Concept Step 1: Traverse the root node. Step 2: Traverse any neighbour of the root node that is maintaining least distance from the root node. Step 3: Traverse any neighbour of the neighbour of the root node that is maintaining least distance from the root node. Step 4: This process will continue until we are getting the goal node. 9
  • 10. Algorithm Step 1: PUSH the root node into the stack. Step 2: If stack is empty, then stop and return failure. Step 3: If the top node of the stack is a goal node, then stop and return success. Step 4: Else POP the node from the stack. Process it and find all its successors. Find out the path containing all its successors as well as predecessors and then PUSH the successors which are belonging to the minimum or shortest path. Step 5: Go to step 5. Step 6: Exit. 10
  • 11. ExampleStep 1: Consider the node A as our root node. Find its successors i.e. B, C, F. Calculate the distance from the root and PUSH them according to least distance. A B: 0+5 = 5 (The cost of A is 0 as it is the starting node) F: 0+9 = 9 C: 0+7 = 7 Here B (5) is the least distance. Step 2: Now the stack will be C F B(Top) A(Expanded) As B is on the top of the stack so calculate the neighbours of B. D: 0+5+4 = 9 E: 0+5+6 = 11 The least distance is D from B. So it will be on the top of the stack. 11
  • 12. Step 3: As the top of the stack is D. So calculate neighbours of D. C F D(Top) B(Expanded) C: 0+5+4+8 = 17 F: 0+5+4+3 = 12 The least distance is F from D and it is our goal node. So stop and return success. Step 4: C F(Top) D(Expanded) Hence the searching path will be A-B -D-F 12
  • 13. Advantages/Disadvantages Advantages: • As it finds the minimum path instead of finding the minimum successor so there should not be any repetition. • The time complexity is less compared to other algorithms. Disadvantages: • The load balancing aspects for Branch and Bound algorithm make it parallelization difficult. • The Branch and Bound algorithm is limited to small size network. In the problem of large networks, where the solution search space grows exponentially with the scale of the network, the approach becomes relatively prohibitive. 13