A-Star Algorithm

The A* algorithm is similar to Djikstra’s algorithm except that A* adds in a Heurisitic Function towards the goal node, thereby focusing the search.

For A* search to be optimal, the heuristic function , should be:

  1. Admissible, or never overestimating the true cost, and
  2. Consistent, which means that the estimated path cost to the goal of a new node in addition to the cost of transitioning to it from the previous node is greater or equal to the estimated path cost to the goal of the previous node. To put it in an equation form, is consistent if for every node and successor node with step cost , .

A typically used heuristic is Euclidean Distance from the current node to the goal node.

Why ever use A* then?

Imagine when the search tree is huge. A* reduces the number of tree nodes required to be visited. Although I would argue maybe explore using MCTS in that case.