What is a consistent heuristic?

Stephen M. Walker II · Co-Founder / CEO

Understanding Consistent Heuristics in AI

In heuristic search, a consistent heuristic, also called a monotone heuristic, satisfies the triangle inequality for every edge. For any node n and successor n', the heuristic must obey:

h(n) <= c(n, n') + h(n')

where c(n, n') is the step cost. When h(goal) = 0, this property implies admissibility, meaning the heuristic never overestimates the true cost to the goal.

Consistency is important for A* search because it guarantees that f(n) = g(n) + h(n) is nondecreasing along any path. As a result, graph-search A* does not need to reopen closed nodes and remains optimal when its other assumptions hold.

Common examples include Manhattan distance for grid pathfinding with 4-connected moves and straight-line distance in Euclidean graphs where edge costs are distances. For 8-connected grids with diagonal moves, octile distance is consistent when the diagonal cost is sqrt(2).

More terms

Continue exploring the glossary.

Learn how teams define, measure, and improve LLM systems.

Glossary term

MMLU Benchmark (Massive Multi-task Language Understanding)

The MMLU Benchmark, or Massive Multi-task Language Understanding, is an LLM evaluation test dataset split into a few-shot development set, a 1540-question validation set, and a 14079-question test set that measures text models' multitask accuracy across 57 tasks like math, history, law, and computer science in zero-shot and few-shot settings to evaluate their world knowledge, problem-solving skills, and limitations.
Read term

Glossary term

What is BLEU?

The BLEU Score, or Bilingual Evaluation Understudy, is a metric used in machine translation to evaluate the quality of translated text. It measures the similarity between the machine-generated translation and the human reference translation, considering precision of n-grams.
Read term

It's time to build

Collaborate with your team on reliable Generative AI features.
Want expert guidance? Book a 1:1 onboarding session from your dashboard.

Talk to sales