SlideShare a Scribd company logo
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
Best-First Search Algorithm
• 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.
• By doing this check, we can guarantee that each node only appears once in the graph, although many nodes
may point to it as a successor.
• To implement such a graph-search procedure, we will need to use two lists of nodes:
• OPEN — nodes that have been generated and have had the heuristic function applied to them but which have
not yet been examined (i.e., had their successors generated).
• CLOSED — nodes that have already been examined. We need to keep these nodes in memory if we want to
search a graph rather than a tree since whenever a new node is generated, we need to check whether it has
been generated before.
• Step 1: Place the starting node into the OPEN list.
• Step 2: If the OPEN list is empty, Stop and return failure.
• Step 3: Remove the node n, from the OPEN list which has the lowest value of
h(n), and places it in the CLOSED list.
• Step 4: Expand the node n, and generate the successors of node n.
• Step 5: Check each successor of node n, and find whether any node is a goal
node or not. If any successor node is goal node, then return success and
terminate the search, else proceed to Step 6.
• Step 6: For each successor node, algorithm checks for evaluation function f(n),
and then check if the node has been in either OPEN or CLOSED list. If the node
has not been in both list, then add it to the OPEN list.
• Step 7: Return to Step 2.
Advantages:
• Best first search can switch between BFS and DFS by gaining the
advantages of both the algorithms.
• This algorithm is more efficient than BFS and DFS algorithms.
Disadvantages:
• It can behave as an unguided depth-first search in the worst case
scenario.
• It can get stuck in a loop as DFS.
• This algorithm is not optimal.
Consider the below search problem, and we will traverse it using greedy best-first search. At each
iteration, each node is expanded using evaluation function f(n)=h(n) , which is given in the below
table.
• In this search example, we are using
two lists which are OPEN and CLOSED
Lists. Following are the iteration for
traversing the above example
Expand the nodes of S and put in the CLOSED list
Initialization: Open [A, B], Closed [S]
Iteration 1: Open [A], Closed [S, B]
Iteration 2: Open [E, F, A], Closed [S, B]
: Open [E, A], Closed [S, B, F]
Iteration 3: Open [I, G, E, A], Closed [S, B, F]
: Open [I, E, A], Closed [S, B, F, G]
Hence the final solution path will be: S----> B----->F----> G
A* search finds the shortest path through a search space to the goal state using the heuristic function. This
technique finds minimal cost solutions and is directed to a goal state called A* search. In A*, the * is written for
optimality purposes. The A* algorithm also finds the lowest-cost path between the start and goal state, where
changing from one state to another requires some cost.
A* search
A* requires the heuristic function to evaluate the cost of the path that passes through the particular state. This
algorithm is complete if the branching factor is finite and every action has a fixed cost. A* requires the heuristic
function to evaluate the cost of the path that passes through the particular state. It can be defined by the following
formula.
f(n) = g(n) + h(n)
Where
g(n): The actual cost path from the start state to the current state.
h(n): The actual cost path from the current state to the goal state.
f(n): The actual cost path from the start state to the goal state.
A* Search Algorithm in Artficial Intelligence:
Step 1: Place the starting node into OPEN and find its f (n) value.
Step 2: Remove the node from OPEN, having the smallest f (n) value. If it is a goal node
then stop and return success.
Step 3: Else remove the node from OPEN, find all its successors.
Step 4: Find the f (n) value of all successors; place them into OPEN and place the
removed node into CLOSE.
Step 5: Go to Step-2.
Step 6: Exit.
Example
informed search.pptx
informed search.pptx

More Related Content

PPTX
A star algorithms
PDF
Unit-3 (2).pdf WEAK SLOT-AND-FILLER STRUCTURES
PPT
Heuristic Search Techniques {Artificial Intelligence}
PPTX
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
PDF
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
PPTX
Mod3_AI_UPDATED 4th sem engineering.pptx
PPTX
Informed Search Techniques new kirti L 8.pptx
PDF
UNIT 2 - Artificial intelligence merged.pdf
A star algorithms
Unit-3 (2).pdf WEAK SLOT-AND-FILLER STRUCTURES
Heuristic Search Techniques {Artificial Intelligence}
Artificial Intelligence_Anjali_Kumari_26900122059.pptx
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
Mod3_AI_UPDATED 4th sem engineering.pptx
Informed Search Techniques new kirti L 8.pptx
UNIT 2 - Artificial intelligence merged.pdf

Similar to informed search.pptx (20)

PPT
unit-1-l3AI..........................ppt
PPTX
heuristic technique.pptx...............................
DOCX
AI unit-2 lecture notes.docx
PPTX
AI BEST FIRST,A-STAR,AO-STAR SEARCH.pptx
PPTX
Best First Search.pptx
PPTX
Heuristic Searching Algorithms Artificial Intelligence.pptx
PPTX
Informed Search in Artifical Intelligence
PPTX
AI_Lec2.pptx dive in to ai hahahahahahah
PPTX
AI UNIT 2 PPT AI UNIT 2 PPT AI UNIT 2 PPT.pptx
PDF
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
PPTX
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPTX
Artificial Intelligence_Searching.pptx
PPTX
A star algorithm with Pseudcode AI.pptx
PPTX
Heuristic or informed search
PPTX
Artificial intelligence with the help of
PPTX
Problem Solving through Search - Uninformed Search
PPTX
484507360-Lecture-4-Heuristic-Search-Strategies.pptx
PDF
AI Lesson 04
PPTX
Lecture # 02-Search Algorithms11111.pptx
PPT
Heuristic Search Techniques Unit -II.ppt
unit-1-l3AI..........................ppt
heuristic technique.pptx...............................
AI unit-2 lecture notes.docx
AI BEST FIRST,A-STAR,AO-STAR SEARCH.pptx
Best First Search.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
Informed Search in Artifical Intelligence
AI_Lec2.pptx dive in to ai hahahahahahah
AI UNIT 2 PPT AI UNIT 2 PPT AI UNIT 2 PPT.pptx
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
Artificial Intelligence_Searching.pptx
A star algorithm with Pseudcode AI.pptx
Heuristic or informed search
Artificial intelligence with the help of
Problem Solving through Search - Uninformed Search
484507360-Lecture-4-Heuristic-Search-Strategies.pptx
AI Lesson 04
Lecture # 02-Search Algorithms11111.pptx
Heuristic Search Techniques Unit -II.ppt
Ad

Recently uploaded (20)

PPT
Mechanical Engineering MATERIALS Selection
PDF
Well-logging-methods_new................
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
DOCX
573137875-Attendance-Management-System-original
PDF
PPT on Performance Review to get promotions
PPTX
additive manufacturing of ss316l using mig welding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPT
Project quality management in manufacturing
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
OOP with Java - Java Introduction (Basics)
Mechanical Engineering MATERIALS Selection
Well-logging-methods_new................
Internet of Things (IOT) - A guide to understanding
Structs to JSON How Go Powers REST APIs.pdf
Lesson 3_Tessellation.pptx finite Mathematics
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
573137875-Attendance-Management-System-original
PPT on Performance Review to get promotions
additive manufacturing of ss316l using mig welding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Arduino robotics embedded978-1-4302-3184-4.pdf
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Project quality management in manufacturing
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
OOP with Java - Java Introduction (Basics)
Ad

informed search.pptx

  • 1. 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 Best-First Search Algorithm
  • 2. • 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. • By doing this check, we can guarantee that each node only appears once in the graph, although many nodes may point to it as a successor. • To implement such a graph-search procedure, we will need to use two lists of nodes: • OPEN — nodes that have been generated and have had the heuristic function applied to them but which have not yet been examined (i.e., had their successors generated). • CLOSED — nodes that have already been examined. We need to keep these nodes in memory if we want to search a graph rather than a tree since whenever a new node is generated, we need to check whether it has been generated before.
  • 3. • Step 1: Place the starting node into the OPEN list. • Step 2: If the OPEN list is empty, Stop and return failure. • Step 3: Remove the node n, from the OPEN list which has the lowest value of h(n), and places it in the CLOSED list. • Step 4: Expand the node n, and generate the successors of node n. • Step 5: Check each successor of node n, and find whether any node is a goal node or not. If any successor node is goal node, then return success and terminate the search, else proceed to Step 6. • Step 6: For each successor node, algorithm checks for evaluation function f(n), and then check if the node has been in either OPEN or CLOSED list. If the node has not been in both list, then add it to the OPEN list. • Step 7: Return to Step 2.
  • 4. Advantages: • Best first search can switch between BFS and DFS by gaining the advantages of both the algorithms. • This algorithm is more efficient than BFS and DFS algorithms. Disadvantages: • It can behave as an unguided depth-first search in the worst case scenario. • It can get stuck in a loop as DFS. • This algorithm is not optimal.
  • 5. Consider the below search problem, and we will traverse it using greedy best-first search. At each iteration, each node is expanded using evaluation function f(n)=h(n) , which is given in the below table.
  • 6. • In this search example, we are using two lists which are OPEN and CLOSED Lists. Following are the iteration for traversing the above example Expand the nodes of S and put in the CLOSED list Initialization: Open [A, B], Closed [S] Iteration 1: Open [A], Closed [S, B] Iteration 2: Open [E, F, A], Closed [S, B] : Open [E, A], Closed [S, B, F] Iteration 3: Open [I, G, E, A], Closed [S, B, F] : Open [I, E, A], Closed [S, B, F, G] Hence the final solution path will be: S----> B----->F----> G
  • 7. A* search finds the shortest path through a search space to the goal state using the heuristic function. This technique finds minimal cost solutions and is directed to a goal state called A* search. In A*, the * is written for optimality purposes. The A* algorithm also finds the lowest-cost path between the start and goal state, where changing from one state to another requires some cost. A* search A* requires the heuristic function to evaluate the cost of the path that passes through the particular state. This algorithm is complete if the branching factor is finite and every action has a fixed cost. A* requires the heuristic function to evaluate the cost of the path that passes through the particular state. It can be defined by the following formula. f(n) = g(n) + h(n) Where g(n): The actual cost path from the start state to the current state. h(n): The actual cost path from the current state to the goal state. f(n): The actual cost path from the start state to the goal state.
  • 8. A* Search Algorithm in Artficial Intelligence: Step 1: Place the starting node into OPEN and find its f (n) value. Step 2: Remove the node from OPEN, having the smallest f (n) value. If it is a goal node then stop and return success. Step 3: Else remove the node from OPEN, find all its successors. Step 4: Find the f (n) value of all successors; place them into OPEN and place the removed node into CLOSE. Step 5: Go to Step-2. Step 6: Exit.