Shortest path using A* Algorithm
Transcript of Shortest path using A* Algorithm
![Page 1: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/1.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Shortest path using A∗ Algorithm
Phaneendhar Reddy Vanam
December 7, 2011
![Page 2: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/2.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
1 Introduction
2 History
3 Components of A∗ Algorithm
4 Steps Involved in A∗ Algorithm
5 Example showing A∗ Search
6 Applications
7 Time Complexity
![Page 3: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/3.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Introduction
The A∗ Algorithm is a best-first search algorithm thatfinds the least cost path from an initial configuration to afinal configuration.
The most essential part of the A∗ Algorithm is a goodheuristic estimate.
This Heuristic estimate function can improve the efficiencyand performance of the algorithm.
![Page 4: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/4.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
History of A∗ Algorithm
In 1964 Nils Nilson invented a heuristic based approach toincrease the speed of Dijkstra’s algorithm.This algorithm iscalled A1.
In 1967 Bertram Rapheal made dramatic improvementsupon this algorithm, but failed to show optimatility.Hecalled this algorithm as A2.
Then in 1968 Peter E.Hart introduced an argument thatproved A2 was optimal when using a consistent heuristic.
Finally, He named new algorithm in Kleene star syntax tobe the algorithm that starts with A called A∗.
![Page 5: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/5.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Components of A∗ Algorithm
A∗ Algorithm mainly uses the function f(n)=g(n)+h(n).
g(n) is path-cost function, which is the cost from thestarting node to the current node.
h(n) is the heuristic estimate of the distance to the goal.
![Page 6: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/6.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Contd
A search algorithm is said to be complete, if it isguaranteed to find a goal state if one exits.
A search algorithm is said to be optimal, if the first goalstate it finds is the least cost.
![Page 7: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/7.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Steps Involved in A∗ Algorithm
Let’s characterize a class of admissible heuristic searchstrategies, using the evaluation function:f ′(n) = g(n) + h(n).
A∗ can be implemented more efficiently roughly speaking,no node needs to be processed more than once.
As A∗ traverses the graph, it follows a path of the lowestknown cost, keeping a sorted priority queue of alternatepath segments along the way.
If, at any point, a segment of the path being traversed hasa higher cost than another encountered path segment, itabandons the higher-cost path segment and traverses thelower-cost path segment.
![Page 8: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/8.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Steps Contd.
Starting with the initial node, it maintains a priority queueof nodes to be traversed, known as the open set.
The lower f(x) for a given node x, the higher its priority.
At each step of the A∗ algorithm, the node with thelowest f(x) value is removed from the queue, the f and hvalues of its neighbors are updated accordingly, and theseneighbors are added to the queue.
The A∗ algorithm continues until a goal node has a lowerf value than any node in the queue.
![Page 9: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/9.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Steps Contd.
The f value of the goal is then the length of the shortestpath, since h at the goal is zero in an admissibleheuristic.If the actual shortest path is desired, thealgorithm may also update each neighbor with itsimmediate predecessor in the best path found.
A closed set of nodes already traversed may be used tomake the search more efficient.This process continues untilthe goal is reached.
![Page 10: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/10.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example
Values of Heuristic i.e straight line distance to Bucharest
City Hueristic value City Heuristicvalue
Arad 366 Mehadia 241
Bucharest 0 Neamt 234
Craiova 160 Oradea 380
Eforie 161 Pitesti 100
Fagaras 176 Rimnicu Vilcea 193
Dobreta 242 Timisoara 329
Hirsova 151 Urziceni 80
Iasi 226 Vaslui 199
Lugoj 244 Zerind 374
![Page 11: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/11.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
Steps in Map of Romania with Arad as start state
Figure: Example1
![Page 12: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/12.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
After expanding Arad
Figure: Example2
![Page 13: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/13.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
After expanding Sibiu
Figure: Example3
![Page 14: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/14.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
After expanding Rimnicu
Figure: Example4
![Page 15: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/15.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
After expanding Fagaras
Figure: Example5
![Page 16: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/16.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
After expanding Pitesti
Figure: Example6
![Page 17: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/17.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Example Contd.
Finally, the shortest path between Arad and Bucharest
Figure: Example7
![Page 18: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/18.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Applications
The A∗ algorithm for heuristic search is applied toconstruct a Neural Network structure (NS).
This algorithm mostly used in Computer Gaming, Roboticsand Google Maps.
![Page 19: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/19.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
Time Complexity
The time complexity of A∗ depends on the heuristic.In theworst case, the number of nodes expanded is exponential in thelength of the solution.
|h(x) − h∗(x)| = O(log(h)∗(x))
where h∗ is the optimal heuristic and it is also defined as truecost of getting from n to the goal.
![Page 20: Shortest path using A* Algorithm](https://reader031.fdocuments.in/reader031/viewer/2022012008/61d9a48f0c4e4135cc556c8e/html5/thumbnails/20.jpg)
Shortest path
using A∗
Algorithm
Phaneendhar
Reddy Vanam
Introduction
History
Components
of A∗
Algorithm
Steps Involved
in A∗
Algorithm
Example
showing A∗
Search
Applications
Time
Complexity
References
Stuart Russell,Peter Norvig Artificial intelligence a modern
approach
David L.Poole and Alan K.Mackworth Foundations of
computational agents Cambridge University Press, 2010
Ben Coppin Artificial Intelligence Illuminated
wikipedia A∗ search algorithmhttp://en.wikipedia.org/wiki/A* algorithm
A∗ algorithm for beginnershttp://www.policyalmanac.org/games/aStarTutorial.htm