A memetic algorithm is a population-based optimization method that combines evolutionary global search with individual local improvement, so that each candidate solution is refined by a problem-specific heuristic before or after it competes for survival. In evolutionary computation, it is also called a hybrid genetic algorithm, because a genetic algorithm usually provides the outer loop while a local search procedure supplies the refinement.
The name was introduced by Pablo Moscato in 1989 and borrows the idea of a meme, a unit of cultural information that is improved by its carrier during a lifetime, unlike a gene, which changes only between generations. Memetic algorithms are among the most competitive methods for hard combinatorial problems such as vehicle routing, scheduling and the traveling salesman problem.
How a memetic algorithm works
A memetic algorithm follows the familiar evolutionary cycle of selection, variation and replacement, but inserts a local search step that improves offspring before they enter the population. The global evolutionary component explores distant regions of the fitness landscape, while the local component exploits the neighborhood of each promising point.
- Initialize a population of candidate solutions, often seeded with constructive heuristics.
- Select parents with a method such as tournament selection.
- Create offspring through crossover and mutation.
- Apply local search to some or all offspring until a local optimum or a step budget is reached.
- Replace population members according to fitness and a diversity management rule, then repeat.
The table below shows how the two layers divide the work of the search.
| Layer | Role | Typical operators |
|---|---|---|
| Evolutionary layer | Global exploration across basins | Selection, crossover, mutation |
| Local search layer | Exploitation within a basin | Hill climbing, 2-opt, tabu search, gradient steps |
| Population management | Maintains diversity and stability | Elitism, niching, restart rules |
Key design decisions and variants
The performance of a memetic algorithm depends less on the evolutionary core and more on how local search is integrated. Designers must decide what improvement procedure to use, how often to apply it, how long to run it and whether its result is written back into the genotype.
| Parameter | Typical choices | Effect |
|---|---|---|
| Local search frequency | Every offspring, or 5-50 percent of them | Higher frequency raises quality but costs evaluations |
| Local search depth | Full convergence or a fixed step budget | Deep search risks losing diversity |
| Selection of individuals to refine | Random, best-ranked or diversity-based | Steers effort toward promising regions |
| Write-back policy | Lamarckian or Baldwinian | Controls whether improvements are inherited |
| Neighborhood structure | Swap, insertion, 2-opt, k-opt | Defines what counts as a small change |
In Lamarckian learning, the improved solution replaces the original genotype, so improvements are inherited directly and convergence is fast. In Baldwinian learning, only the improved fitness value is kept, while the genotype stays unchanged; this preserves diversity but converges more slowly. Many practical systems use a partial Lamarckian strategy that writes back improvements for a fraction of individuals.
Later research produced adaptive and multi-meme variants, sometimes called second- and third-generation memetic algorithms, in which several local search operators compete and the algorithm learns which one helps most. This idea overlaps with hyper-heuristics and with self-adaptation in evolution strategies.
Memetic algorithms compared with related methods
Memetic algorithms sit between pure population methods and pure trajectory methods. Compared with a plain genetic algorithm, they converge faster and reach better optima on structured problems. Compared with standalone local search, they escape poor local optima more reliably because recombination combines good partial solutions.
| Method | Search style | Main strength | Main weakness |
|---|---|---|---|
| Genetic algorithm | Population, global | Broad exploration | Slow fine-tuning near optima |
| Memetic algorithm | Population plus local refinement | High solution quality | Higher cost per generation |
| Iterated local search | Single trajectory with perturbation | Simple and fast | Limited recombination of good features |
| Differential evolution | Population, vector differences | Strong on continuous problems | Weaker on combinatorial structure |
A frequent source of confusion is the claim that any hybrid evolutionary method is memetic. Strictly, the term applies when individual-level improvement is part of the evolutionary cycle, not when a local optimizer merely polishes the final best solution once at the end.
Where memetic algorithms are used
Memetic algorithms are most valuable when a good problem-specific local search already exists and the landscape has many local optima. They have produced leading results in benchmarks for routing, timetabling and graph partitioning.
- Vehicle routing with time windows, where 2-opt and relocate moves refine routes.
- Job shop and flow shop scheduling, using neighborhood moves on critical paths.
- Quadratic assignment and graph coloring, often combined with tabu search.
- Protein structure prediction and molecular docking in computational biology.
- Neural network training, where gradient descent acts as the local refinement step.
Limitations and common mistakes
The main risk is loss of population diversity. When every offspring is driven to the nearest local optimum, many individuals fall into the same basin, causing premature convergence. Diversity measures, restarts or distance-based replacement are standard countermeasures.
A second problem is unfair comparison. Because local search consumes many fitness evaluations, comparing a memetic algorithm with a genetic algorithm by generation count is misleading; comparisons should use equal evaluation budgets or equal wall-clock time. Finally, a strong local search tuned for one problem may transfer poorly to another, which limits out-of-the-box generality.
Theory also lags behind practice. Convergence guarantees exist only for simplified models, and runtime analyses show that local search can help on some landscapes and hurt on deceptive ones. Practitioners should therefore tune local search intensity empirically, starting with refinement of a small fraction of offspring and increasing it only when the extra evaluations clearly pay off in final solution quality.
Implementation details matter as well. Efficient delta evaluation, which recomputes only the cost change caused by a move, often makes local search ten or more times faster than full re-evaluation, and it frequently decides whether a memetic design is practical within a fixed time limit.
Put simply
A memetic algorithm searches for the best answer in two ways at once. It keeps a group of possible answers and lets them mix, as in evolution. It also lets each answer improve itself a little before the next round.
Imagine a class of students solving a puzzle. Every day they share ideas and combine the best ones. Every evening each student also practices alone to polish their own attempt. The class learns faster than with sharing alone or practice alone.
In practice
A regional delivery company must plan routes for 60 vans serving about 1,200 addresses each day, with strict delivery time windows. A plain genetic algorithm finds feasible plans but leaves visible inefficiencies, such as routes that cross each other.
The planning team builds a memetic algorithm with a population of 100 route plans. After crossover, each offspring receives a short 2-opt and relocate local search limited to 200 moves. A distance-based replacement rule keeps different route structures in the population.
Within the same five-minute computing budget, the memetic version reduces total driven distance by roughly 6 to 9 percent compared with the genetic algorithm alone, and it meets every time window. The result is a plan that dispatchers can use each morning without manual correction.