In computer science, specifically in algorithms related to pathfinding, a heuristic function is said to be admissible if it never overestimates the cost of reaching the goal, i.e. the cost it estimates to reach the goal is not higher than the lowest possible cost from the current point in the path.
An admissible heuristic is used to estimate the cost of reaching the goal state in an informed search algorithm.
In order for a heuristic to be admissible to the search problem, the estimated cost must always be lower than or equal to the actual cost of reaching the goal state.
The search algorithm uses the admissible heuristic to find an estimated optimal path to the goal state from the current node.
With a non-admissible heuristic, the A* algorithm could overlook the optimal solution to a search problem due to an overestimation in
An admissible heuristic can be derived from a relaxed version of the problem, or by information from pattern databases that store exact solutions to subproblems of the problem, or by using inductive learning methods.
Two different examples of admissible heuristics apply to the fifteen puzzle problem: The Hamming distance is the total number of misplaced tiles.
The Manhattan distance is an admissible heuristic in this case because every tile will have to be moved at least the number of spots in between itself and its correct position.
The total Manhattan distance for the shown puzzle is: If an admissible heuristic is used in an algorithm that, per iteration, progresses only the path of lowest evaluation (current cost + heuristic) of several candidate paths, terminates the moment its exploration reaches the goal and, crucially, never closes all optimal paths before terminating (something that's possible with A* search algorithm if special care isn't taken[3]), then this algorithm can only terminate on an optimal path.
To see why, consider the following proof by contradiction: Assume such an algorithm managed to terminate on a path T with a true cost Ttrue greater than the optimal path S with true cost Strue.
As Teval and Ttrue cannot be both equal and unequal our assumption must have been false and so it must be impossible to terminate on a more costly than optimal path.
Then we would clearly pick the bottom nodes one after the other, followed by the updated goal, since they all have
However, note that although an admissible heuristic can guarantee final optimality, it is not necessarily efficient.