flickr - Ethan Hein

Fitness

Similar to the process of evolution in nature, in a genetic algorithm we will have to select the best evolved ones by deciding which ones are superior. A chromosome’s superiority is called its fitness. Normally in most practical use of genetic algorithm, the better the fitness, the higher the chance the chromosome will be selected. A way of determining the fitness of a chromosome is to compare how good it is to the initially proposed characteristics we want represented by the chromosomes to have. Mathematically we could define a fitness function
which returns the fitness of chromosome
. The larger value
returns, the better the fitness the chromosome has. The idea of a fitness function may seem abstruse to many, a simple example could explain it more clearly - consider if we are evolving a car to run on a bumpy road as far as possible without falling over, one possible fitness function
is simply the distance traveled by the car represented by its chromosome
.

It is also important that we evaluate the average fitness level of the entire generation. It would allow us to assess the status of evolution. This following formula gives the average fitness level of a generation -




Moreover, if we plot a fitness landscape while we evaluate the average fitness
we therefore can represent the solutions visually -







In the above figure, A and C are local maximum and B is the globe maximum (highest fitness level), and we hope that the pink ball (one of our initial solution) would quickly converge to B after evolving for a number of generations.