liveBook · Manning

Consistent heuristic

As explained in Advanced Algorithms and Data Structures

A consistent heuristic is a heuristic whose estimate at a successor is no greater than the estimate at its predecessor plus the transition cost between them.

A consistent heuristic estimates a successor’s remaining cost as no more than the predecessor’s estimate plus the transition cost: h(u) ≤ cost(v,u) + h(v). section 14.5.1

In A*, consistency works with admissibility to preserve optimal solutions without requiring heuristic values to decrease monotonically along every traversal. section 14.5.1

Road distance and straight-line distance

For a road graph, use road distance as edge cost and straight-line distance to the goal as the heuristic. Euclidean triangle inequality makes the heuristic consistent, even when a graph detour causes a successor’s estimate to increase. section 14.5.1

straight_line(u, goal) ≤ road_distance(v, u) + straight_distance(v)

The inequality makes the consistency requirement concrete for checking an A* heuristic. section 14.5.1

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines the inequality, derives it for straight-line distance, and distinguishes consistency from monotonic traversal values.
Examples
Uses road networks, straight-line distance, Euclidean geometry, and a graph where detours increase successor estimates.
What it assumes
Assumes familiarity with A*, graph paths, edge weights, heuristics, and the triangle inequality.
What you can do after
Evaluate whether a distance heuristic satisfies A*’s consistency condition and supports optimal search.
How it connects
Connects A* search, admissible heuristics, Dijkstra’s algorithm, road distance, and the triangle inequality.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.