Genetic algorithms (GAs) form a class of algorithms used to find approximate solutions to difficult-to-solve problems, inspired by and named after biological processes of inheritance, mutation, natural selection, and the genetic crossover that occurs when parents mate to produce offspring. Genetic algorithms are a particular class of evolutionary algorithms.
John Holland was the pioneering founder of much of today's work in genetic algorithms, which has moved on from a purely theoretical subject (though based on computer modelling), to provide methods which can be used to solve some difficult problems today. Problems which appear to be particularly appropriate for solution by genetic algorithms include timetabling and scheduling problems, and many scheduling software packages are based on GAs.
The problem to be solved is represented by a list of parameters which can be used to drive an evaluation procedure. Possible solutions to the problem (referred to as chromosomes) are also represented in this parameter list form. These chromosomes are evaluated, and a value of goodness or fitness is returned.
- Initially several such parameter lists or chromosomes are generated randomly, to form an initial pool of possible solutions. This is called the first generation pool.
- All of the chromosomes are evaluated, and effectively the pool is sorted with those having better fitness at the top, representing better solutions to the problem. Notice that better in this context is relative, as initial solutions are likely to be rather poor.
- The first step in the construction of the next generation is to select a pair of chromosomes for crossover. Selection is biased towards elements of the initial generation which have better fitness, though it is not so biased that poorer elements have no chance to participate. This can be done using roulette wheel selection or using a ranking method.
- Then perform the crossover (or recombination) genetic operator. This results in a new pair of lists, which are added to the second generation pool. This can be repeated until there are an appropriate number of new lists in the second generation pool.
- The next step is to mutate the newly developed pool, again by a process of selection, this time of individual chromosomes, followed by application of the mutation genetic operator.
A slight variant of this method of pool generation is to allow some of the better chromosomes from the first generation to carry over to the second. This form of genetic algorithm is known as elite.
The process continues by generating 3rd, 4th, 5th ... generations, until one of the generations contains solutions which are good enough.
There are several general observations to make about the generation of solutions.
- GAs may have a tendency to converge towards local solutions rather than global solutions to the problem to be solved
- as time goes on each generation will tend to have multiple copies of successful parameter lists, which require evaluation, and this can slow down the processing
- the most important genetic operators are selection and crossover. Mutation is only necessary to ensure that potential solutions are not lost.
- GAs are not good at finding optimal solutions but can rapidly locate good solutions, even for difficult search spaces.
Genetic algorithms are known to produce good results for some problems. Their major disadvantage is that they are relatively slow, compared to other methods, such as random optimisation. Recent speed improvements have focused on speciation, wherein cross-over can only occur if individuals are closely-enough related. Genetic algorithms have been successfully applied to the study of neurological evolution (see NeuroEvolution by Augmented Topologies).
Genetic programming is a related technique developed by John Koza, in which computer programs, rather than function parameters, are optimised. Genetic programming often uses tree-based internal data structures to represent the computer programs for adaptation instead of the list, or array, structures typical of genetic algorithms. Genetic programming algorithms typically require running time that is orders of magnitude greater than that for genetic algorithms, but they may be suitable for problems that are intractable with genetic algorithms.