Evol is a clear dsl for composable evolutionary algorithms, optimised for joy.
pip install evol
The Gist¶
The main idea is that you should be able to define a complex algorithm in a composable way. To explain what we mean by this: let’s consider two evolutionary algorithms for travelling salesman problems.
The first approach takes a collections of solutions and applies:
- a survival where only the top 50% solutions survive
- the population reproduces using a crossover of genes
- certain members mutate
- repeat this, maybe 1000 times or more!
We can also think of another approach:
- pick the best solution of the population
- make random changes to this parent and generate new solutions
- repeat this, maybe 1000 times or more!
One could even combine the two algorithms into a new one:
- run algorithm 1 50 times
- run algorithm 2 10 times
- repeat this, maybe 1000 times or more!
You might notice that many parts of these algorithms are similar and it is the goal of this library is to automate these parts. We hope to provide an API that is fun to use and easy to tweak your heuristics in.