Heuristic
A heuristic is a rule of thumb or shortcut that finds a good-enough answer quickly, giving up the guarantee of the best or exact solution in exchange for speed.
Many problems in computing are too big to solve exactly in any reasonable time. A heuristic is a technique that gets a usable answer faster by trading away some combination of optimality, completeness, accuracy or precision. The word comes from the Greek for 'to find'. In search problems, a heuristic function estimates how promising each option is, so the program can explore the likely branches first and ignore the rest.
The travelling salesman problem shows the trade-off. Finding the shortest route that visits every city once becomes impossibly slow to solve exactly as the number of cities grows. A greedy heuristic simply goes to the nearest unvisited city each time. It produces a reasonable route almost instantly, but there is no guarantee it is the best one, and it can be noticeably worse.
Some heuristics come with guarantees. The A* search algorithm, published in 1968 by Peter Hart, Nils Nilsson and Bertram Raphael at the Stanford Research Institute as part of the Shakey robot project, uses a heuristic to estimate the remaining cost to the goal. If that estimate never overestimates, which is called an admissible heuristic, A* is guaranteed to find the best path. On a road map, straight-line distance works, because no road route can be shorter. In their Turing Award lecture, published in 1976, Allen Newell and Herbert Simon put heuristic search at the centre of their account of intelligence.
Heuristics turn up throughout AI and software. Game-playing programs use them to judge positions; antivirus software uses heuristic scanning to flag code that behaves like known malware families, catching variants that simple signature matching would miss. The risk is that a rule of thumb that worked on the cases it was designed for can fail on new ones, and nothing in the method itself warns when that happens.
In AI news the word often marks a contrast. A system described as using 'heuristics' typically relies on hand-written rules, while one described as learned has picked up its behaviour from data. Many real products combine both, using simple rules to catch obvious cases quickly and models for the rest.
It is a rule of thumb that guides a program towards a good answer quickly without checking every possibility. In search, a heuristic function estimates how close each option is to the goal so the program explores the most promising options first. The cost is that the answer may not be the best possible one. An admissible heuristic never overestimates the true cost of reaching the goal. Straight-line distance on a map is the classic example, since the real route cannot be shorter. When the A* search algorithm uses an admissible heuristic, it is guaranteed to find the optimal path. An algorithm is any precise step-by-step procedure, and many guarantee a correct or optimal result. A heuristic is a shortcut, often used inside an algorithm, that aims for a good result quickly without that guarantee. Greedy route-finding is a heuristic; checking every possible route is an exact but slow algorithm. They are reliable on problems like the ones they were designed for and can fail on unusual cases. Because a heuristic gives no proof that its answer is right or best, it is wise to test it on realistic data and watch for situations where it breaks down.Common questions
What is a heuristic in artificial intelligence?
What is an admissible heuristic?
What is the difference between a heuristic and an algorithm?
Are heuristics reliable?
Search for "heuristic search", "admissible heuristic A*" or "greedy algorithm travelling salesman" for clear explanations with worked examples. Algorithms textbooks, university course notes and the original papers are the most dependable sources. Be cautious with claims that a heuristic method is 'near optimal' without evidence, since performance depends heavily on the particular problem.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.