SlideShare a Scribd company logo
1 of 19
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

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AIvikas dhakane
 
Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8Traian Rebedea
 
Dijkstra algorithm a dynammic programming approach
Dijkstra algorithm   a dynammic programming approachDijkstra algorithm   a dynammic programming approach
Dijkstra algorithm a dynammic programming approachAkash Sethiya
 
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.pptxAsst.prof M.Gokilavani
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchchandsek666
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms Syed Ahmed
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structureIkhlas Rahman
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of AlgorithmsSwapnil Agrawal
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithmHema Kashyap
 

What's hot (20)

Minimum spanning Tree
Minimum spanning TreeMinimum spanning Tree
Minimum spanning Tree
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
Tsp branch and-bound
Tsp branch and-boundTsp branch and-bound
Tsp branch and-bound
 
Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8Algorithm Design and Complexity - Course 8
Algorithm Design and Complexity - Course 8
 
Dijkstra algorithm a dynammic programming approach
Dijkstra algorithm   a dynammic programming approachDijkstra algorithm   a dynammic programming approach
Dijkstra algorithm a dynammic programming approach
 
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
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
A star algorithms
A star algorithmsA star algorithms
A star algorithms
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)
 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Backtracking
Backtracking  Backtracking
Backtracking
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
Graph Basic In Data structure
Graph Basic In Data structureGraph Basic In Data structure
Graph Basic In Data structure
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 
Lecture 19 sma star algorithm
Lecture 19 sma star algorithmLecture 19 sma star algorithm
Lecture 19 sma star algorithm
 
N queens using backtracking
N queens using backtrackingN queens using backtracking
N queens using backtracking
 

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.informedsearchPalGov
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* SearchIOSR Journals
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsSigSegVSquad
 
Unit 3 Informed Search Strategies.pptx
Unit  3 Informed Search Strategies.pptxUnit  3 Informed Search Strategies.pptx
Unit 3 Informed Search Strategies.pptxDrYogeshDeshmukh1
 
Jarrar: Informed Search
Jarrar: Informed Search  Jarrar: Informed Search
Jarrar: Informed Search Mustafa Jarrar
 
4 informed-search
4 informed-search4 informed-search
4 informed-searchMhd Sb
 
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 treeoneous
 
module4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfmodule4_dynamic programming_2022.pdf
module4_dynamic programming_2022.pdfShiwani Gupta
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Traian Rebedea
 
Informed Search.pptx
Informed Search.pptxInformed Search.pptx
Informed Search.pptxMohanKumarP34
 
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 SparkJivan Nepali
 
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 searchHema Kashyap
 
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, 2013ericupnorth
 

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
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
 
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
 
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
 
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
 
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

Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptArshadWarsi13
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRlizamodels9
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024innovationoecd
 
Sulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptx
Sulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptxSulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptx
Sulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptxnoordubaliya2003
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trssuser06f238
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Patrick Diehl
 
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfBUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfWildaNurAmalia2
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuinethapagita
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 

Recently uploaded (20)

Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.ppt
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024
 
Sulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptx
Sulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptxSulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptx
Sulphur & Phosphrus Cycle PowerPoint Presentation (2) [Autosaved]-3-1.pptx
 
Neurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 trNeurodevelopmental disorders according to the dsm 5 tr
Neurodevelopmental disorders according to the dsm 5 tr
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?Is RISC-V ready for HPC workload? Maybe?
Is RISC-V ready for HPC workload? Maybe?
 
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfBUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdf
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 

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