CHAPTER 3: GRAMMATICAL EVOLUTION
3.10 Genetic Operators
As with GP, genetic operators are applied for the purpose of regeneration. These operators are applied in the hope that the individuals produced will be fitter than their parents. Whereas GP applies genetic operators to the individuals represented as parse trees, GE applies genetic operators to the chromosomes represented as binary strings. The crossover and mutation operators [1] are the commonly used genetic operators in GE. Unlike GP which uses a genetic operator application rate to determine the number of individuals that will be created using the operator, GE uses a probability to determine if a genetic operator will be applied to the chromosome. For example, assume the crossover probability to be 70. For each chromosome in the population, if a randomly generated number in the range 0 and 100 is less than 70, the operator is applied. The operators are explained in the following sections.
3.10.1 Crossover
A number of crossover operators have been investigated by O’Neill and Ryan [1, 41]. These include one-point, two-point and homologous crossover operators. GE uses the one-point crossover [1] which is explained first in this section.
44
As with GP, the crossover operator is applied to two parents. One-point crossover operates as follows. Two parents are selected using one of the selection methods. Two crossover points, one from each of the parents, are randomly selected. These points are denoted as p1 and p2 as shown in Figure 3.6. The binary string from the beginning of a chromosome to a crossover point is denoted as the head while the rest is denoted as the tail. The tail of parent1 is appended to the head of parent2 and the tail of parent2 to the head of parent1 to produce two offspring.
Instead of swapping the binary string located from a selected point to the end of a chromosome, the two-point crossover randomly selects two points, say point p1 and p2 as shown in Figure 3.7. The binary string located from p1 to p2 is swapped between the two selected parents.
Homologous crossover stores the number of each production rule expanded during the mapping process and uses the number to determine the crossover point. To illustrate homologous crossover, consider the two parents shown in Figure 3.8, the production rules
Figure 3.6. A one point variable length crossover
Figure 3.7. A Two point crossover
45
chosen during the mapping process are given as H1 and H2 for parent1 and parent2 respectively. Recall that if the mapping process uses parent1 and the grammar in section 3.3.1, the start symbol < 𝑒𝑥𝑝𝑟 > is expanded by taking the modulus of 234 and 3. The result is 0 which is the number of the production rule stored at the first index of H1. Other values of H1 and H2 are obtained in a similar way. A region of similarity is where the number of rules selected is the same in H1 and H2. Where these numbers are different is called a region of
dissimilarity. The region of similarity is denoted by a dotted line in Figure 3.8. The homologous crossover is applied to parent1 and parent2 as follows: Two points, one from each parent, are randomly selected from a region of similarity. These points are the same in both chromosomes and are denoted in Figure 3.8 as p1,1 and p2,1. Two more points, one from each parent, say p1,2 and p2,2 are randomly chosen from a region of dissimilarity. For each parent, the codon values between the two points are copied to the other parent. The homologous crossover uses more memory and increases the runtime because it requires the history of the rules chosen be stored. Also, it is not clear what will happen if there is no region of similarity between the two selected chromosomes.
Generally, a crossover operator aims at searching the neighbourhood of the current solution in the hope for a better solution. It is a local search operator which promotes convergence.
GE researchers have also criticized the crossover operator for its destructive effects [41, 42].
In the context of GE, O’Neill and Ryan [41, 42] have defended the one point crossover as Figure 3.8. A homologous crossover
46
being less destructive and more efficient than the two point and homologous crossover. They state that a few crossover points decreases the destructive effect of the crossover operator [41, 42].
3.10.2 Mutation
Whereas GP uses a selection method to select the individual the mutation operator will be applied to, in GE, the mutation operator is applied to the offspring produced by the crossover operator. GE uses a bit mutation operator [1]. The operator checks each bit locus and flips the bit if a randomly generated probability is less than a preset mutation probability. A bit flip implies that the bit is changed to 1 if it is 0 and vice versa. The operator aims at increasing the diversity of the population by taking the search to a new area of the search space6.
The derivation tree structure has been used to examine the level of locality introduced by the mutation operator [43, 44]. Byrne et al. [43, 44] categorize the mutation operator as a nodal mutation or a structural mutation. Nodal mutation changes a single node in a derivation tree while structural mutation changes the structure of the derivation tree. An example of nodal mutation is replacing a node with a node of the same arity. An example of structural mutation is replacing a node with a node of different arity. Whereas nodal mutation searches more of the neighbourhood of the candidate solution, structural mutation searches new areas of the search space. Hence nodal mutation is a high locality mutation while structural mutation is a low locality mutation. Ensuring a balance between nodal mutation and structural mutation is beneficial to the search. This could be achieved by specifying the percentage of the mutation operator that must result in nodal or structural mutation. However, this is a time consuming process because the offspring needs to be mapped to production rules to determine if the mutation is nodal or structural.
Like the crossover operator, the mutation operator could be destructive to a good building block. Castle and Johnson [45] studied the effect of the mutation operator in terms the mutation point. In order to determine the effect of mutation, the fitness of each individual was calculated before and after the mutation is performed. Also, the mutation points were recorded. Castle and Johnson [45] report that the mutation operator that occurs at the beginning of a chromosome is more destructive than those that occur at another place in the chromosome. The mutation operator performs more exploration if the mutation point is at the
6 This is not always the case as there is no guarantee that the mutated string will be different from the newly created string.
47
beginning of the chromosome [45]. Whereas the crossover operator aims at exploiting the neighbourhood of the candidate solution, the mutation operator aims at exploring the search space. As with GP, a high probability of the mutation operator may slow down convergence.
Striking a balance between the probabilities of both the mutation and crossover operators will balance the exploration and exploitation ability of the search algorithm.