# 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.