Heuristic Search

What are different types of heuristics?

The main kinds of heuristics in AI: admissible and consistent ones, distance measures like Manhattan distance, and heuristics from simplified problems.

On this page
  1. Sorting heuristics by their properties
  2. Sorting heuristics by how they are built
  3. A note on the psychology meaning
  4. Summary

The word heuristic can be sorted in more than one way. In AI search, heuristics differ in what they promise, which is their properties, and in how they are built. Knowing both helps you choose a heuristic for a given problem.

Sorting heuristics by their properties

  • Admissible heuristics never overestimate the true remaining cost. An admissible heuristic lets A* find the cheapest path.
  • Consistent heuristics, also called monotone, never drop by more than the cost of the step between two neighboring states. Every consistent heuristic is also admissible.
  • Inadmissible heuristics can overestimate. They are sometimes chosen on purpose when speed matters more than finding the best answer, but they give up the guarantee of the shortest path.

Sorting heuristics by how they are built

Distance formulas. On a grid or map, a distance formula estimates the remaining cost. The formula should match the moves the problem allows.

  • Manhattan distance adds the horizontal and vertical steps. It fits grids where moves go in four directions.
  • Euclidean distance is the straight-line distance. It never overestimates the real distance when the cost of a move equals the distance it covers.
  • Chebyshev distance is the larger of the horizontal and vertical steps. It fits grids where diagonal moves cost the same as straight ones.

Choosing the wrong formula can break admissibility. If diagonal moves are allowed at the same cost as straight moves, Manhattan distance can overestimate. Moving diagonally between two neighboring squares counts as one move, but Manhattan distance counts two steps.

Relaxed problems. Solve a simpler version of the problem with some rules removed. Removing rules can only make a solution cheaper or leave it the same, so the cost of the simpler version is an admissible heuristic for the original problem.

Pattern databases. Store the exact cost of solving a simplified part of the problem ahead of time, then use it as the estimate for the full problem. When the stored patterns do not overlap, these estimates never overestimate.

Learned heuristics. Some systems learn the estimate from data or experience instead of having a person design it. Learned estimates often come without a proof that they never overestimate, so they need careful testing.

Rules for the next choice. Some heuristics do not estimate distance at all. In constraint problems, for example, the minimum remaining values heuristic picks the variable with the fewest legal values left. It decides what to try next rather than how far the goal is.

A note on the psychology meaning

In psychology, a heuristic is a mental shortcut people use to judge things quickly. The availability heuristic, for example, makes an event seem more likely when examples of it come easily to mind. That meaning differs from the AI meaning, though both are rules of thumb. For the basic AI idea, what are heuristics in AI explains the core concept first.

Summary

Heuristics in AI fall into a few families: properties such as admissible and consistent, distance formulas, relaxed problems, pattern databases, learned estimates and rules for choosing the next option. A heuristic’s kind tells you what it guarantees and how much work it takes to build. For how these heuristics are used in search methods, see the overview of types of heuristic search in artificial intelligence.

The complete guide to heuristic search

Types of Heuristic Search in Artificial Intelligence
Read the guide

Keep exploring

Guides from other topics

All topics →