Program Crossover

Crossover allows genetic material in two program trees to be combined with the intent to a program which combines the good traits of both original programs.

The first step in the process is to duplicate both programs, so the original trees are preserved for later genetic operations.

Next, a pivot point is randomly selected in each program, with the restriction that the operators must return the same data type.

Finally, the sub-trees starting with the pivot nodes are exchanged.