0% found this document useful (0 votes)
60 views

A Star Algorithm

The A* algorithm finds the shortest path between an initial and final point by using heuristics to improve upon Dijkstra's algorithm. It calculates the cost to reach each node on a graph or map by considering both the cost to reach that node from the start (g(n)) and the estimated cost to get from that node to the end (h(n)). The time and space complexity of A* depends on the heuristic used and branching factor of the graph, usually evaluating to O(bd) where b is the branching factor and d is the shortest path.

Uploaded by

we smile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

A Star Algorithm

The A* algorithm finds the shortest path between an initial and final point by using heuristics to improve upon Dijkstra's algorithm. It calculates the cost to reach each node on a graph or map by considering both the cost to reach that node from the start (g(n)) and the estimated cost to get from that node to the end (h(n)). The time and space complexity of A* depends on the heuristic used and branching factor of the graph, usually evaluating to O(bd) where b is the branching factor and d is the shortest path.

Uploaded by

we smile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

A* Algorithm

Is a search algorithm that finds the shortest path between an initial and final point/source.
It can be seen as an extension of Dijkstra’s but uses heuristics to achieve better performance in its
searches to find the shortest path to a specific goal, unlike Dijkstra that looks at all possible goals

Initially designed for graph traversal, it useful in pathfinding in maps or weighted graphs with
nodes/points

A* traverses a map/graph by calculating the shortest path using a heuristic function, h(n), which
estimates the cost of the cheapest path from node ,n, to the destination and g(n), which is the
cost of traversing from the start to n

f(n) = g(n) + h(n)

The time complexity of A* depends on the heuristic used and the space complexity is roughly
the same as other graph search algorithms but both usually evaluate to O(bd)

Where b is the branching factor and d the shortest path

The major drawback of A* is it’s space complexity as it stores all generated nodes in
memory, thus leading it to be over-performed in certain circumstances by other algorithms
than can pre process the graph

You might also like