Selecting Genetic Algorithm Operators for CEM Problems

Size: px
Start display at page:

Download "Selecting Genetic Algorithm Operators for CEM Problems"

Transcription

1 Selecting Genetic Algorithm Operators for CEM Problems Randy L. Haupt Communications Science & Technology The Pennsylvania State University Applied Research Laboratory P. O. Box 30 State College, PA Abstract: Many people use genetic algorithms without understanding how the various operators function in finding the optimal solution. This paper explains some of the operator alternatives and demonstrates their use on a two-variable linear array optimization problem. Keywords: Genetic Algorithm, Optimization, Crossover, Mutation, Selection 1. Introduction A genetic algorithm (GA) has many random operators that must be selected by the user. The random components of the algorithm make a proof of convergence very difficult. Recently, convergence proofs have been done for GAs using Markov chains [1]. These proofs require simplification of the GA so that it closely resembles a simulated annealing algorithm. A few of the assumptions used for the convergence proofs conflict with the results of studies that have found the optimum population size, mutation rate, etc. [2,3,4]. Some of the confusion can be cleared by a better understanding of the GA operators. This paper provides a graphical description of the GA operations of selection, crossover, and mutation for both the binary and continuous versions. If the user can visualize exactly what is happening, a more intelligent choice of the operator can be made. 2. Selection Selection is the random process of picking mates for the crossover operation. Roulette wheel selection with rank weighting assigns a probability of selection based on the rank of the chromosome when sorted according to cost. This scheme makes the selection probability independent of the cost. The second selection method examined here is tournament selection. It randomly picks two or three chromosomes and the chromosome with the lowest cost in this subset becomes a parent. Figure 1 and Figure 2 show the probability of selection assigned to the chromosomes ordered from number one having the lowest cost to the last one with the highest cost. Squaring the position number or picking three chromosomes for a tournament increases the

2 selection pressure. Selection Pressure is the ratio of the probability that the most fit chromosome is selected as a parent to the probability that the average chromosome is selected. As the size of the mating population increases, the tournament selection and rank selection methods converge. probability of selection roulette wheel rank roulette wheel rank squared tournament with 2 tournament with 3 uniform random probability of selection roulette wheel rank roulette wheel rank squared tournament with 2 tournament with 3 uniform random parent Figure 1. Plot of the probability of selection for 4 chromosomes in the mating pool parent Figure 2. Plot of the probability of selection for 32 chromosomes in the mating pool. 3. Crossover Crossover is the process of mating two or more chromosomes. For binary GAs, single point crossover selects just one crossover point in the two parents. In order to visualize crossover, the cost function used here returns the maximum sidelobe level of a five element nonuniformly spaced array and is limited to two variables each represented by 10 bits. sllmax 20 log 10 peak2 1 cos kx1u cos k x1 x2 u / 5 where peak2 highest peak other than main beam k 2 / wavelength x1 distance of element 2 from element 1 x2 distance of element 3 from element 2 x 2 x 1 x 1 x 2 u cos The effects of the various operators described here are cost function independent. Equation (1) just forms a backdrop for the operators. Figure 3 is a contour plot of the cost function. The cliff and high cost areas are easier to see in the three-dimensional plot in Figure 4 Consider the following two arbitrary binary chromosomes: (1) x chromosome chromosome (2)

3 Figure 3. Contour plot of cost function in db. Figure 4. Plot of cost function in db. Single point crossover picks one point in both chromosomes and exchanges the binary code to the right of the crossover points to form the offspring. All offspring that are possible from single point crossover of the chromosomes in (2) are shown by small circles in Figure 5. Using two point crossover where the binary numbers between two crossover points are exchanged increases the number of different possible offspring as shown in Figure 6. Uniform crossover between the two chromosomes produces the greatest diversity of offspring as shown in Figure 7. Crossover between continuous chromosomes takes many different forms. Here, the continuous crossover is given by [5] where offspring [ p p p p ] 1 m1 m2 new1 dnvar offspring [ p p p p ] 2 d1 d2 new2 mnvar p p [ p p ] new1 m m d p p [ p p ] new2 d m d (3) (4) If is a uniform random number for both offspring, then the offspring must appear on a square that has the parents at two opposite corners as shown in Figure 8. If is limited between 0 and 1, then offspring are bound by the parents. If goes outside these limits, then the lines that form the square go outside the bounds of the parents as shown in Figure 8. If (3) and (4) are modified such that multiplies the difference between all the variables in the parents, then all the possible offspring lie on a line connecting the two parents as shown in Figure 9. Using a different for each variable results in a large area for the potential offspring as shown in Figure 10. These examples demonstrate that the choice of crossover scheme determines the extent of the cost function that offspring may cover. Some types of crossover severely limit offspring to small possible positions.

4 Figure 5. Possible offspring from single point crossover. Figure 6. Possible offspring from double point crossover. Figure 7. Possible offspring from uniform crossover. Figure 8. Possible offspring from continuous crossover with 1.2. Figure 9. Possible offspring from continuous crossover with a single multiplying the difference between all variables. Figure 10. Possible offspring from continuous crossover with different multiplying the difference between all variables.

5 4. Mutations Binary mutations randomly change a bit in a chromosome. Figure 11 shows all the possible chromosomes that could result by mutating one bit of chromosome 1 in (2). Mutating one bit is approximately the same as a 5% mutation rate. Increasing the number of mutated bits to two is approximately a 10% mutation rate. All possible chromosomes resulting from a two bit mutation of chromosome 1 in (2) are shown in Figure 12. Mutating three bits or about a 15% mutation rate results in the plot in Figure 13. Figure 14 portrays all the possible resulting mutants for a continuous GA with one mutation in a chromosome. This plot assumes the variable value is replaced by totally new random value. If the mutation is Gaussian, then the lines will not extend over the whole variable range, and the probability of a certain value is greater closer to the original variable value. Figure 11. Possible mutants when one bit is mutated Figure 12 Possible mutants when two bits are mutated. Figure 13. Possible mutants when three bits are mutated. Figure 14. Possible mutants when one variable is mutated in a continuous chromosome.

6 5. Conclusions Tournament and rank order roulette wheel selection assign nearly the same probability of selection to the chromosomes. For large population sizes, tournament selection is probably the better choice since it does not have to sort the population. For small population sizes, either selection method works well. The type of crossover chosen has a dramatic effect on possible location of the offspring. Some crossovers explore a greater region of the cost function than other crossovers. Low mutation rates restrict the possible mutants to narrow corridors on the cost surface. High mutation rates permit much greater exploration of the cost surface. References [1] Cerf, Raphael, "Asymptotic convergence of genetic algorithms," Adv. Appl. Prov., 30, 1998, pp [2] Haupt, R.L. and S.E. Haupt, "Optimum population size and mutation rate for a simple real genetic algorithm that optimizes array factors," Applied Computational Electromagnetics Society Journal, Vol. 15, No. 2, Jul 2000, pp.. [3] Grefenstette, J. J., Optimization of control parameters for genetic algorithms, IEEE Trans. Systems, Man, and Cybernetics. SMC 16, Jan./Feb. 1986, p [4] Schaffer, J. D., et al., A study of control parameters affecting online performance of genetic algorithms for function optimization, in J. D. Schaffer (Ed.), Proc. of the Third International Conference on Genetic Algorithms, Los Altos, CA: Morgan Kaufmann, June 1989, pp [5] R.L. Haupt and Sue Ellen Haupt, Practical Genetic Algorithms, New York: John Wiley & Sons, 1998.