Genetic programming is a variation of genetic algorithms where the
individuals are tree-shaped structures (trees for short)
instead of flat vectors. Genetic programming is so-called because, in
early demonstrations of the technique, the trees
represented simple computer programs2. However, trees
can represent any hierarchal data; they do not have to represent a
computer program.
Because mathematical expressions are hierarchal in nature, a tree is
ideal for storing arbitrary single-valued mathematical expressions,
For example, consider Expression 1:
Fig. 3 diagrams a crossover operation. Crossover
operates on two parent trees and results in two child trees. In
crossover, a node is randomly chosen in each parent tree; this node is
the crossover point. Then, the parents swap subtrees at the
crossover points, forming two new trees. In Fig. 3,
the subtrees to be crossed are shaded. The figure depicts
Expression 1 crossing with , where the subtrees
and
are exchanged to yield
and
.
Fig. 4 diagrams a mutation operation. Mutation
operates on only one tree. As in crossover, a random node (called the
mutation point) is selected. Then, a completely random subtree
replaces the subtree at the mutation point. Figure 4
shows the subtree replacinh
in
Expression 1, yielding
.