Last, you reproduce those parents with genetic operations to generate new and possibly better individuals in the next generation. The two main classes of genetic operations are mutation and crossover. Mutation operates on a single parent by randomly changi ng some part of it. For instance, a 1 might be changed to a 0, a number might be changed to another number, or a function might be changed to a different function. This operation is analogous to mutation of genes, in which the code for one amino acid changes to the code for a different amino acid.
Crossover acts by combining parts of two parents.
It is analogous to mating in biological organisms. If you can define selection, mutation, and crossover operators, you can use a GA to generate almost anything. GP is simply the application of a GA to generate computer programs. Numerous computer languages or representations have been tried, with varying degrees of success. In 1975, John Holland, the inventor of GAs, proposed a form of GP known as a classifier system.