Non-Continuous Function Optimization Using Genetic Algorithm
Gradient Descent & Newton method are quite popular when finding solutions of a continuous function. But ever wondered how should we solve a non continuous/discontinuous function. This is where genetic algorithm helps. In this article, we will go through its implementation in python and provide an intuitive explanation of each step.
In case you are not a paid medium member, you can read this for free at
Introduction
Gradient Descent and Newton method both fail for a discontinuous function. This is because Gradient Descent requires computation of first differential and Newton method requires both first differential and second differentials. At the point of discontinuity, however, neither first nor second differentials are defined which makes these two algorithms not useful.
Genetic algorithm comes to rescue in such a scenario. Genetic algorithm works on principles of fitness, parents, crossover, mutation, next generation which run in cycles: