The Monotone (Consistency) Condition

The one inequality that lets A* never reopen a closed node — and the two consequences every exam trace relies on

The Simplest Explanation

A heuristic hh is monotone (consistent) if across every edge from node m to node n:

h(m)−h(n)  ≤  c(m,n)h(m) - h(n) \;\leq\; c(m, n)

In words: the heuristic never drops faster than real cost accrues. Equivalently, h never overestimates the cost of any single edge.

Remember This

Monotone ⇒ admissible (chain the inequality along any path to goal). The reverse is false. Manhattan distance on a grid is monotone whenever edge costs ≥ grid-step differences.

Consequence 1 — f Never Decreases Along a Path

For successor n of m:

h(m)≤h(n)+c(m,n)h(m) \leq h(n) + c(m,n)

Add g(m)g(m) to both sides:

g(m)+h(m)≤g(m)+c(m,n)⏟= g(n)+h(n)=f(n)g(m) + h(m) \leq \underbrace{g(m) + c(m,n)}_{=\,g(n)} + h(n) = f(n)

So f(m)≤f(n)f(m) \leq f(n): f values are non-decreasing along every path A* explores. This matches observed A* traces where f creeps upward toward the goal.

Consequence 2 — First Path Found to Any Node Is Optimal

When A* selects node n from Open, g(n)=g∗(n)g(n) = g^*(n) exactly.

Proof sketch by contradiction: if g(n)>g∗(n)g(n) > g^*(n), some node on the true optimal path to n would still be on Open with f≤g∗(n)+h(n)≤f(n)f \leq g^*(n) + h(n) \leq f(n), contradicting that n was the minimum choice. Hence no cheaper route to n exists.

The Payoff: Case 3 Vanishes

Recall A*'s three cases for neighbors:

  1. New → add to Open
  2. On Open with cheaper g → update
  3. On Closed with cheaper g → update + propagate improvement to descendants

Under monotonicity, Case 3 never arises. Once a node moves to Closed, it stays put — no reopening, no propagation. A* degenerates into Dijkstra-style bookkeeping: close once, done.

Why This Unlocks Memory Pruning

If Closed nodes are final, they can be safely deleted or compressed (Frontier Search / SMGS rely on this). With an inconsistent heuristic you must keep Closed around — a reopened node might need its old parent chain.

HeuristicReopeningsClosed pruning safe?
MonotonenoneYes
Merely admissiblepossible (Case 3)No
Inadmissiblefrequent; optimality lost anywaymoot
QuizMonotone condition on edge (m,n) states...
QuizUnder a consistent heuristic, when A* expands n, g(n) equals...