XIII. Recommendations


Parameters of GA

This chapter should give you some basic recommendations if you have decided to implement your genetic algorithm. These recommendations are very general. You will probably want to experiment with your own GA for a specific problem, because there is still no general theory that would describe the parameters of a GA for any problem.

These recommendations are often based on empirical studies of GAs, many of which were performed only with binary encoding.

  • Crossover rate
    The crossover rate should generally be high, around 80%-95%. (However, some results show that for certain problems a crossover rate of about 60% is best.)
  • Mutation rate
    On the other hand, the mutation rate should be very low. The best reported rates are about 0.5%-1%.
  • Population size
    It may be surprising that a very large population usually does not improve GA performance in terms of the speed of finding a solution. A good population size is often about 20-30, although sizes of 50-100 are sometimes reported as best. Some research also shows that the best population size depends on the encoding and on the length of the encoded string. This means that if you have a chromosome with 32 bits, the population size might be around 32, and certainly larger than the best population size for a chromosome with 16 bits.
  • Selection
    Basic roulette wheel selection can be used, but sometimes rank selection can be better. Check the chapter about selection for advantages and disadvantages. There are also more sophisticated methods that change the selection parameters during the run of the GA. In principle, they behave somewhat like simulated annealing. However, elitism should almost always be used (if you do not use another method for preserving the best solution found). You can also try steady state selection.
  • Encoding
    Encoding depends on the problem and also on the size of instance of the problem. Check the chapter about encoding for some suggestions, or consult other resources.
  • Crossover and mutation type
    Operators depend on encoding and on the problem. Check the chapter about operators for some suggestions. You can also consult other sources.

Applications of GA

Genetic algorithms have been used for difficult problems (such as NP-hard problems), for machine learning and also for evolving simple programs. They have also been used in art, for example to evolve pictures and music.

One advantage of GAs is their parallelism. A GA explores the search space with multiple individuals (and with genotype rather than phenotype), so it is less likely to get stuck in a local optimum than some other methods.

They are also relatively easy to implement. Once you have a GA framework, you often only need to define a new chromosome representation to solve another problem. With the same encoding, you may only need to change the fitness function. On the other hand, choosing a good encoding and fitness function can be difficult.

One disadvantage of GAs is their computational cost. They can be slower than some other methods. But with today's computers, this is often less of a problem.

To give you an idea of the kinds of problems solved by GAs, here is a short list of applications:

  • Nonlinear dynamical systems - prediction, data analysis
  • Designing neural networks, both architecture and weights
  • Robot trajectory
  • Evolving LISP programs (genetic programming)
  • Strategy planning
  • Finding shape of protein molecules
  • TSP and sequence scheduling
  • Functions for creating images

About

The first version of the demonstration, originally an interactive example, was developed during the summer semester of 1998 at the Czech Technical University (supervised by prof. Pavel Slavík). The project then continued during the summer of 1998 at Hochschule für Technik und Wirtschaft Dresden (FH) (supervised by prof. Walter Pätzold). It began as a small summer project while I was learning programming and genetic algorithms, but it gradually grew into a widely used tutorial and received a great deal of positive feedback (thanks!). When the interactive examples stopped working in browsers, the pages became less popular. In 2026, the demonstrations were rewritten for the web with the help of an LLM, so the demonstrations are available again.