The next level in genetic algorithm performance –embracing a client-server architecture
In the previous chapter, we implemented our genetic algorithm in a multiprocessor approach, leveraging the “embarrassingly parallelizable” nature of genetic algorithms to significantly reduce the time required for each generation to complete. Recognizing that the most time-consuming aspect of the algorithm is typically the computation of the fitness function, we established a benchmark that simulates a CPU-intensive fitness function. By employing Python’s built-in multiprocessing capabilities as well as an external library named SCOOP, we successfully managed to decrease the runtime substantially.
However, these implementations were constrained to a single program operating on a single machine. When addressing real-world problems, this approach is likely to encounter resource limitations of the machine—not just in terms of available CPU cores but also in essential...