Admissible heuristic
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.^{[1]} An admissible heuristic is also known as an optimistic heuristic.
Search algorithms
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. For example, in A* search the evaluation function (where is the current node) is:
where
- = the evaluation function.
- = the cost from the start node to the current node
- = estimated cost from current node to goal.
is calculated using the heuristic function. With a non-admissible heuristic, the A* algorithm could overlook the optimal solution to a search problem due to an overestimation in .
Formulation
- is a node
- is a heuristic
- is cost indicated by to reach a goal from
- is the actual cost to reach a goal from
Construction
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.
Examples
Two different examples of admissible heuristics apply to the fifteen puzzle problem:
The Hamming distance is the total number of misplaced tiles. It is clear that this heuristic is admissible since the total number of moves to order the tiles correctly is at least the number of misplaced tiles (each tile not in place must be moved at least once). The cost (number of moves) to the goal (an ordered puzzle) is at least the Hamming distance of the puzzle.
The Manhattan distance of a puzzle is defined as:
Consider the puzzle below in which the player wishes to move each tile such that the numbers are ordered. The Manhattan distance is an admissible heuristic in this case because every tile will have to be moved at least the amount of spots in between itself and its correct position.
4_{3} | 6_{1} | 3_{0} | 8_{1} |
7_{2} | 12_{3} | 9_{3} | 14_{4} |
15_{3} | 13_{2} | 1_{4} | 5_{4} |
2_{4} | 10_{1} | 11_{1} |
The subscripts show the Manhattan distance for each tile. The total Manhattan distance for the shown puzzle is:
Notes
While all consistent heuristics are admissible, not all admissible heuristics are consistent.
For tree search problems, if an admissible heuristic is used, the A* search algorithm will never return a suboptimal goal node.
References
- ↑ {{#invoke:citation/CS1|citation |CitationClass=book }}