SlideShare a Scribd company logo
TriaRight:
The New Era of Learning
Welcome
To PACK
365
Module 02
A* Algorithm in AI
 What is an A* Algorithm in AI?
 Components of A* Algorithm
 How Does A* Algorithm Work?
 Applications of the A* Algorithm in AI
 Advantages of the A* Algorithm in AI
 Disadvantages of the A* Algorithm in AI
A* Algorithm in AI?
A* algorithm is a popular and effective algorithm used in
artificial intelligence for finding optimal paths and graph
traversal. It efficiently searches for the shortest path between
nodes in a graph by maintaining the cost to reach each node.
Each node represents a specific position in the grid.
A* algorithm is an example of informed search, as it combines the advantages of Dijkstra’s
algorithm (which guarantees the shortest path) and greedy best-first search (which uses
heuristics to prioritize nodes likely to lead to the goal). It uses a heuristic function (often
denoted as h(n)) that estimates the cost from a given node to the goal that leads to the most
optimal path to the desired node.
The algorithm maintains two lists: the open list and the closed list. It evaluates nodes based
on the sum of the costs to reach the node from the start (denoted as g(n)) and the heuristic
estimate to the goal (h(n)). The node with the lowest total cost (f(n) = g(n) + h(n)) is selected
from the open list for expansion. This process continues until the goal node is reached or
there are no more nodes to explore.
Components of A* Algorithm
The algorithm is implemented on a graph consisting of nodes (or vertices) connected by edges (or links).
Each node represents a state or a position in a space
•Cost Functions: A* uses two cost functions.
• g(n): The actual cost to reach a node from the start node
• h(n): The heuristic function estimating the cost from a node to the goal
The total cost for a node is given by the sum of these two functions: F(n)=G(n)+H(n)
•Open and Closed Lists: The algorithm maintains two lists: the open list and the closed list.
• The open list stores nodes that are candidates for evaluation.
• The closed list keeps track of nodes that have already been evaluated.
A-star  Algorithm in artificial intelligence.pptx
How Does A* Algorithm
Work?
To implement the A* algorithm in code, one must first understand how A* algorithm
works in the background. Here is a step-by-step guide on the working of A* algorithm:
Step 1: Initialization
•First, define the starting node and the goal node within the graph.
•Then, create two empty sets.
• Open Set: Stores nodes to be explored, initially containing only the starting node.
• Closed Set: Stores explored nodes.
Step 2: Start Iterating the Graph
•While the open set is not empty, select the node with the lowest f-score from the open set.
•This node will be the most eligible to reach the goal.
•Move the selected node from the open set to the closed set.
•Expand the current node: explore all its neighbors and their connections.
•For each neighbor, calculate g(n) and h(n), and then calculate the f-score for the starting node
using the
formula: f(n) = g(n) + h(n)
f(n): Initial f-score of the starting node
g(n): g-score of the starting node (always 0 for the starting node)
h(n): A heuristic estimate of the cost to reach the goal node from the starting node
A* algorithm iterates the whole graph by following the following steps:
•If the neighbor is not in the closed set
•If the neighbor is not in the open set, add it with its f-score.
•If the neighbor is already in the open set
•Update the neighbor’s g-score and f-score if the new ones are lower.
•If the neighbor is the goal node
•Reconstruct and return the shortest path from the starting node to the goal node by
tracing back through the g-score values.
Step 3: Termination
•If the open set becomes empty and the goal node is not found, there is no path from
the starting node to the goal node.
•By repeatedly selecting the node with the lowest f-score for expansion, the A*
algorithm efficiently explores the graph and ultimately finds the shortest path to the
goal.
Applications of the A* Algorithm in AI
 Robotics and Autonomous Vehicles
 Game Development
 GPS and Navigation Systems
 Logistics and Supply Chain Management
 Network Routing and Traffic Management
A-star  Algorithm in artificial intelligence.pptx
Advantages of the A* Algorithm in AI
 Optimal Searching
 Versatility
 Heuristic Approach
 Adaptability
Disadvantages of the A* Algorithm in AI
ₓ Memory Intensive
ₓ Heuristic Dependency
ₓ Doesn’t Adapt to Dynamic Environments
ₓ Not Always Efficient with High Costs
THANK
YOU

More Related Content

PPTX
AI_CSE5005_M2_ASearch.pptx for the algorithm for machine
PPTX
A-Star Search(part-B) in artificial intelligence.pptx
PDF
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
PPTX
A Star Algorithm in Artificial intelligence
PDF
Heuristic search for AI CSE EVE dsfdsf sdfdsfsdf sdfdsfdsfsd sdfsdfds
PPTX
A* algorithm
PPTX
A star algorithm with Pseudcode AI.pptx
PDF
Heuristic Searching: A* Search
AI_CSE5005_M2_ASearch.pptx for the algorithm for machine
A-Star Search(part-B) in artificial intelligence.pptx
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
A Star Algorithm in Artificial intelligence
Heuristic search for AI CSE EVE dsfdsf sdfdsfsdf sdfdsfdsfsd sdfsdfds
A* algorithm
A star algorithm with Pseudcode AI.pptx
Heuristic Searching: A* Search

Similar to A-star Algorithm in artificial intelligence.pptx (20)

PPTX
Artificial Intelligence and Machine Learning.pptx
PDF
A* Search Algorithm
PDF
UNIT 2 - Artificial intelligence merged.pdf
DOCX
Game Paper
PPTX
Implementing an 8-chip game based on the A algorithm.pptx
PPTX
AI_Session 8 A searching algorithm .pptx
PPT
Unit 2 Topic 4 Informed search strategies AO.ppt
PPTX
Lecture 14 Heuristic Search-A star algorithm
PDF
A* and Min-Max Searching Algorithms in AI , DSA.pdf
PDF
09 heuristic search
PDF
Analysis of Pathfinding Algorithms
PPTX
AI BEST FIRST,A-STAR,AO-STAR SEARCH.pptx
PPTX
A star algorithms
PDF
BCS515B Module3 vtu notes : Artificial Intelligence Module 3.pdf
PPTX
AO star algorithm -Adv-Ltms-comp AI.pptx
PPTX
Heuristic Searching Algorithms Artificial Intelligence.pptx
PPTX
heuristic technique.pptx...............................
PPTX
AI3391 Session 10 A searching algorithm.pptx
PPTX
141222 graphulo ingraphblas
 
PPTX
141205 graphulo ingraphblas
Artificial Intelligence and Machine Learning.pptx
A* Search Algorithm
UNIT 2 - Artificial intelligence merged.pdf
Game Paper
Implementing an 8-chip game based on the A algorithm.pptx
AI_Session 8 A searching algorithm .pptx
Unit 2 Topic 4 Informed search strategies AO.ppt
Lecture 14 Heuristic Search-A star algorithm
A* and Min-Max Searching Algorithms in AI , DSA.pdf
09 heuristic search
Analysis of Pathfinding Algorithms
AI BEST FIRST,A-STAR,AO-STAR SEARCH.pptx
A star algorithms
BCS515B Module3 vtu notes : Artificial Intelligence Module 3.pdf
AO star algorithm -Adv-Ltms-comp AI.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
heuristic technique.pptx...............................
AI3391 Session 10 A searching algorithm.pptx
141222 graphulo ingraphblas
 
141205 graphulo ingraphblas
Ad

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Computing-Curriculum for Schools in Ghana
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Cell Structure & Organelles in detailed.
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
O7-L3 Supply Chain Operations - ICLT Program
Pharma ospi slides which help in ospi learning
Anesthesia in Laparoscopic Surgery in India
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
RMMM.pdf make it easy to upload and study
Abdominal Access Techniques with Prof. Dr. R K Mishra
Supply Chain Operations Speaking Notes -ICLT Program
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
Computing-Curriculum for Schools in Ghana
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Sports Quiz easy sports quiz sports quiz
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Cell Structure & Organelles in detailed.
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
O7-L3 Supply Chain Operations - ICLT Program
Ad

A-star Algorithm in artificial intelligence.pptx

  • 1. TriaRight: The New Era of Learning Welcome To PACK 365
  • 3.  What is an A* Algorithm in AI?  Components of A* Algorithm  How Does A* Algorithm Work?  Applications of the A* Algorithm in AI  Advantages of the A* Algorithm in AI  Disadvantages of the A* Algorithm in AI
  • 4. A* Algorithm in AI? A* algorithm is a popular and effective algorithm used in artificial intelligence for finding optimal paths and graph traversal. It efficiently searches for the shortest path between nodes in a graph by maintaining the cost to reach each node. Each node represents a specific position in the grid.
  • 5. A* algorithm is an example of informed search, as it combines the advantages of Dijkstra’s algorithm (which guarantees the shortest path) and greedy best-first search (which uses heuristics to prioritize nodes likely to lead to the goal). It uses a heuristic function (often denoted as h(n)) that estimates the cost from a given node to the goal that leads to the most optimal path to the desired node. The algorithm maintains two lists: the open list and the closed list. It evaluates nodes based on the sum of the costs to reach the node from the start (denoted as g(n)) and the heuristic estimate to the goal (h(n)). The node with the lowest total cost (f(n) = g(n) + h(n)) is selected from the open list for expansion. This process continues until the goal node is reached or there are no more nodes to explore.
  • 6. Components of A* Algorithm The algorithm is implemented on a graph consisting of nodes (or vertices) connected by edges (or links). Each node represents a state or a position in a space •Cost Functions: A* uses two cost functions. • g(n): The actual cost to reach a node from the start node • h(n): The heuristic function estimating the cost from a node to the goal The total cost for a node is given by the sum of these two functions: F(n)=G(n)+H(n) •Open and Closed Lists: The algorithm maintains two lists: the open list and the closed list. • The open list stores nodes that are candidates for evaluation. • The closed list keeps track of nodes that have already been evaluated.
  • 8. How Does A* Algorithm Work? To implement the A* algorithm in code, one must first understand how A* algorithm works in the background. Here is a step-by-step guide on the working of A* algorithm: Step 1: Initialization •First, define the starting node and the goal node within the graph. •Then, create two empty sets. • Open Set: Stores nodes to be explored, initially containing only the starting node. • Closed Set: Stores explored nodes.
  • 9. Step 2: Start Iterating the Graph •While the open set is not empty, select the node with the lowest f-score from the open set. •This node will be the most eligible to reach the goal. •Move the selected node from the open set to the closed set. •Expand the current node: explore all its neighbors and their connections. •For each neighbor, calculate g(n) and h(n), and then calculate the f-score for the starting node using the formula: f(n) = g(n) + h(n)
  • 10. f(n): Initial f-score of the starting node g(n): g-score of the starting node (always 0 for the starting node) h(n): A heuristic estimate of the cost to reach the goal node from the starting node A* algorithm iterates the whole graph by following the following steps: •If the neighbor is not in the closed set •If the neighbor is not in the open set, add it with its f-score. •If the neighbor is already in the open set •Update the neighbor’s g-score and f-score if the new ones are lower. •If the neighbor is the goal node •Reconstruct and return the shortest path from the starting node to the goal node by tracing back through the g-score values.
  • 11. Step 3: Termination •If the open set becomes empty and the goal node is not found, there is no path from the starting node to the goal node. •By repeatedly selecting the node with the lowest f-score for expansion, the A* algorithm efficiently explores the graph and ultimately finds the shortest path to the goal.
  • 12. Applications of the A* Algorithm in AI  Robotics and Autonomous Vehicles  Game Development  GPS and Navigation Systems  Logistics and Supply Chain Management  Network Routing and Traffic Management
  • 14. Advantages of the A* Algorithm in AI  Optimal Searching  Versatility  Heuristic Approach  Adaptability
  • 15. Disadvantages of the A* Algorithm in AI ₓ Memory Intensive ₓ Heuristic Dependency ₓ Doesn’t Adapt to Dynamic Environments ₓ Not Always Efficient with High Costs