Genetic Algorithms in Elixir: Chapter 4

On the first run of cargo the suggested population size of 25 breaks the
crossover function - this assumes an even population size.

It took me a while to find anything wrong in my transcription of the code.

1 Like

Also sometime a too small population does not include the optimal solution, so may never converge.

The code sample when you add the generation is now wrong evolve is not being passed the population.

Do we need temperature later on or can it be removed?

You no longer need temperature (unless you want to use it) after this chapter. I put a blurb in there (I think) but it’s not very noticeable so I need to make that more explicit.

As far as population size, I’m updating the code for the next version so it does not break on odd sizes. Doing something like 50 should work just fine though!