Difference between Best-First Search and A* Search?

• Difficulty Level : Medium
• Last Updated : 06 Sep, 2022

Best-First Search:

Best-First search is a searching algorithm used to find the shortest path which uses distance as a heuristic. The distance between the starting node and the goal node is taken as heuristics. It defines the evaluation function for each node n in the graph as f(n) = h(n) where h(n) is heuristics function.

A*Search:

A*search is a searching algorithm used to find the shortest path which calculates the cost of all its neighboring nodes and selects the minimum cost node. It defines the evaluation function f(n) = g(n) + h(n) where, h(n) is heuristics function and g(n) is the past knowledge acquired while searching.

Difference Between Best-first search and A*search:

The best-first search and A* search algorithm both define the evaluation function for each node n of the graph. This evaluation function is denoted by f(n). This evaluation function determines which node to be expanded first while searching. Both search algorithms mainly differ in their evaluation function. Here, f(n) is the evaluation function, g(n) is the past knowledge acquired while searching, and h(n) is the heuristics function.

The difference between the best-fit and A* search algorithms is represented by the following table.

My Personal Notes arrow_drop_up
Related Articles