SlideShare a Scribd company logo
1 of 17
GOVERNMENT COLLEGE OF ENGINEERING &
TEXTILE TECHNOLOGY, SERAMPORE
NAME-MUKTARUL HOQUE
STREAM-INFORMATION TECHNOLOGY
ROLL-11000220015
SUBJECT-ARTIFICIAL INTELLIGENCE
BEST FIRST SEARCH ALGORITHM
Guided By Mr. Biplab Mahapatra(State Aided College Teacher,IT
Depaerment)
Defination:
Best first search is a traversal technique that decides which node is to be
visited next by checking which node is the most promising one and then
check it. For this it uses an evaluation function to decide the traversal.
This best first search technique of tree traversal comes under the category
of heuristic search or informed search technique.
The cost of nodes is stored in a priority queue. This makes implementation
of best-first search is same as that of breadth First search. We will use the
priorityqueue just like we use a queue for BFS
PROCESS
We have studied two uninformed search algorithms such
as Breadth First search (BFS) and Depth First
search(DFS) Algorithm.
DFS is good because it allows a solution to be found
without all competing branches having to be expanded
BFS is good because it does not get branches on
dead-end paths
One way of combining the two is to follow a single path
at a time, but switch paths whenever some competing
path looks more promising than the current one does.
At each step of the BFS search process, we select
the most promising of the nodes we have
generated so far
.
This is done by applying an appropriate heuristic
function to each of them.
We then expand the chosen node by using the rules
to generate its successors
It proceeds in steps, expanding one node at each
step until it generates a node that corresponds to a
goal state.
At each step, it picks the most promising of the nodes
that have so far been generated but not expanded.
It generates the successors of the chosen node,
applies the heuristic function to them, and adds
them to the list of open nodes, after checking to see
if any of them have been generated before.
ALGORITHM: BEST-FIRST SEARCH
 1. Start with OPEN containing just the initial state
 2. Until a goal is found or there are no nodes left on
OPEN do:
a) Pick them best node on OPEN.
b) Generate its successors.
c) For each successor do:
i) if it has not been generated
before, evaluate it, add it to OPEN, and record its
parent.
ii) If it has been generated before,
change the parent if this new path is better than the
previous one. In that case, update the cost of getting to
this node and to any successors that this node may
already have.
EXAMPLE: BEST-FIRST SEARCH
Q.Here C is the initial or source node and L and Z are
goal nodes.
Open: C
Closed: —
Now, C is added to Closed, and B, T, O, E and P are
added to Open.
Open: T, O, E, B, P
Closed: C
 Now, T has the least distance hence, T is added to
Closed.
Open: O, E, B, P
Closed: C, T
 As T does not have any successors, the next node
from open that is O is removed from Open and
added to closed.
Open: E, B, P
Closed: C, T, O
 The successors of node O that is node I and N are
added to Open.
Open: I, E, B, P, N
Closed: C, T, O
 Now, node I is removed from Open and added to
closed.
Open: E, B, P, N
Closed: C, T, O, I
 The successor of I that is Z is added to Open.
Open: Z, E, B, P, N
Closed: C, T, O, I
 Now, node Z is removed from Open and added to
closed.
 Open: E, B, P, N
 Closed: C, T, O, I, Z
The Goal is found. The final path is C – O – I – Z.
CONCLUSION
1. Can switch between BFS and DFS, thus gaining
the advantages of both.
2. More efficient when compared to DFS.
REFERENCES
https://www.tutorialspoint.com/best-first-search-
informed-search
https://www.geeksforgeeks.org/best-first-search-
informed-search/
https://www.javatpoint.com/ai-informed-search-
algorithms
THANK YOU

More Related Content

Similar to Best First Search.pptx

Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
CCBProduction
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
Swagat Praharaj
 

Similar to Best First Search.pptx (20)

AI Lesson 04
AI Lesson 04AI Lesson 04
AI Lesson 04
 
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptxArtificial Intelligence_Anjali_Kumari_26900122059.pptx
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
 
Comparison of various heuristic
Comparison of various heuristicComparison of various heuristic
Comparison of various heuristic
 
Lecture 12 Heuristic Searches
Lecture 12 Heuristic SearchesLecture 12 Heuristic Searches
Lecture 12 Heuristic Searches
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Adsa u2 ver 1.0.
Adsa u2 ver 1.0.Adsa u2 ver 1.0.
Adsa u2 ver 1.0.
 
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
 
Best first search algorithm in Artificial Intelligence
Best first search algorithm in Artificial IntelligenceBest first search algorithm in Artificial Intelligence
Best first search algorithm in Artificial Intelligence
 
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
 
AI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxAI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptx
 
Informed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxInformed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptx
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
Heuristis search
Heuristis searchHeuristis search
Heuristis search
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
 
Informed search (bst)
Informed search (bst)Informed search (bst)
Informed search (bst)
 
R01741124127
R01741124127R01741124127
R01741124127
 
Ai1.pdf
Ai1.pdfAi1.pdf
Ai1.pdf
 
Thr russian doll search
Thr russian doll searchThr russian doll search
Thr russian doll search
 

Recently uploaded

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 

Recently uploaded (20)

Augmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptxAugmented Reality (AR) with Augin Software.pptx
Augmented Reality (AR) with Augin Software.pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 
Databricks Generative AI Fundamentals .pdf
Databricks Generative AI Fundamentals  .pdfDatabricks Generative AI Fundamentals  .pdf
Databricks Generative AI Fundamentals .pdf
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Fundamentals of Internet of Things (IoT) Part-2
Fundamentals of Internet of Things (IoT) Part-2Fundamentals of Internet of Things (IoT) Part-2
Fundamentals of Internet of Things (IoT) Part-2
 
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
Unsatisfied Bhabhi ℂall Girls Ahmedabad Book Esha 6378878445 Top Class ℂall G...
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Path loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata ModelPath loss model, OKUMURA Model, Hata Model
Path loss model, OKUMURA Model, Hata Model
 

Best First Search.pptx

  • 1. GOVERNMENT COLLEGE OF ENGINEERING & TEXTILE TECHNOLOGY, SERAMPORE NAME-MUKTARUL HOQUE STREAM-INFORMATION TECHNOLOGY ROLL-11000220015 SUBJECT-ARTIFICIAL INTELLIGENCE
  • 2. BEST FIRST SEARCH ALGORITHM Guided By Mr. Biplab Mahapatra(State Aided College Teacher,IT Depaerment) Defination: Best first search is a traversal technique that decides which node is to be visited next by checking which node is the most promising one and then check it. For this it uses an evaluation function to decide the traversal. This best first search technique of tree traversal comes under the category of heuristic search or informed search technique. The cost of nodes is stored in a priority queue. This makes implementation of best-first search is same as that of breadth First search. We will use the priorityqueue just like we use a queue for BFS
  • 3. PROCESS We have studied two uninformed search algorithms such as Breadth First search (BFS) and Depth First search(DFS) Algorithm. DFS is good because it allows a solution to be found without all competing branches having to be expanded BFS is good because it does not get branches on dead-end paths One way of combining the two is to follow a single path at a time, but switch paths whenever some competing path looks more promising than the current one does.
  • 4. At each step of the BFS search process, we select the most promising of the nodes we have generated so far . This is done by applying an appropriate heuristic function to each of them. We then expand the chosen node by using the rules to generate its successors It proceeds in steps, expanding one node at each step until it generates a node that corresponds to a goal state.
  • 5. At each step, it picks the most promising of the nodes that have so far been generated but not expanded. It generates the successors of the chosen node, applies the heuristic function to them, and adds them to the list of open nodes, after checking to see if any of them have been generated before.
  • 6. ALGORITHM: BEST-FIRST SEARCH  1. Start with OPEN containing just the initial state  2. Until a goal is found or there are no nodes left on OPEN do: a) Pick them best node on OPEN. b) Generate its successors. c) For each successor do: i) if it has not been generated before, evaluate it, add it to OPEN, and record its parent. ii) If it has been generated before, change the parent if this new path is better than the previous one. In that case, update the cost of getting to this node and to any successors that this node may already have.
  • 7. EXAMPLE: BEST-FIRST SEARCH Q.Here C is the initial or source node and L and Z are goal nodes. Open: C Closed: —
  • 8. Now, C is added to Closed, and B, T, O, E and P are added to Open. Open: T, O, E, B, P Closed: C
  • 9.  Now, T has the least distance hence, T is added to Closed. Open: O, E, B, P Closed: C, T
  • 10.  As T does not have any successors, the next node from open that is O is removed from Open and added to closed. Open: E, B, P Closed: C, T, O
  • 11.  The successors of node O that is node I and N are added to Open. Open: I, E, B, P, N Closed: C, T, O
  • 12.  Now, node I is removed from Open and added to closed. Open: E, B, P, N Closed: C, T, O, I
  • 13.  The successor of I that is Z is added to Open. Open: Z, E, B, P, N Closed: C, T, O, I
  • 14.  Now, node Z is removed from Open and added to closed.  Open: E, B, P, N  Closed: C, T, O, I, Z The Goal is found. The final path is C – O – I – Z.
  • 15. CONCLUSION 1. Can switch between BFS and DFS, thus gaining the advantages of both. 2. More efficient when compared to DFS.