Index Ai Academy
Glossary · Phase 7 · Software engineering

Heuristic

Also written: heuristics

A quick estimate, such as straight-line distance, used to guide a search toward the goal.

Dijkstra spreads out evenly in every direction, including away from the goal. A star, written A*, adds a guess of the remaining cost, the heuristic, and always expands the place with the lowest cost so far + guessed cost to go. On a map, the straight-line distance is a good guess; on a grid where you can only move up, down, left and right, the Manhattan distance (rows apart plus columns apart) is.

Try it now

Each pop takes the cheapest place in the queue; its distance never changes after that.

Learn it properly

Searching for solutions · Backtracking with pruning, Dijkstra's algorithm and A*, ending with an optimal sliding-puzzle solver. About 45 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write