Genetic programming
Genetic programming is a special form of genetic algorithm – that is, the technique we have been applying throughout this book. In this special case, the candidate solutions – or individuals – that we are evolving to find the best one for our purpose are computer programs, hence the name. In other words, when we apply genetic programming, we evolve computer programs to find a program that will excel at performing a particular task.
As you may recall, genetic algorithms use a representation of the candidate solutions, often referred to as a chromosome. This representation is subject to genetic operators, namely selection, crossover, and mutation. Applying these operators to the current generation results in a new generation of solutions that is expected to produce better results than its predecessor. In most of the problems we have looked at so far, this representation was a list (or an array) of values of a certain type, such as integers...