Tuesday, March 9, 2010

Genetic Algorithms

All great innovations have been inspired by observation from nature. Even Newton's laws came into being when Newton observed the falling apple. Likewise genetic algorithms were derived from the "Survival of the fittest" theory. For those who don't know the theory, I will give a brief description here.

The theory suggests that in a population of individuals, some individuals have better characteristics than others. These characteristics allow those individuals to better adapt to their environment. These individuals are said to be fitter than the rest. Due to the environmental conditions, these fit individuals survive while those that are unfit perish away. The fit individuals reproduce and pass on the characteristics to their offspring. Thus, over successive generations, the individuals become fitter and better suited to survive in their environment.

The characteristics described above are encoded in what is known as a gene, which are present in every organism's DNA. It is from these genes that the term "genetic algorithms" was coined.
Genetic algorithms are basically search algorithms that employ the concepts of natural selection and survival of the fittest to find the optimal solution to a problem.

A typical genetic algorithm has the following stages:
  1. Encoding of characteristics on a chromosome.
  2. Generation of a random population of chromosomes.
  3. Evaluating the fitness of each individual on the basis of a fitness function.
  4. Selecting the individuals that would act as parents for next generation.
  5. Forming a new generation through recombination and/or variation.
  6. Repeating steps 3-5 until the population converges to an optimum solution.
In a real-life scenario, the fit individuals are selected on the basis of ability to survive in the environment. Similarly, in a genetic algorithm the factors that simulate this environment are:
  • the encoding of chromosomes.
  • the fitness function.
Other factors that that are important are:
  • the criterion for selecting parents for next generation.
  • the techniques used for recombination and variation.
These are quite important in that if they are too strict we might end up converging to a local maximum, and if they are too lenient, it might take a long time to get the population to converge to an optimal solution. So, the optimal genetic algorithm should be balanced enough to explore new regions in the solution space and yet be able to achieve convergence in reasonable time.

Genetic algorithms have been employed in a wide variety of problems, ranging from biology to chemistry to finance. One of the major applications is to use genetic algorithms to evolve neural networks. For more info, you may want to follow these links:

The _uck starts here!

Hello reader,
This is the first post for "The AI effect", my official technical blog. Every now and then I would be putting up posts related to Artificial Intelligence and my work in the field. I hope it is worth it. If any of my posts helped you in any way or gave you a new idea, please do comment and let me know.
Thank you.