What is the difference between heuristics and metaheuristics?

You could think of a heuristic like an approximate (not approximation) solution to a problem. The difference between approximate and approximation is that the first is about getting a good guess of the solution of a problem, but that you don't really know how good it is. The second is about getting a solution for which you can prove how close it is to the optimal solution.

So, heuristics are often problem-dependent, that is, you define an heuristic for a given problem. Metaheuristics are problem-independent techniques that can be applied to a broad range of problems. An heuristic is, for example, choosing a random element for pivoting in Quicksort. A metaheuristic knows nothing about the problem it will be applied, it can treat functions as black boxes.

You could say that a heuristic exploits problem-dependent information to find a 'good enough' solution to a specific problem, while metaheuristics are, like design patterns, general algorithmic ideas that can be applied to a broad range of problems.


For a detailed explanation, see:

Sörensen, K. (2015). Metaheuristics—the metaphor exposed. International Transactions in Operational Research, 22(1), 3-18.

A metaheuristic is a high-level problem-independent algorithmic framework that provides a set of guidelines or strategies to develop heuristic optimization algorithms. The term is also used to refer to a problem-specific implementation of a heuristic optimization algorithm according to the guidelines expressed in such a framework (Sörensen, 2015).

The heuristics are the guidelines, metaheurstics is the framework that uses those.


In order to give a proper quotation, relative to Alejandro answer:

« A metaheuristic is a high-level problem-independent algorithmic framework that provides a set of guidelines or strategies to develop heuristic optimization algorithms [...] A problem-specific implementation of a heuristic optimization algorithm according to the guidelines expressed in a metaheuristic framework is also referred to as a metaheuristic » (Sörensen, Glover on http://scholarpedia.org/article/Metaheuristics)

To be fully complete. We should distinguish between exact, approximate and heuristics algorithms. An exact algorithm finds an exact solution. An approximate algorithm should find an approximate solution, within an acceptable time, as well as indicate its discrepancy range with the supposed optimal solution. An heuristics simply find a good-enough solution, within an acceptable time.

By the way, Alejandro quicksort's example does not appear fully adequate for two or three different reasons.

  1. In fact, heuristics and metaheuristics are part of optimization's field. The problem they try to tackle is therefore of searching an optimum, not of sorting.
  2. Heuristics are generally use when the problems you want to tackle is too complex, in the computational sense - which is not the case of sorting problem.
  3. What was pointed at through the quicksort example, if I understand it well, is the random element. In principle, you can have deterministic heuristics - I never encountered a deterministic metaheuristics, but probably one could code it. It might be a bit "playing with words" but, the random element more properly characterizes "stochastic search" than (meta)heuristics.