Wednesday, November 18, 2009

Workings of a Genetic Algorithm

Facts about the genetic algorithm:

  1. Inspired by Darwins theory of Evolution or the notion of ‘survival of the fittest’. We will see below that when a new population is being created the two fittest chromosomes from the previous population are selected for the creation of the new population.

  2. Each feasible solution to the problem can be plotted as point on a graph which represents the search space or fitness landscape. Thus the search space contains all feasible solutions.
  3. For any problem we are always looking for the best possible solution available, as the genetic algorithm utilises a formula this will usually be either a maximum or a minimum value. On the graph, the optimum point or the highest point always represents the fittest solution.

    How it works:
    1. A random population of chromosomes (possible solutions to the problem) is generated.
    2. The fitness of each chromosome (solution) is evaluated.
    3. A new population is then created by: 1) selecting two chromosomes in the population according to their fitness, 2) performing crossover probability on the parent chromosomes to create two new chromosomes (offspring), 3)then using mutation probability randomly change the gene values of the offspring 4)and finally placing the offspring in the new population.
    4. The new population is used to run the algorithm again.
    5. Check if the fittest possible solution has been found (highest point on the graph) and if not steps 2, 3 and 4 are repeated until it is.

No comments:

Post a Comment