Evolutionary Computation / Genetic Algorithms

From PRIMO.ai
Jump to navigation Jump to search


Imagine finding a delivery route among millions of possible orders of stops. Instead of testing every route, a genetic algorithm starts with a varied population, measures each route's quality, and generates new routes from selected parents. Mutation introduces changes, while crossover combines parts of existing candidates. Repeating this process can uncover useful solutions without requiring a derivative of the objective function.

The representation and evaluator matter as much as the search algorithm. A route must visit the required stops; an antenna must meet engineering constraints; a generated program must pass correctness checks. Evolutionary computation doesn't guarantee the global optimum, and it can waste substantial computation when the score rewards the wrong behavior.

How evolution works
Follow one generation
Choose a method
Match the search to the problem
Compare tradeoffs
Read a worked example
Research advances
How code and heuristics evolve
Applications
From antennas to game levels
Tools and software
Select an implementation
Try an experiment
Set a fair evaluation budget
Timeline
Trace the field’s development
What can evolve?
Routes, equations and models
Code search results
Read the benchmark evidence
Game design
Compare machine and player feedback
Videos and reading
See demonstrations and follow-up resources

The evolutionary loop

Evolutionary computation is the broader family of search methods. A genetic algorithm is one member of that family. Its population consists of encoded candidate solutions, and its selection rule determines which candidates contribute to later generations.

1. Create candidates
Initialize varied, valid solutions.
→ 2. Evaluate
Measure performance and constraint violations.
↑ Repeat within a fixed budget ↓
4. Generate offspring
Mutate, recombine, or sample new candidates.
← 3. Select and retain
Choose parents and preserve useful candidates.

Conceptual diagram. Some methods update candidates continuously rather than in synchronized generations; crossover isn't required by every evolutionary algorithm.

Crossover and mutation, pictured

Illustrative binary chromosome: each position represents a yes/no design choice
Candidate First segment Second segment Operation
Parent A 1 0 1 0 1 0 Selected candidate
Parent B 0 1 0 1 0 1 Selected candidate
Child 1 0 1 1 0 1 Crossover joins segments from A and B
Mutated child 1 0 1 1 1 1 Mutation flips one bit

The child must be evaluated. Recombination doesn't automatically make it better. Routes, programs, and physical designs require operators suited to their structure.

Key terms

Term Meaning
Individual / chromosome One encoded candidate solution. Its decoded behavior or design is sometimes called its phenotype.
Population The collection of candidates currently being considered.
Fitness / objective The measured criterion used to compare candidates. Some implementations minimize a cost rather than maximize fitness.
Selection Choosing candidates for reproduction or survival according to performance, diversity, or other criteria.
Mutation / crossover Changing a candidate / recombining information from parents.
Elitism Preserving selected high-performing candidates so useful results aren't lost through replacement.
Constraint A condition a valid solution must satisfy, such as a weight limit or a correctness test.
Pareto dominance One candidate is no worse on every objective and better on at least one. Non-dominated candidates express tradeoffs.
Evaluation budget The permitted number or cost of candidate tests. Count simulator runs, training runs, or physical experiments, not just generations.

Choose a method

Problem or goal Method to consider What it changes or preserves
Discrete or mixed design choices Genetic algorithm (GA) Encoded decisions, with problem-specific variation and constraint handling.
Continuous parameters without useful derivatives Evolution strategies, including CMA-ES A sampling distribution; CMA-ES adapts covariance to learn promising search directions.
Real-valued black-box optimization Differential evolution (DE) Parameter vectors, using scaled differences between population members.
Evolve formulas or programs Genetic programming (GP) Executable expressions or program structures. Control complexity as well as prediction error.
Balance conflicting objectives NSGA-II and related multi-objective methods A set of non-dominated candidates rather than one weighted-score winner.
Evolve neural networks Neuroevolution; NEAT for topology and weights Network parameters, connectivity, or both, depending on the method.
Find different useful behaviors MAP-Elites and other quality-diversity methods A repertoire of good solutions across specified behavioral descriptors.
Improve code with automatic tests LLM-guided evolutionary program search Programs proposed by language models and retained according to measured results.

These are starting points for comparison, not a universal ranking. pymoo documents several families and constraint-handling methods. Hansen's CMA-ES introduction explains its strengths and why derivative-based methods can be faster on suitable problems.

Multi-objective search: choosing among tradeoffs

A lighter component may cost more. A faster algorithm may use more memory. NSGA-II seeks a spread of non-dominated solutions so the decision-maker can compare these tradeoffs. A returned approximation isn't proof that the true Pareto front has been found. Deb and colleagues, 2002

Reading a Pareto chart

Four delivery schedules cover the same stops and meet every deadline. The dispatcher wants fewer driver hours and fewer kilometers. Each occupied square represents one schedule. Moving left saves time, and moving down saves distance.

Illustrative schedules, with lower values preferred on both axes
Distance ↓ / driver hours → 5 hours 6 hours 7 hours
100 km A D
90 km B
80 km C

A, B and C form the observed Pareto front. Choosing B over A saves 10 km and costs one driver hour. Choosing C over B makes the same trade. D drops out because A covers the same distance in two fewer hours. If a new union agreement caps a shift at six hours, C becomes infeasible and the dispatcher can choose between A and B. The numbers illustrate the decision and come from no particular delivery operation.

Quality diversity: keep a repertoire

MAP-Elites divides a user-defined descriptor space into cells and retains a high-performing candidate in each occupied cell. Descriptors describe how solutions differ; fitness measures how well they perform. This differs from treating every descriptor as an objective to maximize. Mouret and Clune, 2015

Illustrative behavior archive, not measured experimental results
Robot behavior Low turning rate Medium turning rate High turning rate
Fast movement Gait A
Score 88
Gait B
Score 76
Gait C
Score 63
Medium movement Gait D
Score 79
Gait E
Score 90
Gait F
Score 68
Slow movement Gait G
Score 61
Gait H
Score 74
Unfilled cell

Each cell stores its own best candidate so far. Darker green indicates a higher illustrative fitness score. Different behaviors can remain useful even when they don't have the highest overall score.

Current developments

Language models become variation operators

Traditional mutation might flip a bit or perturb a number. A language model can instead propose a meaningful code change. The evolutionary system evaluates that proposal and uses retained programs to inform further attempts. The program population evolves; the language model's weights needn't change.

FunSearch (2023) paired a pretrained model with evaluators and an island-based program population, reporting new cap-set constructions and improved bin-packing heuristics. Its practical requirements include an efficient evaluator and feedback that distinguishes better candidates. FunSearch paper

AlphaEvolve (2025) extended this approach to broader algorithm optimization. Google reported deployment of an evolved scheduling heuristic that recovered an average 0.7% of its worldwide compute resources. That is a result for Google's system and workload, not an expected gain for every user. AlphaEvolve announcement

The 2026 expansion: Google reported applications to sequencing, power-flow feasibility, routing, and infrastructure. Examples included 30% fewer variant-detection errors in a DeepConsensus application and a 20% reduction in Spanner write amplification. These are different task-specific metrics, not a single measure of intelligence or general optimization quality. Google DeepMind, May 7, 2026

OpenEvolve offers an independent open-source implementation of this general approach, using language-model mutations, island populations, and MAP-Elites. It isn't Google's AlphaEvolve service, and its availability doesn't establish equivalent performance. Project repository

Evolving a reusable rule

In online bin packing, items arrive one at a time and the solver must place each into a bin with enough room. A search can evolve the rule that chooses a bin. Once selected, that rule can handle many arrival sequences. In their 2024 Evolution of Heuristics study, Liu and colleagues evolved both a short description of each rule and executable code. The practical test is whether the resulting rule still saves bins on fresh sequences. ICML paper

How costly was discovery? The ShinkaEvolve authors reported finding a new best-known circle-packing arrangement for their benchmark using 150 candidate samples. The arrangement can be checked geometrically. The sample count describes the search effort on that task, while elapsed time also depends on the models and evaluator. The project illustrates how parent selection and screening similar proposals can affect the cost of discovery. ICLR 2026 paper · Project and animated packing diagram

Comparing code search results

CodeEvolve uses several populations of candidate programs. A language model proposes changes, an evaluator scores each program, and an archive keeps varied candidates available for later rounds. In October 2026 the authors reported two comparisons across nine benchmark problems. The comparison with previously published scores and the reruns under matched conditions answer different questions. Findings of EMNLP paper

CodeEvolve results across nine benchmark problems
Comparison Problems meeting the stated criterion
Matched or exceeded the published AlphaEvolve score 5 of 9
Outperformed OpenEvolve and ShinkaEvolve in the authors’ matched comparison 6 of 9

Each bar counts problems. Its length gives no information about the size of an improvement on any one problem. To judge whether to adopt a framework, compare cost and correctness on the workload it will actually run. Study methods and results

Faster evaluation and more informative search

Accelerator-based evolution: EvoJAX and evosax use JAX to exploit parallel computation. Their benefit depends on whether the candidate evaluator can also run efficiently on accelerators; a slow external simulator or physical experiment can remain the bottleneck. EvoJAX ... evosax

More flexible AutoML: TPOT's graph-based redesign supports richer search spaces, genetic feature selection, and multiple objectives. Its documentation explains that the work previously called TPOT2 has been merged into TPOT. TPOT documentation

Learning which variables interact: A September 2026 paper investigated extracting variable importance and interaction information during genetic search without additional fitness evaluations. Experiments covered NK landscapes and feature selection. The result supports more informed reproduction operators within those tests; it isn't evidence that one operator is best for all problems. Tinós and colleagues, 2026

Applications and impacts

Application What evolves Impact and evidence
Engineering design Shapes, dimensions, or design-generating programs NASA's ST5 mission flew evolved antennas in 2006, demonstrating a path from computational search to tested hardware. NASA technical report
Robotics Controllers and behavioral repertoires The 2015 Intelligent Trial and Error research combined a precomputed behavior map with adaptation after damage. It demonstrated recovery on the tested robots, rather than universal self-repair. Research paper
Neural architecture search Network architectures Regularized evolution produced AmoebaNet, showing evolutionary architecture search could compete with strong image-classification designs of its period. Research paper
Machine-learning pipelines Feature choices, preprocessing, estimators, and pipeline structures TPOT automates the search over these choices. Evaluation design still determines whether apparent gains generalize. Documentation
Mathematics and algorithm discovery Programs that generate constructions or implement heuristics FunSearch showed that searching for programs can produce compact, testable discoveries. Research paper
Computing infrastructure Scheduling rules and code AlphaEvolve provides a reported production example of evolutionary program search. See the dated results above.
Game design and simulation Rules, maps, unit parameters, or agent strategies A possible design workflow: evolve candidates using automated playtests, retain varied styles, then test them with people. This is an illustrative application, not a claim that an automated score measures enjoyment.

What can evolve

The choice of candidate determines what the user gets back. A dispatcher needs an ordered set of stops, a physicist might want an equation to test, and a model developer might want a recipe for combining existing models.

From candidate to practical test
Route → schedule
Change the order of stops. Check distance, vehicle capacity and arrival windows.
Expression → prediction
Change an operator or a term. Compare predictions with measurements withheld during search.
Merge recipe → model
Change how existing models contribute. Test both the desired capability and skills the merge might lose.

Vehicle routing. The 2024 PyVRP paper describes a hybrid genetic search that combines population-level variation with local improvements to candidate routes. A reader reproducing that result needs the implementation described in the paper. The project's current algorithm guide documents iterated local search. Both solve routing problems, but the release and search method matter when comparing results. Published solver · Current algorithm guide

Equation discovery. In symbolic regression the candidate is an expression, so the result can be printed and tested directly. PySR lets researchers compare formulas with different errors and complexities. For example, two equations might fit the measured swing of a pendulum equally well. Measurements at a different amplitude can distinguish them. The 2009 work by Schmidt and Lipson provides an experimental example of searching for physical relationships from motion data. PySR methods paper · Original motion-data study

Combining pretrained models. A 2025 study searched over recipes for merging existing models. The authors tested whether a merge could bring capabilities from different source models together, including Japanese-language and mathematical skills. The potential saving is in reusing trained models. Selecting a recipe still requires evaluations, and a useful comparison includes every source model on the same tasks. Nature Machine Intelligence study

Game design and automated playtesting

Fontaine and colleagues used evolutionary search to build a collection of playable Super Mario Bros. scenes. Designers could browse scenes by gameplay features such as enemies and obstacles. An online study then asked people about the scenes’ difficulty and appearance. This makes two evaluations visible. An automated player can establish that it found a path through a scene, while a player can report that the jump on that path felt unfair. AAAI study and user evaluation

A tabletop designer could apply the same idea to railway maps. First reject any map with disconnected stations. Then keep alternatives across two dimensions, the number of junctions and the length of the shortest route. Two maps with equally short routes might play very differently if only one offers a way around a blocked track. A human playtest can reveal whether that choice creates tension or simply adds delay. This railway example illustrates how to use a repertoire during design.

For biological applications, distinguish computational evolutionary search from laboratory directed evolution. One searches encoded candidates using a computational evaluator; the other selects physical biological variants through experiments. They can be combined, but searching a protein sequence doesn't establish that it folds, functions, or is safe. Related topics: Bioinformatics, Genome, Protein Folding & Discovery, and Pharmaceuticals.

Tools and software

Tool Useful for What you'll need
PySR Search for a compact mathematical expression that fits measurements Supply variables and allowed operators, then check candidate equations on independent observations.
PyVRP Compare vehicle routes under capacity and timing constraints Record the solver version. The published hybrid genetic search and the current implementation use different search methods.
CodeEvolve Search a population of programs using language-model edits Supply executable tests and a performance measure. Reserve unseen cases to check the selected program.
pyribs Build and inspect collections of solutions indexed by behavior, including MAP-Elites archives Choose descriptors that distinguish useful alternatives. The example gallery includes robot arms, lunar landing and image generation.
ShinkaEvolve Evolve and compare candidate programs using an automatic evaluator Supply a starting program and a measurable task. Track evaluations, model costs and performance on independent cases.
DEAP Custom genetic algorithms and genetic programming A representation, evaluator, and chosen operators.
pymoo Single- and multi-objective optimization, constraints, and tradeoff visualization Objectives, variable types, bounds, and constraints.
Nevergrad Comparing gradient-free optimizers with continuous, discrete, or mixed variables A callable objective and evaluation budget. Its collection includes methods beyond evolutionary algorithms.
TPOT Evolving machine-learning pipelines Suitable data, a validation strategy, and computation time. See also TPOT on PRIMO.ai.
EvoJAX Hardware-accelerated neuroevolution JAX-compatible tasks and suitable hardware.
evosax JAX-based evolution strategies An evaluator that can benefit from batching and parallel execution.
OpenEvolve LLM-guided program evolution Starting code, a trustworthy evaluator, model access, and a budget.

These are developer and research tools. Check their current documentation, licensing, and hardware requirements before choosing one.

A practical first experiment

  1. Define success. Write down objectives and hard constraints before searching. For delivery routes, distinguish total distance from deadlines that must be met.
  2. Choose a representation. Use a route permutation, parameter vector, feature mask, or program structure that matches the task.
  3. Establish baselines. Compare with random search and a reasonable conventional solver or human-designed solution.
  4. Set a budget. Count evaluations, elapsed time, model calls, and other material costs.
  5. Preserve diversity. Track whether candidates have become nearly identical; consider restarts or a repertoire when appropriate.
  6. Validate independently. Use unseen instances, repeated random seeds, correctness tests, and physical checks where relevant.
  7. Review the result. Retain the candidate, configuration, evaluator version, and evidence needed to reproduce the comparison.

When another approach may fit better

Smooth differentiable objectives often favor gradient-based optimization. Problems with strong mathematical structure may favor linear programming, mixed-integer programming, or constraint programming. Expensive evaluations may favor Bayesian optimization or surrogate-assisted search. Evolutionary methods can be combined with these approaches, but their extra search cost should earn its place in a fair comparison.

Common failure modes include premature convergence, overfitting to benchmark cases, invalid offspring, noisy rankings, and exploiting loopholes in the score. Generated code should run with resource limits and isolation appropriate to the evaluator.

Timeline

Selected milestones, oldest first. Dates refer to the named book, publication, announcement, or deployment; they aren't claims that a whole field began in that year.

Date Milestone Why it matters / source
1954 Barricelli publishes early numerical evolution experiments Simulated reproduction and competition made evolution itself an object of computer experiments. Source
1965 Rechenberg and colleagues develop early evolution strategies Engineering design experiments establish a separate line of work on varying numerical parameters. Source
1966 Fogel, Owens and Walsh describe evolutionary programming Selection and variation operate on candidate machines for prediction. Source
1975 Holland publishes Adaptation in Natural and Artificial Systems A foundational framework for genetic adaptation and search. Later MIT Press edition
1992 Koza publishes Genetic Programming Develops population-based search over computer programs. Publisher
1994 Sims evolves virtual creatures The bodies and controllers of simulated creatures can change together. Study
1996 Hansen and Ostermeier introduce covariance matrix adaptation Search learns the shape of a useful continuous sampling distribution. Author's history
1997 Storn and Price publish the journal account of differential evolution A simple population method for continuous optimization. Paper
2001 Hansen and Ostermeier publish Completely Derandomized Self-Adaptation in Evolution Strategies A major development of CMA-ES. Author's references
2002 Deb and colleagues publish NSGA-II Combines efficient non-dominated sorting, elitism, and diversity preservation. Paper
2002 Stanley and Miikkulainen publish NEAT Evolves neural-network topology and connection weights. Paper
2006 NASA launches ST5 with evolved antennas An example of evolved hardware reaching spaceflight. NASA
2008 Picbreeder reports collaborative image evolution Users can select images and branch from another person’s discoveries, making human preference part of selection. Study
2009 Schmidt and Lipson search for physical laws in experimental data Symbolic search yields expressions that scientists can inspect and test. Study
2011 Lehman and Stanley publish the novelty-search journal paper Studies behavioral novelty as an alternative to direct objective progress. University record
2015 Mouret and Clune present MAP-Elites Maps diverse high-performing solutions across chosen descriptors. Paper
2015 Robots that can adapt like animals appears in Nature Combines a behavioral repertoire with rapid adaptation after damage. Preprint, first posted 2014
2017 Salimans and colleagues study scalable evolution strategies Demonstrates highly parallel black-box policy optimization. Paper
2018 / 2019 Regularized evolution and AmoebaNet Architecture-search preprint in 2018; AAAI publication in 2019. Paper
2019 POET pairs challenges with candidate solvers A controller developed on one terrain can become a starting point on another. Source
2020 Enhanced POET expands open-ended search The study examines how generated challenges and transferred solvers support a broader curriculum. Source
2020 AutoML-Zero evolves learning algorithms from elementary operations Its experiments recover recognizable learning procedures within a specified instruction set. Study
May 2021 Quality-diversity search produces playable Mario scenes Designers can browse different mechanics and compare automated playability with player judgments. Source
February 2022 EvoJAX paper Hardware-accelerated neuroevolution toolkit. Paper
December 2022 evosax paper JAX-based evolution strategies with accelerator support. Paper
2023 The pyribs software paper appears at GECCO A shared library gives researchers reusable components for building and comparing behavior archives. Source
May 2023 Cranmer publishes the PySR methods preprint Researchers can compare the accuracy and complexity of evolved equations. Study
December 2023 FunSearch Combines LLM proposals, program evolution, and automated evaluation. Nature paper
2024 TPOT2 graph-based implementation chapter Describes a redesign now incorporated into TPOT. Project documentation and citation
2024 Evolution of Heuristics appears at ICML The search varies written rules alongside executable implementations and scores them on optimization tasks. Source
2024 The PyVRP solver paper appears Hybrid genetic search and local improvement are evaluated on routing benchmarks. Study
January 2025 Evolutionary model merging appears in Nature Machine Intelligence Search selects how pretrained models contribute to a merged model. Study
May 2025 AlphaEvolve announced Extends LLM-guided evolution to broader algorithm optimization. Announcement
September 2025 Sakana AI introduces ShinkaEvolve Its circle-packing example shows candidate programs and the geometry they produce. Source
ICLR 2026 ShinkaEvolve reports a 150-sample circle-packing result The paper gives an explicit candidate budget for this benchmark. Source
April 2026 Sequence sort is published The paper addresses the cost of assigning candidates to non-dominated fronts in multi-objective optimization. Study
May 2026 AlphaEvolve impact report Google reports a wider set of scientific and commercial applications. Report
August 2026 issue A constraint-diversity sorting method is published The method studies when retaining infeasible candidates can help a constrained search. Study
September 2026 Genetic search learns variable importance and interactions Tests information-guided reproduction on NK landscapes and feature selection. Paper abstract
October 2026 CodeEvolve reports program-search benchmarks The authors distinguish comparisons to published scores from tests under matched conditions. Conference paper

Videos and further learning

YouTube search: evolutionary and genetic algorithms ... Google search

The existing video collection is retained below. Use it alongside the dated research above; older demonstrations don't necessarily describe current tools or performance.

Modeling Evolution with Tensorflow.js
Siraj Raval models evolution with TensorFlow.js.

Genetic Algorithm in Artificial Intelligence - The Math of Intelligence (Week 9)
Siraj Raval explains genetic algorithms in The Math of Intelligence.

Genetic Algorithms - Learn Python for Data Science #6
Siraj Raval introduces genetic algorithms in Python for data science.

Data Science - Part XIV - Genetic Algorithms
Derek Kane explains genetic algorithms.

9.1: Genetic Algorithm: Introduction - The Nature of Code
The Coding Train introduces genetic algorithms (The Nature of Code).

Artificial Intelligence with Genetic Algorithms in your browser | Luis Crespo
Luis Crespo on AI with genetic algorithms running in the browser.

FFNN with genetic algorithm
Demo of a feedforward neural network trained with a genetic algorithm.

AI learns to play simple game ( Tensorflow and genetic algo) demo
Demo of an AI learning a simple game with TensorFlow and a genetic algorithm.

This Evolving AI Finds Bugs in Games | Two Minute Papers #250
Two Minute Papers on an evolving AI that finds bugs in games.

Artificial Life, Open-Ended Evolution, and the Origins of Biological Complexity
Santa Fe Institute talk on artificial life, open-ended evolution and the origins of biological complexity.

Evolutionary Algorithms
Dr. Shahin Rostami introduces evolutionary algorithms.

Evolving Regular, Modular Neural Networks
Evolving AI Lab on evolving regular, modular neural networks.

Mystic (good representation)
Evolving AI Lab demonstration of an evolved representation.

Aligning Phenotypic and Genotypic Modularity [Supplementary material]
Evolving AI Lab supplementary video on aligning phenotypic and genotypic modularity.

MarI/O - Machine Learning for Video Games
SethBling's MarI/O, which uses neuroevolution to learn to play Super Mario World.

Nature

Natural evolution inspired these methods, but biological evolution doesn't optimize a single human-defined engineering score. Computational algorithms simplify selected mechanisms for specific tasks.

YouTube search: biology, evolution, and AI

Wallace Marshall (UCSF): Ten Craziest Things Cells Do
Wallace Marshall of UCSF on ten of the craziest things cells do.

The Singular Origin of Complex Life
Santa Fe Institute talk on the singular origin of complex life.

Evolution of Mind

Evolving a useful controller doesn't establish consciousness. These broader questions connect with Neuroscience, Symbiotic Intelligence, and Connecting Brains.

YouTube search: information, mind, and evolution

Information, Evolution, and intelligent Design - With Daniel Dennett
Daniel Dennett on information, evolution and intelligent design at the Royal Institution.

Daniel Dennett | From Bacteria to Bach and Back | Talks at Google
Daniel Dennett discusses From Bacteria to Bach and Back at Talks at Google.

Related learning paths

Research checked November 24, 2026. Numerical improvements belong to the cited task, baseline, and evaluation conditions.