In computer science and operations research, a genetic algorithm (GA) is a metaheuristic inspired by the process of natural selection that belongs to the larger class of evolutionary algorithms (EA). Genetic algorithms are commonly used to generate high-quality solutions to optimization and search problems by relying on biologically inspired operators such as mutation, crossover and selection.
Advantages of GA:
- No need for derivative information
- Faster and more efficient than traditional methods
- Good parallel capabilities
- Deliver a list of good solutions instead of just one
- Optimize continuous as well as discrete functions and multi-objective problems
- Always deliver a solution and improves that with time
- Useful for very large search spaces with many parameters involved
Disadvantages of GA:
- Not suitable for simple problems with available derivative information
- Stochastic; no guarantee of the result solution being optimal
- Frequent calculation of fitness value is computationally expensive for some problems
- No guarantee of convergence to the optimal solution if not implemented properly
Please refer to these two websites if you would like to know how to implement the algorithm:
https://github.com/ahmedfgad/GeneticAlgorithmPython
https://github.com/yanshengjia/artificial-intelligence/tree/master/genetic-algorithm-for-functional-maximum-problem
https://en.wikipedia.org/wiki/Genetic_algorithm
https://towardsdatascience.com/genetic-algorithm-implementation-in-python-5ab67bb124a6
https://medium.com/@rinu.gour123/python-genetic-algorithms-with-artificial-intelligence-b8d0c7db60ac