SlideShare a Scribd company logo
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

More Related Content

What's hot

UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
JenishaR1
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
Hema Kashyap
 
Uninformed search /Blind search in AI
Uninformed search /Blind search in AIUninformed search /Blind search in AI
Uninformed search /Blind search in AI
Kirti Verma
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
Dr. C.V. Suresh Babu
 
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
Hema Kashyap
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
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
vikas dhakane
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
Bharat Bhushan
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
Amar Jukuntla
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
Acad
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
vikas dhakane
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
vikas dhakane
 
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEIntelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Khushboo Pal
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
Harini Balamurugan
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
grinu
 
Reflex and model based agents
Reflex and model based agentsReflex and model based agents
Reflex and model based agents
Megha Sharma
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
Mahesh Kumar Chelimilla
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
Harini Balamurugan
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
Dr Shashikant Athawale
 

What's hot (20)

Iterative deepening search
Iterative deepening searchIterative deepening search
Iterative deepening search
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
 
Lecture 16 memory bounded search
Lecture 16 memory bounded searchLecture 16 memory bounded search
Lecture 16 memory bounded search
 
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 Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
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
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
 
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
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCEIntelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
Intelligent Agent PPT ON SLIDESHARE IN ARTIFICIAL INTELLIGENCE
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
 
Reflex and model based agents
Reflex and model based agentsReflex and model based agents
Reflex and model based agents
 
Transportlayer tanenbaum
Transportlayer tanenbaumTransportlayer tanenbaum
Transportlayer tanenbaum
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 

Viewers also liked

Lecture 09 uninformed problem solving
Lecture 09 uninformed problem solvingLecture 09 uninformed problem solving
Lecture 09 uninformed problem solving
Hema Kashyap
 
Lecture 23 alpha beta pruning
Lecture 23 alpha beta pruningLecture 23 alpha beta pruning
Lecture 23 alpha beta pruning
Hema Kashyap
 
Alpha beta pruning
Alpha beta pruningAlpha beta pruning
Alpha beta pruning
Nilesh Bandekar
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
Rajendran
 
Searchadditional2
Searchadditional2Searchadditional2
Searchadditional2chandsek666
 
17 1 knowledge-based system
17 1 knowledge-based system17 1 knowledge-based system
17 1 knowledge-based system
Tianlu Wang
 
Artificial Intelligence
Artificial Intelligence Artificial Intelligence
Artificial Intelligence
Muhammad Ahad
 
Core java tutorial
Core java tutorialCore java tutorial
Core java tutorial
Niraj Bharambe
 
The Unified Modelling Lanage (UML)
The Unified Modelling Lanage (UML)The Unified Modelling Lanage (UML)
The Unified Modelling Lanage (UML)
CC Nakhon Pathom Rajabhat University
 
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
Niraj Bharambe
 
Heuristic Search
Heuristic SearchHeuristic Search
Heuristic Searchbutest
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
Hema Kashyap
 
Uml
UmlUml
Uml
parag
 
Advance Java
Advance JavaAdvance Java
Advance Java
Vidyacenter
 
(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 logic
Hema Kashyap
 

Viewers also liked (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
 

Similar to Lecture 12 Heuristic Searches

A star algorithms
A star algorithmsA star algorithms
A star algorithms
sandeep54552
 
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.pptx
rakeshkumar12020604
 
AI unit-2 lecture notes.docx
AI unit-2 lecture notes.docxAI unit-2 lecture notes.docx
AI unit-2 lecture notes.docx
CS50Bootcamp
 
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
Asst.prof M.Gokilavani
 
Best First Search.pptx
Best First Search.pptxBest First Search.pptx
Best First Search.pptx
MuktarulHoque1
 
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
 
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
mmpnair0
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
SigSegVSquad
 
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
RahulkumarTivarekar1
 
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
LakshmiSamivel
 
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
SlimAmiri
 
Lec 2 1 informed search
Lec 2 1  informed searchLec 2 1  informed search
Lec 2 1 informed search
Eyob Sisay
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
DrYogeshDeshmukh1
 
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
RaviKiranVarma4
 
Y11 m02 networks
Y11 m02  networksY11 m02  networks
Y11 m02 networks
Xu Wei
 
Artificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptxArtificial Intelligence_Searching.pptx
Artificial Intelligence_Searching.pptx
Ratnakar Mikkili
 
Lecture 08 uninformed search techniques
Lecture 08 uninformed search techniquesLecture 08 uninformed search techniques
Lecture 08 uninformed search techniques
Hema Kashyap
 
Breadth first search (bfs)
Breadth first search (bfs)Breadth first search (bfs)
Breadth first search (bfs)
Bishal Bhandari
 

Similar to 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
 
uniformed (also called blind search algo)
uniformed (also called blind search algo)uniformed (also called blind search algo)
uniformed (also called blind search algo)
 
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
 
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)
 

More from Hema Kashyap

Lecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-exampleLecture 29 genetic algorithm-example
Lecture 29 genetic algorithm-example
Hema Kashyap
 
Lecture 28 genetic algorithm
Lecture 28 genetic algorithmLecture 28 genetic algorithm
Lecture 28 genetic algorithm
Hema Kashyap
 
Lecture 27 simulated annealing
Lecture 27 simulated annealingLecture 27 simulated annealing
Lecture 27 simulated annealing
Hema Kashyap
 
Lecture 26 local beam search
Lecture 26 local beam searchLecture 26 local beam search
Lecture 26 local beam search
Hema Kashyap
 
Lecture 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbing
Hema Kashyap
 
Lecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithmLecture 24 iterative improvement algorithm
Lecture 24 iterative improvement algorithm
Hema Kashyap
 
Lecture 22 adversarial search
Lecture 22 adversarial searchLecture 22 adversarial search
Lecture 22 adversarial search
Hema Kashyap
 
Lecture 20 problem reduction search
Lecture 20 problem reduction searchLecture 20 problem reduction search
Lecture 20 problem reduction search
Hema Kashyap
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithm
Hema 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 algorithm
Hema 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 algorithm
Hema Kashyap
 
Lecture 15 monkey banana problem
Lecture 15 monkey banana problemLecture 15 monkey banana problem
Lecture 15 monkey banana problem
Hema Kashyap
 
Lecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problemLecture 13 Criptarithmetic problem
Lecture 13 Criptarithmetic problem
Hema 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 techniques
Hema Kashyap
 
Lecture 06 production system
Lecture 06 production systemLecture 06 production system
Lecture 06 production system
Hema Kashyap
 
Lecture 05 problem solving through ai
Lecture 05 problem solving through aiLecture 05 problem solving through ai
Lecture 05 problem solving through ai
Hema Kashyap
 
Lecture 04 intelligent agents
Lecture 04 intelligent agentsLecture 04 intelligent agents
Lecture 04 intelligent agents
Hema Kashyap
 
Lecture 03 introduction to artificial intelligence
Lecture 03 introduction to artificial intelligenceLecture 03 introduction to artificial intelligence
Lecture 03 introduction to artificial intelligence
Hema Kashyap
 
Lecture 02 introduction to ai
Lecture 02 introduction to aiLecture 02 introduction to ai
Lecture 02 introduction to ai
Hema Kashyap
 

More from 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 25 hill climbing
Lecture 25 hill climbingLecture 25 hill climbing
Lecture 25 hill climbing
 
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 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 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
 
Lecture 02 introduction to ai
Lecture 02 introduction to aiLecture 02 introduction to ai
Lecture 02 introduction to ai
 

Recently uploaded

Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 

Recently uploaded (20)

Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Vaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdfVaccine management system project report documentation..pdf
Vaccine management system project report documentation..pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 

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