Foundations

heuristic

/ hyoo-RIS-tik /

A heuristic is a rule of thumb — a quick, practical shortcut that usually points you toward a good answer without guaranteeing the best one. When you're lost in a city and head toward the tall buildings to find downtown, you're using a heuristic: it's not foolproof, but it's a sensible guess that works often enough and saves you from checking every street. AI uses the same trick to tame problems too big to solve by brute force.

In AI, heuristics most often appear in search and problem-solving as an educated guess about how promising a situation is — for instance, in a navigation problem, estimating the remaining distance to the goal as a straight line, ignoring the actual winding roads. This estimate guides the search to explore promising directions first instead of blindly trying everything. A good heuristic can turn a problem that would take effectively forever into one solved in moments. The art is finding a heuristic that's cheap to compute yet usefully accurate.

The honesty clause matters: a heuristic trades guarantees for speed. Because it's an approximation, it can be misled and occasionally steer you wrong or toward a merely-okay answer. Some heuristics come with mathematical safeguards (for example, never overestimating the remaining cost, which keeps certain search methods provably optimal); many are just clever guesses that work well in practice. Heuristics are everywhere in AI and in human thinking alike — indispensable for coping with complexity, but never a substitute for checking when the stakes are high.

A map app planning a route can't check every possible path — there are astronomically many. So it uses a heuristic: prefer roads that head in the goal's direction (straight-line distance to the destination). This focuses the search on promising routes and ignores ones that wander away, finding a near-optimal route in a fraction of the time.

Straight-line distance as a heuristic: a cheap guess that focuses the search without checking every path.

A heuristic buys speed by giving up the guarantee of the best answer. It's a guide, not a proof — brilliant for cutting down impossibly large searches, but capable of being fooled, so treat its output as 'probably good,' not 'certainly best.'

Also called
rule of thumbheuristic function启发式啟發式启发法经验法则