AI3391 ARTIFICAL INTELLIGENCE
(II YEAR (III Sem))
Department of Artificial Intelligence and Data Science
Session 10
by
Asst.Prof.M.Gokilavani
NIET
11/14/2023 Department of AI & DS 1
TEXTBOOK:
• Artificial Intelligence A modern Approach, Third Edition, Stuart Russell
and Peter Norvig, Pearson Education.
REFERENCES:
• Artificial Intelligence, 3rd Edn, E. Rich and K.Knight (TMH).
• Artificial Intelligence, 3rd Edn, Patrick Henny Winston, Pearson
Education.
• Artificial Intelligence, Shivani Goel, Pearson Education.
• Artificial Intelligence and Expert Systems- Patterson, Pearson Education.
11/14/2023 Department of CSE (AI/ML) 2
Topics covered in session 10
11/14/2023 Department of AI & DS 3
Unit II: Problem Solving
• Heuristic search Strategies
• Heuristic function
• Local search and optimization problems
• Local search in continuous space
• Search with non deterministic actions
• Search in partial observation environments
• Online search agents and unknown environment
A* Algorithm
• A* Algorithm is one of the best and popular techniques used for path
finding and graph traversals.
• A lot of games and web-based maps use this algorithm for finding the
shortest path efficiently.
• It is essentially a best first search algorithm.
• This is informed search technique also called as HEURISTIC search.
This algo. Works using heuristic value.
11/14/2023 Department of CSE (AI/ML) 4
Working of A* Search algorithm
A* Algorithm works as-
• It maintains a tree of paths originating at the start node.
• It extends those paths one edge at a time.
• It continues until its termination criterion is satisfied.
• A* Algorithm extends the path that minimizes the following function-
• Evaluation function f(n) = g(n) + h(n)
Here,
• ‘n’ is the last node on the path
• g(n) is the cost of the path from start node to node ‘n’
• h(n) is a heuristic function that estimates cost of the cheapest
path from node ‘n’ to the goal node
11/14/2023 Department of CSE (AI/ML) 5
A* search Algorithm
• The implementation of A* Algorithm involves maintaining two lists-
OPEN and CLOSED.
• OPEN contains those nodes that have been evaluated by the heuristic
function but have not been expanded into successors yet.
• CLOSED contains those nodes that have already been visited.
• The algorithm is as follows-
• Step-01:
• Define a list OPEN.
• Initially, OPEN consists solely of a single node, the start node S.
• Step-02:
• If the list is empty, return failure and exit.
11/14/2023 Department of CSE (AI/ML) 6
A* search Algorithm
• Step-03: Remove node n with the smallest value of f(n) from OPEN
and move it to list CLOSED.
• If node n is a goal state, return success and exit.
• Step-04:Expand node n.
• Step-05: If any successor to n is the goal node, return success and the
solution by tracing the path from goal node to S.
• Otherwise, go to Step-06.
• Step-06: For each successor node,
• Apply the evaluation function f to the node.
• If the node has not been in either list, add it to OPEN.
• Step-07: Go back to Step-02.
11/14/2023 Department of CSE (AI/ML) 7
Example with
Solution
Consider the following
graph,
• The numbers written on
edges represent the
distance between the
nodes.
• The numbers written on
nodes represent the
heuristic value.
• Find the most cost-
effective path to reach
from start state A to final
state J using A* Algorithm.
11/14/2023 Department of CSE (AI/ML) 8
Step-01:
• We start with node A.
• Node B and Node F can be reached from node A.
A* Algorithm calculates f(B) and f(F).
• f(B) = 6 + 8 = 14
• f(F) = 3 + 6 = 9
Since f(F) < f(B), so it decides to go to node F.
Path- A → F
11/14/2023 Department of CSE (AI/ML) 9
Step-02:
• Node G and Node H can be reached from node F.
A* Algorithm calculates f(G) and f(H).
• f(G) = (3+1) + 5 = 9
• f(H) = (3+7) + 3 = 13
Since f(G) < f(H), so it decides to go to node G.
Path- A → F → G
11/14/2023 Department of CSE (AI/ML) 10
Step-03:
• Node I can be reached from node G.
• A* Algorithm calculates f(I).
f(I) = (3+1+3) + 1 = 8
• It decides to go to node I.
Path- A → F → G → I
11/14/2023 Department of CSE (AI/ML) 11
Step-04:
• Node E, Node H and Node J can be reached from node I.
• A* Algorithm calculates f(E), f(H) and f(J).
• f(E) = (3+1+3+5) + 3 = 15
• f(H) = (3+1+3+2) + 3 = 12
• f(J) = (3+1+3+3) + 0 = 10
• Since f(J) is least, so it decides to go to node J.
Path- A → F → G → I → J
• This is the required shortest path from node A to node J.
11/14/2023 Department of CSE (AI/ML) 12
Shortest path for the given tree
11/14/2023 Department of CSE (AI/ML) 13
11/14/2023 Department of CSE (AI/ML) 14
11/14/2023 Department of CSE (AI/ML) 15
Advantages of BFS
• A* Algorithm is one of the best path finding algorithms.
• It is Complete & Optimal
• Used to solve complex problems.
Disadvantages of BFS
• Requires more memory
11/14/2023 Department of CSE (AI/ML) 16
Topics to be covered in next session 11
• Beyond classical search: Hill- climbing Search
11/14/2023 Department of CSE (AI/ML) 17
Thank you!!!

More Related Content

PPTX
AI_Session 8 A searching algorithm .pptx
PDF
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
PPTX
AI3391 Session 9 Greedy Best first search algorithm.pptx
PPTX
A star algorithm with Pseudcode AI.pptx
PPTX
A Star Algorithm in Artificial intelligence
PPTX
AI_Session 7 Greedy Best first search algorithm.pptx
PDF
A* Search Algorithm
PPTX
A-star Algorithm in artificial intelligence.pptx
AI_Session 8 A searching algorithm .pptx
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 Session 9 Greedy Best first search algorithm.pptx
A star algorithm with Pseudcode AI.pptx
A Star Algorithm in Artificial intelligence
AI_Session 7 Greedy Best first search algorithm.pptx
A* Search Algorithm
A-star Algorithm in artificial intelligence.pptx

Similar to AI3391 Session 10 A searching algorithm.pptx (20)

PPTX
A* algorithm
PPTX
AI_CSE5005_M2_ASearch.pptx for the algorithm for machine
PPTX
Unit 3 Informed Search Strategies.pptx
PPTX
A* Algorithm
PPTX
Heuristic Searching Algorithms Artificial Intelligence.pptx
PPTX
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
PDF
IRJET- Artificial Algorithms Comparative Study
PDF
UNIT 2 - Artificial intelligence merged.pdf
PPTX
AI_Session 4 Uniformed search strategies.pptx
PPTX
A star algorithm in artificial intelligence
PPTX
A-Star Search(part-B) in artificial intelligence.pptx
PPTX
Artificial Intelligence and Machine Learning.pptx
PPTX
22PCOAM11 Unit 1: Session 4 BFS & DFS Alg
PPTX
heuristic technique.pptx...............................
PPTX
informed search.pptx
PPTX
AI_Lecture2.pptx
PDF
Pathfinding - Part 1: Α* heuristic search
PPT
Ch4: Searching Techniques 6_2018_12_25!05_35_25_PM.ppt
PPT
Heuristic Search Techniques Unit -II.ppt
A* algorithm
AI_CSE5005_M2_ASearch.pptx for the algorithm for machine
Unit 3 Informed Search Strategies.pptx
A* Algorithm
Heuristic Searching Algorithms Artificial Intelligence.pptx
AI3391 ARTIFICIAL INTELLIGENCE Session 7 Uniformed search strategies.pptx
IRJET- Artificial Algorithms Comparative Study
UNIT 2 - Artificial intelligence merged.pdf
AI_Session 4 Uniformed search strategies.pptx
A star algorithm in artificial intelligence
A-Star Search(part-B) in artificial intelligence.pptx
Artificial Intelligence and Machine Learning.pptx
22PCOAM11 Unit 1: Session 4 BFS & DFS Alg
heuristic technique.pptx...............................
informed search.pptx
AI_Lecture2.pptx
Pathfinding - Part 1: Α* heuristic search
Ch4: Searching Techniques 6_2018_12_25!05_35_25_PM.ppt
Heuristic Search Techniques Unit -II.ppt
Ad

More from Guru Nanak Technical Institutions (20)

PPTX
22PCOAM21 Data Quality Session 3 Data Quality.pptx
PPTX
22PCOAM21 Session 1 Data Management.pptx
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
PDF
III Year II Sem 22PCOAM21 Data Analytics Syllabus.pdf
PDF
22PCOAM16 _ML_Unit 3 Notes & Question bank
PDF
22PCOAM16 Machine Learning Unit V Full notes & QB
PDF
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
PDF
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
PPTX
22PCOAM16 Unit 3 Session 23 Different ways to Combine Classifiers.pptx
PPTX
22PCOAM16 Unit 3 Session 22 Ensemble Learning .pptx
PPTX
22PCOAM16 Unit 3 Session 24 K means Algorithms.pptx
PPTX
22PCOAM16 ML Unit 3 Session 18 Learning with tree.pptx
PPTX
22PCOAM16 ML Unit 3 Session 21 Classification and Regression Trees .pptx
PPTX
22PCOAM16 ML Unit 3 Session 20 ID3 Algorithm and working.pptx
PPTX
22PCOAM16 ML Unit 3 Session 19 Constructing Decision Trees.pptx
PDF
22PCOAM16 ML UNIT 2 NOTES & QB QUESTION WITH ANSWERS
PDF
22PCOAM16 _ML_ Unit 2 Full unit notes.pdf
PDF
22PCOAM16_ML_Unit 1 notes & Question Bank with answers.pdf
PDF
22PCOAM16_MACHINE_LEARNING_UNIT_I_NOTES.pdf
PPTX
22PCOAM16 Unit 2 Session 17 Support vector Machine.pptx
22PCOAM21 Data Quality Session 3 Data Quality.pptx
22PCOAM21 Session 1 Data Management.pptx
22PCOAM21 Session 2 Understanding Data Source.pptx
III Year II Sem 22PCOAM21 Data Analytics Syllabus.pdf
22PCOAM16 _ML_Unit 3 Notes & Question bank
22PCOAM16 Machine Learning Unit V Full notes & QB
22PCOAM16_MACHINE_LEARNING_UNIT_IV_NOTES_with_QB
22PCOAM16 ML Unit 3 Full notes PDF & QB.pdf
22PCOAM16 Unit 3 Session 23 Different ways to Combine Classifiers.pptx
22PCOAM16 Unit 3 Session 22 Ensemble Learning .pptx
22PCOAM16 Unit 3 Session 24 K means Algorithms.pptx
22PCOAM16 ML Unit 3 Session 18 Learning with tree.pptx
22PCOAM16 ML Unit 3 Session 21 Classification and Regression Trees .pptx
22PCOAM16 ML Unit 3 Session 20 ID3 Algorithm and working.pptx
22PCOAM16 ML Unit 3 Session 19 Constructing Decision Trees.pptx
22PCOAM16 ML UNIT 2 NOTES & QB QUESTION WITH ANSWERS
22PCOAM16 _ML_ Unit 2 Full unit notes.pdf
22PCOAM16_ML_Unit 1 notes & Question Bank with answers.pdf
22PCOAM16_MACHINE_LEARNING_UNIT_I_NOTES.pdf
22PCOAM16 Unit 2 Session 17 Support vector Machine.pptx
Ad

Recently uploaded (20)

PDF
August -2025_Top10 Read_Articles_ijait.pdf
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PPT
Total quality management ppt for engineering students
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
Design Guidelines and solutions for Plastics parts
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
CyberSecurity Mobile and Wireless Devices
PDF
Soil Improvement Techniques Note - Rabbi
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
August -2025_Top10 Read_Articles_ijait.pdf
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Total quality management ppt for engineering students
III.4.1.2_The_Space_Environment.p pdffdf
Abrasive, erosive and cavitation wear.pdf
Design Guidelines and solutions for Plastics parts
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
22EC502-MICROCONTROLLER AND INTERFACING-8051 MICROCONTROLLER.pdf
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Visual Aids for Exploratory Data Analysis.pdf
Management Information system : MIS-e-Business Systems.pptx
distributed database system" (DDBS) is often used to refer to both the distri...
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
CyberSecurity Mobile and Wireless Devices
Soil Improvement Techniques Note - Rabbi
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...

AI3391 Session 10 A searching algorithm.pptx

  • 1. AI3391 ARTIFICAL INTELLIGENCE (II YEAR (III Sem)) Department of Artificial Intelligence and Data Science Session 10 by Asst.Prof.M.Gokilavani NIET 11/14/2023 Department of AI & DS 1
  • 2. TEXTBOOK: • Artificial Intelligence A modern Approach, Third Edition, Stuart Russell and Peter Norvig, Pearson Education. REFERENCES: • Artificial Intelligence, 3rd Edn, E. Rich and K.Knight (TMH). • Artificial Intelligence, 3rd Edn, Patrick Henny Winston, Pearson Education. • Artificial Intelligence, Shivani Goel, Pearson Education. • Artificial Intelligence and Expert Systems- Patterson, Pearson Education. 11/14/2023 Department of CSE (AI/ML) 2
  • 3. Topics covered in session 10 11/14/2023 Department of AI & DS 3 Unit II: Problem Solving • Heuristic search Strategies • Heuristic function • Local search and optimization problems • Local search in continuous space • Search with non deterministic actions • Search in partial observation environments • Online search agents and unknown environment
  • 4. A* Algorithm • A* Algorithm is one of the best and popular techniques used for path finding and graph traversals. • A lot of games and web-based maps use this algorithm for finding the shortest path efficiently. • It is essentially a best first search algorithm. • This is informed search technique also called as HEURISTIC search. This algo. Works using heuristic value. 11/14/2023 Department of CSE (AI/ML) 4
  • 5. Working of A* Search algorithm A* Algorithm works as- • It maintains a tree of paths originating at the start node. • It extends those paths one edge at a time. • It continues until its termination criterion is satisfied. • A* Algorithm extends the path that minimizes the following function- • Evaluation function f(n) = g(n) + h(n) Here, • ‘n’ is the last node on the path • g(n) is the cost of the path from start node to node ‘n’ • h(n) is a heuristic function that estimates cost of the cheapest path from node ‘n’ to the goal node 11/14/2023 Department of CSE (AI/ML) 5
  • 6. A* search Algorithm • The implementation of A* Algorithm involves maintaining two lists- OPEN and CLOSED. • OPEN contains those nodes that have been evaluated by the heuristic function but have not been expanded into successors yet. • CLOSED contains those nodes that have already been visited. • The algorithm is as follows- • Step-01: • Define a list OPEN. • Initially, OPEN consists solely of a single node, the start node S. • Step-02: • If the list is empty, return failure and exit. 11/14/2023 Department of CSE (AI/ML) 6
  • 7. A* search Algorithm • Step-03: Remove node n with the smallest value of f(n) from OPEN and move it to list CLOSED. • If node n is a goal state, return success and exit. • Step-04:Expand node n. • Step-05: If any successor to n is the goal node, return success and the solution by tracing the path from goal node to S. • Otherwise, go to Step-06. • Step-06: For each successor node, • Apply the evaluation function f to the node. • If the node has not been in either list, add it to OPEN. • Step-07: Go back to Step-02. 11/14/2023 Department of CSE (AI/ML) 7
  • 8. Example with Solution Consider the following graph, • The numbers written on edges represent the distance between the nodes. • The numbers written on nodes represent the heuristic value. • Find the most cost- effective path to reach from start state A to final state J using A* Algorithm. 11/14/2023 Department of CSE (AI/ML) 8
  • 9. Step-01: • We start with node A. • Node B and Node F can be reached from node A. A* Algorithm calculates f(B) and f(F). • f(B) = 6 + 8 = 14 • f(F) = 3 + 6 = 9 Since f(F) < f(B), so it decides to go to node F. Path- A → F 11/14/2023 Department of CSE (AI/ML) 9
  • 10. Step-02: • Node G and Node H can be reached from node F. A* Algorithm calculates f(G) and f(H). • f(G) = (3+1) + 5 = 9 • f(H) = (3+7) + 3 = 13 Since f(G) < f(H), so it decides to go to node G. Path- A → F → G 11/14/2023 Department of CSE (AI/ML) 10
  • 11. Step-03: • Node I can be reached from node G. • A* Algorithm calculates f(I). f(I) = (3+1+3) + 1 = 8 • It decides to go to node I. Path- A → F → G → I 11/14/2023 Department of CSE (AI/ML) 11
  • 12. Step-04: • Node E, Node H and Node J can be reached from node I. • A* Algorithm calculates f(E), f(H) and f(J). • f(E) = (3+1+3+5) + 3 = 15 • f(H) = (3+1+3+2) + 3 = 12 • f(J) = (3+1+3+3) + 0 = 10 • Since f(J) is least, so it decides to go to node J. Path- A → F → G → I → J • This is the required shortest path from node A to node J. 11/14/2023 Department of CSE (AI/ML) 12
  • 13. Shortest path for the given tree 11/14/2023 Department of CSE (AI/ML) 13
  • 14. 11/14/2023 Department of CSE (AI/ML) 14
  • 15. 11/14/2023 Department of CSE (AI/ML) 15
  • 16. Advantages of BFS • A* Algorithm is one of the best path finding algorithms. • It is Complete & Optimal • Used to solve complex problems. Disadvantages of BFS • Requires more memory 11/14/2023 Department of CSE (AI/ML) 16
  • 17. Topics to be covered in next session 11 • Beyond classical search: Hill- climbing Search 11/14/2023 Department of CSE (AI/ML) 17 Thank you!!!