A-Star

A* as compared to any other greedy algorithm in its family, like Best first search and Dijkstra, expands as few nodes as possible and still returns the shortest possible route to the goal. This is even better when we introduce heaps into the A* algorithm for finding the highest priority node. This reduces the time complexity of finding the node with minimum F value to O(1), the construction of this heap however take O(LogN) and is done at worst N times so total complexity of O(NLogN).

On top of being greedy, A* makes use of manhattan distance in this instance. This distances, when added with the G cost gives us F cost which is the cost of expanding the neighbor. This makes it so that the nodes that are of higher G cost and that are in other direction have a higher cost, relative to the cost of nodes close to the goal node. Giving us a short, and direct route to the goal that has the least cost possible.

BFS and dijkstra expand nodes in all direction to give the shortest path. BFS does not account for the cost of the path and dijkstra, even though gives the best possible route, is blind and expands all neighbors around it. A* on the other hand makes use of the cost and heuristic distance to be as optimal as possible.

Phone

+61406304406