Evolutionary computation is a fantastic field in computer science. Apart from allowing you to play God using your computer, it takes inspiration from Darwinian evolution to solve problems in mechanics, physics, logistics, robotics and virtually any field you can think of. Today I’m going to discuss genetic algorithms.

What is evolution?

Selection pressure for camouflage has resulted in the unusual appearance of leafy seadragons. Photo by Lyn Gateley.
Selection pressure for camouflage has resulted in the unusual appearance of leafy seadragons. Photo by Lyn Gateley.

In the real world, evolution is the process by which organisms change over time in response to selection pressures. For evolution to work on a population there are four requirements:

  • There must be variation in the population.
  • Selection pressure must act on the population.
  • There must be replication (inheritance).
  • This replication must not be perfect (mutations can occur).

Selection pressure is a term which refers to the ‘force’ that favours certain characteristics in the population. For example, being well camouflaged might prevent predators from finding you. Being eaten as a baby is a sure-fire way to not have any offspring, so individuals who are better camouflaged have an advantage over others. In this situation, we would say that there is a selection pressure on the species for being well camouflaged.

Genetic variation (ordinarily clones don't have genetic variation). Picture by Pascal.
Genetic variation (ordinarily clones don’t have genetic variation). Picture by Pascal.

Variation in a population gives a sub-section of the population an advantage (i.e. some individuals are fitter than others). Selection pressure acts to ensure fitter members of the population are more likely to have offspring. The offspring inherit the characteristics which made their parents good at reproducing and so are likely to go on to have more offspring of their own. With each generation the population becomes fitter and fitter. The replication process, however, must be error prone so that there is a source of variation. This allows new characteristics to be discovered and tested.

Artificial evolution and genetic algorithms

Genetic algorithms take this basic process of evolution and recreate it using a computer program. A number of virtual organisms (called solutions) change through subsequent generations, inheriting characteristics from their “parents”. Like in biological evolution, artificial evolution favours individuals which contain fitter characteristics, allowing them to produce offspring at a higher rate than less fit individuals.

We created this??!
We created this??! Picture by Tony Alter.

Using computers to do evolution is useful because we can specify the selection pressures which shape the evolving solutions. This is the main difference between biological and artificial evolution. In biological evolution fitness is always determined as the ability to reproduce. In artificial evolution, the computer programmer can decide what constitutes fitness, then let evolution take care of designing things which better meet that criteria. It’s similar to selectively breeding animals to create breeds which contain particular characteristics (see picture below). But instead of a human applying selection pressure by explicitly choosing which individuals are allowed to reproduce in each generation, a computer program automates the process.

This can be used to do some really cool stuff. Not only can we use them to solve difficult problems, but they can be used to come up with innovations which human designers may never think of. Human engineers are constrained by human ways of thinking, their training, and the tools they’re provided with. Evolution has none of these constraints (or more correctly, evolution has different constraints). Karl Sims illustrates a wide range of design innovations by evolving virtual organisms to swim, jump, run and crawl in a virtual 3D environment. The whole research project resembles some sort of Olympic games for virtual creatures (a video is embedded below). A more practical (though less fun) example is work by Smith et al, which uses genetic algorithms to search for new manoeuvres for fighter pilots to use during aerial dogfights.

Genetic algorithms have also been used to evolve virtual (but functional) Lego bridges and evolve walking behaviour in six legged robots. There’s even a web application which allows you to evolve Lego structures using your own specifications (requires Java).

Rather than running a genetic algorithm once to find a solution, they can run continuously, allowing computer systems to adapt to changes in their operating environment as they arise. This can be taken a step further by using them to control specialised computer circuits which can change their configuration. This makes it possible to have adaptable, evolving electronics which respond to their current situation (this field is called evolvable hardware). Skynet, anyone? NASA are involved in research which will hopefully one day lead to self-repairing satellites and unmanned spacecraft which can adapt to unexpected conditions and extreme changes in temperature. While this research is in the early stages, the advantages that your multi-million dollar unmanned spacecraft can repair itself mid-mission are obvious. Besides, if robots are going to evolve sentience it might be better if they do it in the outer edges of the solar system…

Evolutionary algorithms feed back into biology

So, understanding biological processes has helped create new tools and solve problems in all manner of other fields. That is pretty cool. But evolutionary computation also feeds back into biology, helping us better understand biological processes! They’ve been used to help predict the shape and function of proteins, a notoriously difficult task in molecular biology. Their similarity to biological evolution makes them ideal for modelling many phenomena in natural evolution, such as the selection pressures exhorted by the immune system on the malarial parasite during an infection.

I couldn’t find anywhere to put this, but I thought it was too entertaining to leave out. It’s a video of a simulated humanoid learning to jump, using a genetic algorithm. I am constantly amazed by the number of things people have done with genetic algorithms.

References and interesting videos:

Advertisements