Genetic Algorithm Questions: 1. What is a good population size ? Why? Is this true for all problems? In the absence of needed information what value should we use ? 2. What is a good crossover probability ? Why? Is this true for all problems? In the absence of needed information what value should we use ? 3. What is a good mutation probability ? Why? Is this true for all problems? In the absence of needed information what value should we use ? What is a good value of ...? Why? Is this true for all problems ? In the absence of needed information what value should we use ? 4. Why ask why? 5. How the heck do I found out the answers? Experiment. Write a shell script/program to 1. Take the output performance measures (max, avg, min, ...) over many runs of the genetic algorithm (a run has identical GA parameter settings) where each run was obtained with a different random seed and calculate the average of the maximum fitness of the first generation results for each run of the genetic algorithm. ofile_1 ofile_2 ofile_3 ofile_4 ofile_5 .... each ofile has a rows of numbers corresponding to the performance measures for that generation/row. row1 corresponds to generation 1 row2 corresponds to generation 2 row3 corresponds to generation 3 ... Take the first row from ofile_1, ofile_2, ofile_3,....ofile_n each row contains gen max avg min ... let max_i be max fitness value in ofile_i calculate max_avg = (max_1 + max_2 + ... + max_n)/n where n is the number of output files. This is our average of the maximum fitness for the generation corresponding to the row we extracted. This maxavg should better represent the max fitness value in the generation under consideration. We do this for every row and every measured performance variable of interest. maxavg average of the maximum fitness avgavg average of the average fitness minavg average of the minimum fitness ... AND THIS IS WHAT I WANT TO SEE PLOTTED ON THE GRAPHS. X-Axis generations Y-Axis maxavg, avgavg More Questions: 1. What is a good encoding? We are using a simple encoding dn....d3 d2 d1 d0 = dn * 2^n + ... + d3 * 2^3 + d2 * 2^2 + d1 * 2^1 + d0 * 2^0 What about gray codes? What encoding should we use? 2. Corvin asked Should we try to ensure that each bit/gene has about the same effect ? Example: changing d3 changes the value of the parameter by 2^3 while changing d0 changes the value of the parameter by 2^0 = 1 Answer: Usually we don't know enough to ensure that each gene's contribution is the same. How do we attack a problem like maximize f(x) = x^2 in the range -5.12 to 5.11 and minimize f(x) = x^2 in the range -5.12 to 5.11 and minimize f(x1, x2, x3, x4, x5) = x1^2 + x2^2 + x3^2 + x4^2 + x5^2 in the range -1.024 .. 1.023 for x1 -5.11 .. 5.11 for x2 -3.45 .. 6.89 for x3 ... Page 108 in textbook (available in the bookstore now) Try F1 thru F4