SlideShare a Scribd company logo
CSCI 6212
Presented by Team Flash
Member: Shuqing Zhang
Yang Cao
Tong Qiao
A* Algorithm
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 1
 A* is one of the many search algorithm that take an input, evaluates a
number of possible paths and returns a solution.
 A* combines feartures of uniform-cost search and pure heuristic search to
effectively compute optimal solutions
 A* evaluates nodes by combining g(n) and h(n) f(n) = g(n) + h(n)
 f(n) is called evaluation function.
 A* is both complete and optimal.
Introduction
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 2
 f(n) = g(n) + h(n)
 f(n) is the estimated total cost of the cheapest solution through n
 g(n) gives the path cost from the start node to node n
 h(n) named as heuristic function is the estimated cost of the cheapest path
from n to the goal node.
Evaluation Function
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 3
Algorithm Process
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 4
 Given: A graph of nodes, is start, is goal
 Aim: To find out the path from to with the minimum cost
 Procedure
1. Create a search graph G, consisting solely of the start node s. Put s on a list called OPEN.
2. Create a list called CLOSED that is initially empty.
3. LOOP: if OPEN is empty, exit with failure
4. Select the first node on OPEN, remove it from OPEN and put it into CLOSED. Call this node n.
5. If n is a goal node, exit successfully with the solution obtained by tracing a path along the pointers from n to s in G.
6. Expand node n, generating the set M of its successors and install them as successors of n in G.
7. Establish a pointer to n from those members of M that were not already in G(i.e not already on either OPEN or CLOSED). Add these members of M to
OPEN. For each member of M that was already on OPEN or CLOSED, decide whether or not to redircet its pointer to n. For each member of M already
on CLOSED, decide for each its descendents in G whether or not to redirect its pointer.
8. Recorder the list OPEN, eitheraccording to some scheme or some heuristic merit
9. Goto LOOP
sn gn
sn gn
Find the shortest path from Arad to Bucharest
Example
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 5
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 6
OS { }
CS { (Arad, 0, 366) }
OS { (Arad, 0, 366) }
CS { }
OpenSet { (CityName, g(n), f(n)),… }
CloseSet { }
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 7
OS {(Sibiu, 140, 253), (Timisoara,118, 329),
(Zerind, 75, 374)}
CS {(Arad, 0, 366)}
OS { (Timisoara,118, 329), (Zerind, 75, 374)}
CS {(Arad, 0, 366), (Sibiu, 140, 253) }
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 8
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Fagaras, 239, 176), (Oradea, 291, 380),
(Rimnicu Vikea, 220, 193)}
CS {(Arad, 0, 366), (Sibiu, 140, 253) }
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Arad, 280, 366), (Fagaras, 239, 176),
(Oradea, 291, 380) }
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193) }
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 9
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Fagaras, 239, 176), (Oradea, 291, 380),
(Craiova, 366, 160), (Pitesti, 317, 100)}
CS {(Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193)}
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Pitesti, 317, 100)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239, 176)}
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 10
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Pitesti, 317, 100), (Bucharest, 450, 0)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239, 176)}
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Bucharest, 450, 0)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239, 176),
(Pitesti, 317, 100) }
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 11
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Bucharest, 450, 0), (Bucharest, 418, 0),
(Craiova, 455, 160)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239,176),
(Pitesti, 317, 100) }
OS {(Timisoara,118, 329), (Zerind, 75, 374),
(Oradea, 291, 380), (Craiova, 366, 160),
(Bucharest, 450, 0), (Bucharest, 418, 0),
(Craiova, 455, 160)}
CS { (Arad, 0, 366), (Sibiu, 140, 253),
(Rimnicu Vikea, 220, 193), (Fagaras, 239,176),
(Pitesti, 317, 100), (Bucharest, 418, 0) }
Construct the path:
Set pointer from each node to its predecessor.
Construct the path start from the goal, then reverse it.
The path:
Arad->Sibiu->Rimnicu Vikea->Pitesti->Bucharest
Pseudocode
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 12
1: initialize the open list
2: initialize the closed list
3: put the starting node on the open list (leave its f at zero)
-
4: while the open list is not empty
5: find the node with the least f on the open list, call it “q”
6: pop q off the open list
7: generate q’s successors and set their parents to q
8: for each successor
9: if successor is the goal, stop the search
10: successor.g = q.g + distance between successor and q
11: successor.h = distance from goal to successor
12: successor.f = successor.g + successor.h
-
13: if a same node is in the open list which has a lower f than successor, skip this successor
14: if a same node is in the closed list which has a lower f than successor, skip this successor
15: otherwise, add the node to the open list
16: end
17: push q on the closed list
18: end
 Admissibility
 Consistency
Conditions for Optimality
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 13
 A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is
the true cost to reach the goal from n.
 An admissible heuristics never overestimates the cost to reach the goal
 Property: The tree-search version of A* is optimal if h(n) is admissible
Admissible Heuristics
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 14
 A heuristic is consistent if for every node n, every successor n’ of n generated
by any action a,
 If h is consistent, we have
 Property: The graph-search version of A* is optimal if h(n) is consistent.
Consistent Heuristics
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 15
h(n) ≤ c(n, a, n’) + h(n’)
f(n’) = g(n’) + h(n’)
= g(n) + c(n, a, n’) + h(n’)
f(n’) ≥ g(n) + h(n)
f(n’) ≥ f(n)
 The time complexity depends on heuristic function
 In worst case of an unbound search space: O(bd)
 The time complexity is polynomial,when
 Search space is tree
 There is a single goal state
 Heuristic function meets: | h(x) – h*(x)| = O(logh*(x)), where h* is the optimal heuristic, the
exact cost to get from x to the goal
Time Complexity
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 16
 A* algorithm
 f(n) = g(n) + h(n)
 Each step expand the node with lowest value of f(n)
 No other optimal algorithm is guaranteed to expand fewer nodes than A*
 Dijkstra’s algorithm
 f(n) = g(n), as a special case of A* where h(n) = 0
 Each step expand all closest unexamined nodes
 Can be implemented more efficiently without a h(x) value at each node
Compare to Dijkstra’s Algorithm
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 17
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 18
Conclusion
 Advantage:
 The A* algorithm is complete, optimal, and optimally efficient among all such algorithms.
 Disadvantage:
 A* is not practical for many large-scale problems, due to space time complexity is O(bd). That means A*
usually runs out of space long before it runs out of time.
 Applications
 Network routing
 Image processing
 A.I path finding
 Artificial Intelligence: A Modern Approach, third edition by Stuart Russell & Peter Norvig
 Principles of Artificial Intelligence by Nils J.Nilsson
 https://en.wikipedia.org/wiki/A*_search_algorithm
 https://www.ics.uci.edu/~welling/teaching/ICS175winter12/A-starSearch.ppt
 http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html
 http://web.mit.edu/eranki/www/tutorials/search/
Reference
Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 19

More Related Content

What's hot

AI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptx
Asst.prof M.Gokilavani
 
Dijkstra
DijkstraDijkstra
Dijkstra
jagdeeparora86
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
Bablu Shofi
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
Subid Biswas
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
Hema Kashyap
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
Mhd Sb
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
sana younas
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
Saurabh Kumar
 
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
 
Greedy algorithm
Greedy algorithmGreedy algorithm
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
Lemia Algmri
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
Amey Kerkar
 
Searching Algorithm
Searching AlgorithmSearching Algorithm
Searching Algorithm
Sagacious IT Solution
 
AI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptxAI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptx
Asst.prof M.Gokilavani
 
AI Greedy & A* Informed Search Strategies by Example
AI Greedy & A* Informed Search Strategies by ExampleAI Greedy & A* Informed Search Strategies by Example
AI Greedy & A* Informed Search Strategies by Example
Ahmed Gad
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
Syed Ahmed
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
Protap Mondal
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
sandeep54552
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 

What's hot (20)

AI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptx
 
Dijkstra
DijkstraDijkstra
Dijkstra
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
 
Hashing PPT
Hashing PPTHashing PPT
Hashing PPT
 
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
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Searching Algorithm
Searching AlgorithmSearching Algorithm
Searching Algorithm
 
AI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptxAI_Session 9 Hill climbing algorithm.pptx
AI_Session 9 Hill climbing algorithm.pptx
 
AI Greedy & A* Informed Search Strategies by Example
AI Greedy & A* Informed Search Strategies by ExampleAI Greedy & A* Informed Search Strategies by Example
AI Greedy & A* Informed Search Strategies by Example
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 

Similar to Astar algorithm

Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
PalGov
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* Search
IOSR Journals
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
SigSegVSquad
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
DrYogeshDeshmukh1
 
Jarrar: Informed Search
Jarrar: Informed Search  Jarrar: Informed Search
Jarrar: Informed Search
Mustafa Jarrar
 
Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5
Subash Chandra Pakhrin
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
oneous
 
Game Paper
Game PaperGame Paper
Game Paper
Siddharth Gupta
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
Shiwani Gupta
 
Dstar Lite
Dstar LiteDstar Lite
Dstar Lite
Adrian Sotelo
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7
Traian Rebedea
 
Informed Search.pptx
Informed Search.pptxInformed Search.pptx
Informed Search.pptx
MohanKumarP34
 
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and SparkCrystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Jivan Nepali
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
maharajdey
 
Unit ii-ppt
Unit ii-pptUnit ii-ppt
Unit ii-ppt
Aravindharamanan S
 
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyiAstar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
kamaleshs183
 
And or graph problem reduction using predicate logic
And or graph problem reduction using predicate logicAnd or graph problem reduction using predicate logic
And or graph problem reduction using predicate logic
Mohanlal Sukhadia University (MLSU)
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
Soheil Khodayari
 
Graph
GraphGraph
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013
ericupnorth
 

Similar to Astar algorithm (20)

Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* Search
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptx
 
Jarrar: Informed Search
Jarrar: Informed Search  Jarrar: Informed Search
Jarrar: Informed Search
 
Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Game Paper
Game PaperGame Paper
Game Paper
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdf
 
Dstar Lite
Dstar LiteDstar Lite
Dstar Lite
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7
 
Informed Search.pptx
Informed Search.pptxInformed Search.pptx
Informed Search.pptx
 
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and SparkCrystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
Crystal Ball Event Prediction and Log Analysis with Hadoop MapReduce and Spark
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Unit ii-ppt
Unit ii-pptUnit ii-ppt
Unit ii-ppt
 
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyiAstar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
 
And or graph problem reduction using predicate logic
And or graph problem reduction using predicate logicAnd or graph problem reduction using predicate logic
And or graph problem reduction using predicate logic
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Graph
GraphGraph
Graph
 
talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013talk at Virginia Bioinformatics Institute, December 5, 2013
talk at Virginia Bioinformatics Institute, December 5, 2013
 

Recently uploaded

Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.
Nistarini College, Purulia (W.B) India
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
Abdul Wali Khan University Mardan,kP,Pakistan
 
Bob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdfBob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdf
Texas Alliance of Groundwater Districts
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
by6843629
 
Chapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisisChapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisis
tonzsalvador2222
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
PRIYANKA PATEL
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
AbdullaAlAsif1
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
terusbelajar5
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
pablovgd
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Texas Alliance of Groundwater Districts
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
HongcNguyn6
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
KrushnaDarade1
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
TinyAnderson
 
Nucleophilic Addition of carbonyl compounds.pptx
Nucleophilic Addition of carbonyl  compounds.pptxNucleophilic Addition of carbonyl  compounds.pptx
Nucleophilic Addition of carbonyl compounds.pptx
SSR02
 
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptxBREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
RASHMI M G
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 

Recently uploaded (20)

Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.Nucleic Acid-its structural and functional complexity.
Nucleic Acid-its structural and functional complexity.
 
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...THEMATIC  APPERCEPTION  TEST(TAT) cognitive abilities, creativity, and critic...
THEMATIC APPERCEPTION TEST(TAT) cognitive abilities, creativity, and critic...
 
Bob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdfBob Reedy - Nitrate in Texas Groundwater.pdf
Bob Reedy - Nitrate in Texas Groundwater.pdf
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
 
Chapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisisChapter 12 - climate change and the energy crisis
Chapter 12 - climate change and the energy crisis
 
ESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptxESR spectroscopy in liquid food and beverages.pptx
ESR spectroscopy in liquid food and beverages.pptx
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
 
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero WaterSharlene Leurig - Enabling Onsite Water Use with Net Zero Water
Sharlene Leurig - Enabling Onsite Water Use with Net Zero Water
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốtmô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
mô tả các thí nghiệm về đánh giá tác động dòng khí hóa sau đốt
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
 
Nucleophilic Addition of carbonyl compounds.pptx
Nucleophilic Addition of carbonyl  compounds.pptxNucleophilic Addition of carbonyl  compounds.pptx
Nucleophilic Addition of carbonyl compounds.pptx
 
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptxBREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 

Astar algorithm

  • 1. CSCI 6212 Presented by Team Flash Member: Shuqing Zhang Yang Cao Tong Qiao A* Algorithm Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 1
  • 2.  A* is one of the many search algorithm that take an input, evaluates a number of possible paths and returns a solution.  A* combines feartures of uniform-cost search and pure heuristic search to effectively compute optimal solutions  A* evaluates nodes by combining g(n) and h(n) f(n) = g(n) + h(n)  f(n) is called evaluation function.  A* is both complete and optimal. Introduction Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 2
  • 3.  f(n) = g(n) + h(n)  f(n) is the estimated total cost of the cheapest solution through n  g(n) gives the path cost from the start node to node n  h(n) named as heuristic function is the estimated cost of the cheapest path from n to the goal node. Evaluation Function Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 3
  • 4. Algorithm Process Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 4  Given: A graph of nodes, is start, is goal  Aim: To find out the path from to with the minimum cost  Procedure 1. Create a search graph G, consisting solely of the start node s. Put s on a list called OPEN. 2. Create a list called CLOSED that is initially empty. 3. LOOP: if OPEN is empty, exit with failure 4. Select the first node on OPEN, remove it from OPEN and put it into CLOSED. Call this node n. 5. If n is a goal node, exit successfully with the solution obtained by tracing a path along the pointers from n to s in G. 6. Expand node n, generating the set M of its successors and install them as successors of n in G. 7. Establish a pointer to n from those members of M that were not already in G(i.e not already on either OPEN or CLOSED). Add these members of M to OPEN. For each member of M that was already on OPEN or CLOSED, decide whether or not to redircet its pointer to n. For each member of M already on CLOSED, decide for each its descendents in G whether or not to redirect its pointer. 8. Recorder the list OPEN, eitheraccording to some scheme or some heuristic merit 9. Goto LOOP sn gn sn gn
  • 5. Find the shortest path from Arad to Bucharest Example Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 5
  • 6. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 6 OS { } CS { (Arad, 0, 366) } OS { (Arad, 0, 366) } CS { } OpenSet { (CityName, g(n), f(n)),… } CloseSet { }
  • 7. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 7 OS {(Sibiu, 140, 253), (Timisoara,118, 329), (Zerind, 75, 374)} CS {(Arad, 0, 366)} OS { (Timisoara,118, 329), (Zerind, 75, 374)} CS {(Arad, 0, 366), (Sibiu, 140, 253) }
  • 8. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 8 OS {(Timisoara,118, 329), (Zerind, 75, 374), (Fagaras, 239, 176), (Oradea, 291, 380), (Rimnicu Vikea, 220, 193)} CS {(Arad, 0, 366), (Sibiu, 140, 253) } OS {(Timisoara,118, 329), (Zerind, 75, 374), (Arad, 280, 366), (Fagaras, 239, 176), (Oradea, 291, 380) } CS { (Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193) }
  • 9. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 9 OS {(Timisoara,118, 329), (Zerind, 75, 374), (Fagaras, 239, 176), (Oradea, 291, 380), (Craiova, 366, 160), (Pitesti, 317, 100)} CS {(Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193)} OS {(Timisoara,118, 329), (Zerind, 75, 374), (Oradea, 291, 380), (Craiova, 366, 160), (Pitesti, 317, 100)} CS { (Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193), (Fagaras, 239, 176)}
  • 10. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 10 OS {(Timisoara,118, 329), (Zerind, 75, 374), (Oradea, 291, 380), (Craiova, 366, 160), (Pitesti, 317, 100), (Bucharest, 450, 0)} CS { (Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193), (Fagaras, 239, 176)} OS {(Timisoara,118, 329), (Zerind, 75, 374), (Oradea, 291, 380), (Craiova, 366, 160), (Bucharest, 450, 0)} CS { (Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193), (Fagaras, 239, 176), (Pitesti, 317, 100) }
  • 11. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 11 OS {(Timisoara,118, 329), (Zerind, 75, 374), (Oradea, 291, 380), (Craiova, 366, 160), (Bucharest, 450, 0), (Bucharest, 418, 0), (Craiova, 455, 160)} CS { (Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193), (Fagaras, 239,176), (Pitesti, 317, 100) } OS {(Timisoara,118, 329), (Zerind, 75, 374), (Oradea, 291, 380), (Craiova, 366, 160), (Bucharest, 450, 0), (Bucharest, 418, 0), (Craiova, 455, 160)} CS { (Arad, 0, 366), (Sibiu, 140, 253), (Rimnicu Vikea, 220, 193), (Fagaras, 239,176), (Pitesti, 317, 100), (Bucharest, 418, 0) } Construct the path: Set pointer from each node to its predecessor. Construct the path start from the goal, then reverse it. The path: Arad->Sibiu->Rimnicu Vikea->Pitesti->Bucharest
  • 12. Pseudocode Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 12 1: initialize the open list 2: initialize the closed list 3: put the starting node on the open list (leave its f at zero) - 4: while the open list is not empty 5: find the node with the least f on the open list, call it “q” 6: pop q off the open list 7: generate q’s successors and set their parents to q 8: for each successor 9: if successor is the goal, stop the search 10: successor.g = q.g + distance between successor and q 11: successor.h = distance from goal to successor 12: successor.f = successor.g + successor.h - 13: if a same node is in the open list which has a lower f than successor, skip this successor 14: if a same node is in the closed list which has a lower f than successor, skip this successor 15: otherwise, add the node to the open list 16: end 17: push q on the closed list 18: end
  • 13.  Admissibility  Consistency Conditions for Optimality Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 13
  • 14.  A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is the true cost to reach the goal from n.  An admissible heuristics never overestimates the cost to reach the goal  Property: The tree-search version of A* is optimal if h(n) is admissible Admissible Heuristics Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 14
  • 15.  A heuristic is consistent if for every node n, every successor n’ of n generated by any action a,  If h is consistent, we have  Property: The graph-search version of A* is optimal if h(n) is consistent. Consistent Heuristics Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 15 h(n) ≤ c(n, a, n’) + h(n’) f(n’) = g(n’) + h(n’) = g(n) + c(n, a, n’) + h(n’) f(n’) ≥ g(n) + h(n) f(n’) ≥ f(n)
  • 16.  The time complexity depends on heuristic function  In worst case of an unbound search space: O(bd)  The time complexity is polynomial,when  Search space is tree  There is a single goal state  Heuristic function meets: | h(x) – h*(x)| = O(logh*(x)), where h* is the optimal heuristic, the exact cost to get from x to the goal Time Complexity Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 16
  • 17.  A* algorithm  f(n) = g(n) + h(n)  Each step expand the node with lowest value of f(n)  No other optimal algorithm is guaranteed to expand fewer nodes than A*  Dijkstra’s algorithm  f(n) = g(n), as a special case of A* where h(n) = 0  Each step expand all closest unexamined nodes  Can be implemented more efficiently without a h(x) value at each node Compare to Dijkstra’s Algorithm Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 17
  • 18. Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 18 Conclusion  Advantage:  The A* algorithm is complete, optimal, and optimally efficient among all such algorithms.  Disadvantage:  A* is not practical for many large-scale problems, due to space time complexity is O(bd). That means A* usually runs out of space long before it runs out of time.  Applications  Network routing  Image processing  A.I path finding
  • 19.  Artificial Intelligence: A Modern Approach, third edition by Stuart Russell & Peter Norvig  Principles of Artificial Intelligence by Nils J.Nilsson  https://en.wikipedia.org/wiki/A*_search_algorithm  https://www.ics.uci.edu/~welling/teaching/ICS175winter12/A-starSearch.ppt  http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html  http://web.mit.edu/eranki/www/tutorials/search/ Reference Shuqing Zhang/Yang Cao/Tong Qiao CSCI 6121/Arora/2015 FALL 19