chapter seven

7 Genetic Algorithm

 

This chapter covers

  • Introducing population-based optimization algorithms
  • Understanding evolutionary computation
  • Understanding different components of genetic algorithms
  • Implementing genetic algorithms in Python

Suppose you’re on a treasure hunting mission and do not want to take the risk of searching alone and returning empty-handed. So, you might decide to collaborate with a group of friends and share information. This approach follows a population-based search strategy, where multiple agents are involved in the search process. During this collaborative effort, you may notice that some hunters perform better than others. In this case, you can choose to retain only the best performing hunters and replace the less competent ones with new recruits. This process resembles the workings of evolutionary algorithms such as genetic algorithms, where the fittest individuals survive and pass on their traits to the next generation. In this chapter, genetic algorithm is presented and discussed as an evolutionary computing algorithm. Different elements of this algorithm are described and implementation details are presented.

7.1 Population-based Metaheuristic Algorithms

7.2 Introduction to Evolutionary Computation

7.2.1 A brief recap of biology fundamentals

7.2.2 Theory of Evolution

7.2.3 Evolutionary Computation

7.3 Binary Genetic Algorithm (BGA)

7.3.1 Fitness Function

7.3.2 Representation Schemes

7.3.3 Selection Operators

7.3.4 Reproduction Operators

7.3.5 Survivor Selection

7.4 Implementing Genetic Algorithms in Python

7.5 Exercises

7.6 Summary