How to find the best parameters for a Genetic Algorithm?

Jader Dias picture Jader Dias · Jul 2, 2009 · Viewed 12.4k times · Source

Some Genetic Algorithm frameworks, such as http://www.aforgenet.com/ requires many parameters, such as mutation rate, population size, etc

There is universal best numbers for such parameters? I believe that it depends on the problem (fitness function delay, mutation delay, recombination delay, evolution rate, etc). My first thought was to use a GA to configure another GA.

Any better ideas?

Answer

pufferfish picture pufferfish · Jul 2, 2009

I find it helps to think of these problems as a landscape, where you're trying to find the lowest point.

Methods like genetic algorithms are used when the landscape is too large to just test all the points, and the "shape" of the landscape is such that methods like gradient-descent will get you stuck in local minima.

One good example is Rastrigin's function (image ref): alt text
(source: scientific-computing.com)
:

Your choices are:

Generation size:

  • Too large: you're going to have a long epoch time, restricting how many chances each individual has to explore it's neighbourhood.
  • Too small: you don't get good coverage of the search space.

Mutation rate:

  • Too high: you risk the individuals "jumping" over a solution they were close to.
  • Too low: they're all going to get stuck in local minima.

So it really does depend on your own particular search space. Experiment with the parameters and try to find the optimal combination. I would agree that using another GA to optimise the parameters is not going to solve the problem.