Consistent heuristic: Difference between revisions
The first formula was wrong it should be less or equal not greater or equal |
Robert Holte (talk | contribs) I corrected the misconception that pathmax turns an admissible heuristic into a consistent one. Sorry for having to cite my own paper, but I don't know another source for this. |
||
Line 15: | Line 15: | ||
making it admissible. (<math>N_{m+1}</math> is any node whose best path to the goal, of length m+1, goes through some immediate child <math>N_{m}</math> whose best path to the goal is of length m.) |
making it admissible. (<math>N_{m+1}</math> is any node whose best path to the goal, of length m+1, goes through some immediate child <math>N_{m}</math> whose best path to the goal is of length m.) |
||
However, an admissible heuristic <math>h</math>, can be made into a consistent heuristic, <math>h'</math>, through the following adjustment: |
|||
⚫ | |||
(Known as the pathmax<ref name="Russell 1995">{{cite book |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
==Consequences of monotonicity== |
==Consequences of monotonicity== |
||
Line 39: | Line 28: | ||
In the [[A* search algorithm]], using a consistent heuristic means that once a node is expanded, the cost by which it was reached is the lowest possible, under the same conditions that Dijkstra's algorithm requires in solving the [[shortest path problem]] (no negative cost cycles). In fact, if the search graph is given cost <math>c'(N,P)=c(N,P)+h(P)-h(N)</math> for a consistent <math>h</math>, then A* is equivalent to best-first search on that graph using Dijkstra's algorithm.<ref name="Russell 1995"/> In the unusual event that an admissible heuristic is not consistent, a node will need repeated expansion every time a new best (so-far) cost is achieved for it. |
In the [[A* search algorithm]], using a consistent heuristic means that once a node is expanded, the cost by which it was reached is the lowest possible, under the same conditions that Dijkstra's algorithm requires in solving the [[shortest path problem]] (no negative cost cycles). In fact, if the search graph is given cost <math>c'(N,P)=c(N,P)+h(P)-h(N)</math> for a consistent <math>h</math>, then A* is equivalent to best-first search on that graph using Dijkstra's algorithm.<ref name="Russell 1995"/> In the unusual event that an admissible heuristic is not consistent, a node will need repeated expansion every time a new best (so-far) cost is achieved for it. |
||
If the given heuristic <math>h</math> is admissible but not consistent, one can artificially force the heuristic values along a path to be monotonically non-decreasing |
|||
by using |
|||
⚫ | |||
as the heuristic value for <math> P </math> instead of <math> h(P) </math>, where <math> N </math> is the node immediately preceding <math> P </math> on the path and <math> h'(start)=h(start) </math>. This is known as the pathmax<ref name="Russell 1995">{{cite book |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
Contrary to common belief, pathmax does not turn an admissible heuristic into a consistent heuristic. For example, if A* uses pathmax and a heuristic that is admissible but not consistent, it is not guaranteed to have an optimal path to a node when it is first expanded.<ref name="Misconceptions">{{cite journal| |
|||
last=Holte| |
|||
first=Robert| |
|||
date=2005| |
|||
title=Common Misconceptions Concerning Heuristic Search| |
|||
url=https://aaai.org/ocs/index.php/SOCS/SOCS10/paper/view/2073| |
|||
journal=Proceedings of the Third Annual Symposium on Combinatorial Search (SoCS)| |
|||
volume=| |
|||
pages=| |
|||
via=}}</ref> |
|||
== See also == |
== See also == |
Revision as of 18:11, 10 July 2019
In the study of path-finding problems in artificial intelligence, a heuristic function is said to be consistent, or monotone, if its estimate is always less than or equal to the estimated distance from any neighboring vertex to the goal, plus the cost of reaching that neighbor.
Formally, for every node N and each successor P of N, the estimated cost of reaching the goal from N is no greater than the step cost of getting to P plus the estimated cost of reaching the goal from P. That is:
- and
where
- h is the consistent heuristic function
- N is any node in the graph
- P is any descendant of N
- G is any goal node
- c(N,P) is the cost of reaching node P from N
A consistent heuristic is also admissible, i.e. it never overestimates the cost of reaching the goal (the converse, however, is not always true). This is proved by induction on , the length of the best path from node to goal. By assumption, , where denotes the cost of the shortest path from n to the goal. Therefore,
- ,
making it admissible. ( is any node whose best path to the goal, of length m+1, goes through some immediate child whose best path to the goal is of length m.)
Consequences of monotonicity
Consistent heuristics are called monotone because the estimated final cost of a partial solution, is monotonically non-decreasing along the best path to the goal, where is the cost of the best path from start node to . It's necessary and sufficient for a heuristic to obey the triangle inequality in order to be consistent.[1]
In the A* search algorithm, using a consistent heuristic means that once a node is expanded, the cost by which it was reached is the lowest possible, under the same conditions that Dijkstra's algorithm requires in solving the shortest path problem (no negative cost cycles). In fact, if the search graph is given cost for a consistent , then A* is equivalent to best-first search on that graph using Dijkstra's algorithm.[2] In the unusual event that an admissible heuristic is not consistent, a node will need repeated expansion every time a new best (so-far) cost is achieved for it.
If the given heuristic is admissible but not consistent, one can artificially force the heuristic values along a path to be monotonically non-decreasing by using
as the heuristic value for instead of , where is the node immediately preceding on the path and . This is known as the pathmax[2] equation. Contrary to common belief, pathmax does not turn an admissible heuristic into a consistent heuristic. For example, if A* uses pathmax and a heuristic that is admissible but not consistent, it is not guaranteed to have an optimal path to a node when it is first expanded.[3]
See also
References
- ^ Pearl, Judea (1984). Heuristics: Intelligent Search Strategies for Computer Problem Solving. Addison-Wesley. ISBN 0-201-05594-5.
- ^ a b Russell, Stuart; Peter Norvig (1995). Artificial intelligence: a modern approach. Prentice-Hall. ISBN 0-13-103805-2.
- ^ Holte, Robert (2005). "Common Misconceptions Concerning Heuristic Search". Proceedings of the Third Annual Symposium on Combinatorial Search (SoCS).