Defining Termination Criteria

Next to a good fitness function, termination criteria is the most important aspect of your genetic algorithms. If you don’t know when to stop and return a solution, you’ll never get a solution in the first place. The goal of termination criteria is to stop the algorithm when it has reached maximum fitness. You could write a perfect algorithm, but if it never knows when to stop, it wouldn’t matter. Imagine if you successfully managed to get out of the woods and reached civilization, but you kept wandering back into the woods because you didn’t know you were back to safety.

Most of the problems you worked with so far have explicit goals. You know what the solution should look like, so you know exactly when to stop. ...

Get Genetic Algorithms in Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.