Week 4.1 - Genetic Algorithm
GENETIC ALGORITHM (STALAGMITE FUNCTION)
A genetic algorithm is a search inspired by Charles Darwin's theory of evolution. This algorithm reflects the process of natural selection where the fittest individuals are selected for reproduction in order to produce offspring of the next generation.
The process of natural selection starts with the selection of the fittest individuals from a population. They produce offspring which inherit the characteristics of the parents and will be added to the next generation. If parents have better fitness, their offspring will be better than parents and have a better chance at surviving. This process keeps on iterating and in the end, a generation with the fittest individuals will be found.
There are five phases considered
Initial Population, fitness function, selection, crossover, mutation.
In this particular challenge, I needed to find the best possible result i.e Maximum optima.
So, in order to get the best possible, I needed to do the iterations 3 times as it was stated in the question itself to create 3 plots to get the best possible answer.
When the first plot was created there was no stable point it was going out of the selected region which is (0,0.6) and it was to be done in 150 times of iterations. According to the 1st plot, we saw too much fluctuation in one iteration which was 150 times. This search was done in 13.697 seconds
To counter the above mention problems we created the second plot with subtle boundary conditions. With bounded region, the points did not waver but in a boundary but still, we did not get the best possible answer. The whole search was done in 15.1798 seconds.
For the perfect maximum optimum value, we had to increase the population size to 500 from 150. After performing the iteration over 500 population size we got the maximum optimum solution. The search study took 80.2282 seconds.





