The short answer
There is no single official count. Courses, textbooks and research papers group heuristics in different ways, and the number depends on how finely you divide them. A common scheme in computer science uses three broad families: construction (greedy) methods, improvement (local search) methods, and metaheuristics that guide the other two. Psychology and usability design classify heuristics separately.
Construction heuristics
Construction heuristics build a solution one step at a time and do not go back. The greedy rule is the classic example: take the best-looking option at each step. These methods are fast and produce a complete answer in a single pass. The risk is that an early choice can lock in a poor overall result. The nearest-neighbor method for routes is one example, and greedy change-making, which takes the largest coin that still fits, is another.
Greedy does not always mean heuristic. Kruskal’s algorithm for a minimum spanning tree also picks the cheapest edge that does not form a cycle at each step, and for that problem the greedy rule always gives the best answer. Whether a greedy method counts as a heuristic depends on whether it keeps the guarantee for the problem at hand.
Improvement heuristics (local search)
Local search methods start from a complete solution and make small changes, keeping the ones that improve it. Simple versions, sometimes called hill climbing, stop at a local optimum, a solution where no nearby change helps. Better solutions may exist elsewhere. Local search is often paired with a construction step. GRASP, for example, repeats a randomized greedy construction followed by local search and keeps the best result found.
Metaheuristics
Metaheuristics are general strategies that guide local search and help it escape local optima. Common examples include:
- Simulated annealing, which sometimes accepts a worse move. The chance of accepting one shrinks as a cooling schedule proceeds.
- Tabu search, which keeps a short memory of recent moves and avoids returning to them.
- Genetic algorithms, which keep a population of candidate solutions and create new ones by combining and changing existing ones. Some sources place these under evolutionary computation rather than heuristics, so classifications differ here too.
Problem-specific heuristics
Many heuristics are written for one problem and do not fall neatly into the families above. A chess program’s evaluation function scores positions using rules its programmer chose. The estimate used in A* search, which judges how far a point is from the goal, is another example. These are often grouped as domain-specific heuristics.
Heuristics in other fields
The word is also used outside computer science:
- Psychology uses heuristics for mental shortcuts. The availability heuristic, described by Tversky and Kahneman, judges likelihood by how easily examples come to mind. Gerd Gigerenzer’s fast-and-frugal heuristics include take-the-best, which compares options by checking cues in order of importance until one cue settles the choice.
- Usability design uses heuristic evaluation, in which reviewers check an interface against a set of principles, such as Jakob Nielsen’s usability heuristics.
Choosing a classification
If you need one practical split, the three families above cover most of what computer science courses discuss. For a wider list of algorithm families beyond heuristics, see what are the 7 types of algorithms.
Key takeaways
- There is no official count of heuristic types. The number depends on how you classify them.
- In computer science, three common families are construction (greedy), improvement (local search) and metaheuristics.
- Metaheuristics include simulated annealing, tabu search and genetic algorithms.
- Many heuristics are problem-specific, and psychology and usability use the word in their own ways.