Consistent heuristic explained

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 neighbouring vertex to the goal, plus the cost of reaching that neighbour.

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:

h(N)\leqc(N,P)+h(P)

and

h(G)=0.

where

Informally, every node i will give an estimate that, accounting for the cost to reach the next node, is always lesser than or equal to the estimate at node i+1.

A consistent heuristic is also admissible, i.e. it never overestimates the cost of reaching the goal (the converse, however, is not always true). Assuming non negative edges, this can be easily proved by induction.[1]

Let

h(N0)=0

be the estimated cost for the goal node. This implies that the base condition is trivially true as 0 ≤ 0. Since the heuristic is consistent,

h(Ni+1)\leqc(Ni+1,Ni)+h(Ni)\leqc(Ni+1,Ni)+c(Ni,Ni-1)+...+c(N1,N0)+h(N0)

by expansion of each term. The given terms are equal to the true cost,
n
\sum
i=1

c(Ni,Ni-1)

, so any consistent heuristic is also admissible since it is upperbounded by the true cost.

The converse is clearly not true as we can always construct a heuristic that is always below the true cost but is nevertheless inconsistent by, for instance, increasing the heuristic estimate from the farthest node as we get closer and, when the estimate

h(Ni)

becomes at most the true cost
*(N
h
i

)

, we make

h(Ni-1)=h(Ni)-c(Ni,Ni-1)

.

Consequences of monotonicity

Consistent heuristics are called monotone because the estimated final cost of a partial solution,

f(Nj)=g(Nj)+h(Nj)

is monotonically non-decreasing along any path, where

g(Nj)=\sum

j
i=2

c(Ni-1,Ni)

is the cost of the best path from start node

N1

to

Nj

. It's necessary and sufficient for a heuristic to obey the triangle inequality in order to be consistent.[2]

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 edges). In fact, if the search graph is given cost

c'(N,P)=c(N,P)+h(P)-h(N)

for a consistent

h

, then A* is equivalent to best-first search on that graph using Dijkstra's algorithm.[3] 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

h

is admissible but not consistent, one can artificially force the heuristic values along a path to be monotonically non-decreasingby using

h'(P)\getsmax(h(P),h'(N)-c(N,P))

as the heuristic value for

P

instead of

h(P)

, where

N

is the node immediately preceding

P

on the path and

h'(start)=h(start)

. This idea is due to László Mérō[4] and is now known as pathmax.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.[5]

See also

References

  1. Web site: Designing & Understanding Heuristics .
  2. Book: Pearl , Judea . Heuristics: Intelligent Search Strategies for Computer Problem Solving . Addison-Wesley . 1984 . 0-201-05594-5 . registration .
  3. Book: Stefan . Edelkamp . Stefan . Schrödl . Heuristic Search: Theory and Applications . Morgan Kaufmann . 2012 . 978-0-12-372512-7 .
  4. Mérō. László. 1984. A Heuristic Search Algorithm with Modifiable Estimate. Artificial Intelligence. 23. 13–27. 10.1016/0004-3702(84)90003-1.
  5. Holte. Robert. 2005. Common Misconceptions Concerning Heuristic Search. Proceedings of the Third Annual Symposium on Combinatorial Search (SoCS). 2019-07-10. 2022-08-01. https://web.archive.org/web/20220801183131/https://aaai.org/ocs/index.php/SOCS/SOCS10/paper/view/2073. dead.