Karthikeyan

Data Scientist @Tekclan

Optimising parameters to take the right path and to land on a perfect solution is an art. There are lots of options available to achieve this. Today, we are going to take a bite of that cake called Genetic algorithms.

Genetic algorithm is one of the Evolutionary algorithms and it is inspired by Charles Darwin’s theory of natural evolution.

This shows our nature is already fulfilled with lots of solutions from JCB machines to Genetic algorithms

Let’s Dive straight to understand the basics. There are five main stages in GA:

  1. Initial population
  2. Fitness Score
  3. Selection
  4. Crossover
  5. Mutation

Initial Population

Whenever we are approaching a problem, Initial seed of information is available and that is considered as a population. Population has a structure and some inherent qualities just as you see with our chromosomes and chromosomes in turn consist of Genes.

Fitness Score

The fitness function defines how healthy the gene is, Fitness score plays a major role in defining the probability of a gene to get selected for reproduction.

Selection

This is the area where the selection process happens based on their fitness score. Then the selected pairs called parents will move to the reproduction stage.

Here the comes important part, the reproduction stage.The selected parents are forced to mate and this happens through 2 variation factors,

  • Crossover
  • Mutation

CrossOver

This is like reproducing a baby with gene combination from both their parents plus additional skills. By selecting random points, the process of exchanging genes (Values) takes place. The new baby is called as offspring.

Mutation

Mutation happens in various ways it could happen by just flipping the genes in the chromosome to chromosome or randomly replacing the genes in chromosomes.The outcome is called as mutant.

Imagine all the above processes applied to a software program in a repeated fashion to select the fittest function to survive and reproduce again and again. Now, we are talking about a function that can be applied to solve an optimization problem in the best possible way and that’s exactly what GA does. It's truly inspiring and has a lot of potential.

Kudos! Hope you had a great bite of the Cake. For other flavours, please read our other posts..