Genetic Algorithm Tips

General Recommendations

Any users new to the GA world are encouraged to read David Goldberg's "Genetic Algorithms in Search, Optimization and Machine Learning," Addison-Wesley, 1989.

My favorite technique is what I call the “securGA”, but I also still recommend using the older micro-GA technique (microga=1) with uniform crossover (iunifrm=1). However, if possible, I strongly suggest that you use values of nposibl of 2^n (2, 4, 8, 16, 32, 64, etc.). While my test function works fine for other values of nposibl, I have encountered problems where the uniform crossover micro-GA has difficulty with parameters having long bit strings and a non-2^n value of nposibl, e.g. nposibl=1000, will have 10 bits assigned (for this case I would suggest running nposibl=1024 rather than 1000).

For more conventional GA techniques I recommend using:

  • Binary coding (only option with my GA, but it could be changed to floating point coding)
  • Tournament selection (only option with my GA)
  • Uniform crossover (iunifrm=1)
  • Creep mutations (icreep=1)
  • Niching or sharing (iniche=1)
  • Elitism (ielite=1)

Micro-GA Technique

My old favorite GA technique was the micro-GA, but is now the securGA (see below). I recommend using the micro-GA with uniform crossover and a small population size. The following inputs gave me excellent performance:

  • microga = 1
  • npopsiz = 5
  • maxgen = 200
  • iunifrm = 1

I have also gotten good performance with the single-point crossover (iunifrm=0), micro-GA.

If you decide to use the micro-GA, you will not need to worry about the population sizing or creep mutation tips below.

See the Krishnakumar reference below for more information about micro-GA's.

securGA Technique

My favorite GA technique is now my securGA (small-elitist-creeping-uniform-restarting-GA). The securGA is structurally very similar to the microGA, but it (1) uses a slightly larger population size for harder problems, and (2) eliminates jump mutations altogether in favor of creep mutations combined with the restart nature of the microGA to reinfuse new genetic information. The following inputs gave me excellent performance:

  • microga = 1
  • npopsiz = 15
  • maxgen = 100
  • iunifrm = 1
  • icreep = 1

I have also gotten good performance with the single-point crossover (iunifrm=0), securGA.

If you decide to use the securGA, you will not need to worry about the population sizing or creep mutation tips below.

Population Sizing

I've had a lot of people ask me about population sizing, especially people who are attempting large problems where 100 individuals is probably not enough. The true authority on the subject is David E. Goldberg but here is a crude population scaling law in my paper (based on Goldberg & Deb, 1992):

npopsiz = order[(l/k)(2**k)] for binary coding

where l = nchrome and k is the average size of the schema of interest (effectively the average number of bits per parameter, i.e. approximately equal to nchrome/nparam, rounded to the nearest integer). I find that when I have uniform crossover and niching turned on (which I recommend doing), that this scaling law is usually overkill, i.e. you can most likely get by with populations at least twice as small.

Remember to make the parameter 'indmax' (in 'params.f') greater than or equal to 'npopsiz'.

Creep Mutation Probability Tip

I generally like to have approximately the same number of creep mutations and jump mutations per generation. Using basic probabilistic arguments, it can be shown that you will get approximately the same number of creep and jump mutations when:

pcreep = (nchrome/nparam) * pmutate

where pmutate (the jump mutation probability) is 1/npopsiz.