Outline of Genetic Algorithm
I came across with this outline from this website:
1. [Start] Generate random population of n chromosomes (suitable
solutions for the problem)
2. [Fitness] Evaluate the fitness f(x) of each chromosome x in the
3. [New population] Create a new population by repeating following
steps until the new population is complete
a.[Selection] Select two parent chromosomes from a population
according to their fitness (the better fitness, the bigger chance to
b.[Crossover] With a crossover probability cross over the parents
to form new offspring (children). If no crossover was performed,
offspring is the exact copy of parents.
c.[Mutation] With a mutation probability mutate new offspring at
each locus (position in chromosome).
d.[Accepting] Place new offspring in the new population
4.[Replace] Use new generated population for a further run of the
5.[Test] If the end condition is satisfied, stop, and return the best
solution in current population
6.[Loop] Go to step 2
I have a question.
a) Is it possible to have the [Test] done after [Fitness]? I don't
understand why we need to test after applying the genetic operators.
Isnt the fitness value have been assigned earlier? So the [Test]
should be done right after the [Fitness].