Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 36 ยท Getting Started

Evolutionary Computation and Its Vocabulary

Learn the vocabulary of genetic algorithms (gene, chromosome, population, fitness, generation) and meet the evolutionary computation family: GA, ES, EP, GP and DE.

Genetic algorithms borrow words from biology, and the words are used loosely, so a newcomer can feel lost. "Chromosome" in one tutorial is "genome" in another and "individual" in a third. This lesson fixes the vocabulary you will use for the rest of the course, shows how each term maps to a variable in Python, and then places genetic algorithms in the larger family called evolutionary computation.

You do not need any biology. A GA is a computer program, and every biological word is just a name for a piece of data or a step in the loop.

The vocabulary

Biology word In a genetic algorithm Python picture
Gene One element of a solution one bit, one number, one city
Allele A possible value of a gene 0 or 1; any number in a range
Chromosome (genotype) The full encoded solution [1, 0, 1, 1, 0]
Phenotype The solution decoded into the real thing a schedule, a route, a number x = 5.3
Individual One candidate solution plus its fitness a chromosome and a score
Population The set of individuals alive now a list of chromosomes
Fitness How good an individual is a float returned by a function
Generation One pass of the loop one iteration of for
Parent / offspring Individuals used to build new ones / the new ones lists
Locus The position of a gene an index

Two ideas deserve emphasis.

Genotype versus phenotype. The GA manipulates the genotype (the encoded string), but fitness is about the phenotype (what the string means). A chromosome [1,0,1] may mean the number 5, the choice "take item 1 and 3", or the instruction set of a robot. A decoder turns genotype into phenotype before scoring. Choosing a good encoding is the most important design decision in a GA, and chapter 2 is devoted to it.

Fitness is not always "bigger is better". Some problems minimize a cost (route length, error). You can either convert (fitness = 1 / (1 + cost) or -cost) or let the selection code know that smaller is better. Be consistent.

The vocabulary in code

Python Genotype, phenotype and fitness

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Each row is an individual. The population is the list of six. The decoder is the bridge from the string of bits to the number x. The best possible x is 15 or 16 (fitness 240), and this random population has not found it yet, which is why we need generations of selection.

Parameters you will keep meeting

A GA has a few settings that you choose before it starts:

  • Population size (pop_size): how many individuals per generation.
  • Number of generations: how long to run.
  • Crossover rate (p_c): the chance that two selected parents are mixed instead of copied.
  • Mutation rate (p_m): the chance that each gene is altered.
  • Elitism: how many of the very best individuals pass unchanged to the next generation.

They are called hyperparameters because they are not part of the solution but control the search. The GA loop and parameters explains how to pick them.

The evolutionary computation family

Genetic algorithms are one member of a larger family of methods that all follow "population, variation, selection, repeat". They differ in what they evolve and which operator matters most.

Method Evolves Main variation Typical use
Genetic algorithm (GA) Bit strings, lists, permutations Crossover, with mutation as a helper Combinatorial and general optimization
Evolution strategy (ES) Vectors of real numbers (plus their own step sizes) Gaussian mutation Continuous parameter tuning
Evolutionary programming (EP) Finite-state machines, real vectors Mutation only Prediction, control
Genetic programming (GP) Programs as trees Subtree crossover and mutation Symbolic regression, rule discovery
Differential evolution (DE) Real vectors Adding scaled differences of vectors Continuous optimization

Related but different are swarm methods such as particle swarm optimization and ant colony optimization, which mimic flocks and insect trails rather than genetics. They appear in chapter 6. Together with simulated annealing and tabu search, these are called metaheuristics: general recipes for searching, not tied to one problem.

The evolutionary family

Genetic algorithm Strings and crossover
Evolution strategy Real numbers, Gaussian steps
Genetic programming Evolves program trees
Differential evolution Vector differences

Same loop, different material and operators.

1 / 2

A short history

Evolutionary ideas for computers began in the 1950s and 60s. Evolution strategies came from engineers in Germany tuning real designs, evolutionary programming from work on prediction, and genetic algorithms were popularized by John Holland and his students in the 1970s. Genetic programming grew in the 1980s and 90s. Today the field is often called evolutionary computation, and its methods are used inside machine learning tooling, engineering design software and game AI.

Common confusions

  • "Evolution picks the best." Not exactly. Selection is probabilistic and favors the fit, so weaker individuals sometimes reproduce. That is a feature: it keeps variety alive.
  • "Mutation is a bug." Mutation is a deliberate source of new genes. Without it a population can lose a useful value forever.
  • "A GA is just random search." Random search forgets. A GA keeps a population that remembers progress.

When you read a paper or library, translate its terms to this table first. "Chromosome", "genome" and "individual" often mean the same object, and "objective value" is usually the same as "fitness".

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the difference between a genotype and a phenotype?

    The GA manipulates genotypes (encoded chromosomes). Fitness is measured on the phenotype, the decoded real solution.
  2. 2. Which of these is a hyperparameter of a genetic algorithm?

    Hyperparameters such as population size, crossover rate and mutation rate are chosen before the run and steer the search. They are not part of any solution.
  3. 3. Which method evolves program trees?

    Genetic programming represents candidates as trees (programs or expressions) and uses subtree crossover and mutation.
  4. 4. Why does a GA allow weaker individuals to reproduce sometimes?

    Probabilistic selection keeps variety in the population, which helps the search escape poor regions.

Summary

  • A chromosome (genotype) encodes a solution; a decoder yields the phenotype that fitness measures.
  • A population is a list of individuals; one loop pass is a generation.
  • Population size, crossover rate, mutation rate and elitism are hyperparameters.
  • GAs belong to evolutionary computation with ES, EP, GP and DE; swarm methods and annealing are sibling metaheuristics.
  • Selection is probabilistic and mutation is deliberate, both to preserve diversity.

Next: Your First Genetic Algorithm