How many generations does it take to wire both address bits in correctly?
Early champions stall around 40 of 64. A circuit that always outputs one data bit scores exactly 40.
Try thisSet population-size to 60 and press Reset. In test runs, only one seed in five solved it within 400 ticks.
About this model
Where it ends up
best-hits reads 64, every patch is green, and the run stops by itself.
The 6-multiplexer is one of John Koza's standard genetic programming benchmarks from Genetic Programming (1992). Two address bits choose which of four data bits to output, so a correct circuit has to get all 64 combinations of six inputs right.
Each circuit is a program tree up to 6 levels deep, built from and, or, not and if over the inputs a0, a1 and d0 to d3. It scores one hit per case it gets right. Every tick each circuit picks the fittest of three random others; if that one is at least as good, the circuit splices in one of its subtrees (probability crossover-rate%) or copies it outright. Then, with probability mutation-rate%, a random branch is regrown. The 8 × 8 board is the champion's truth table, one patch per case, green where it's right.
IdeaJohn R. Koza
MathPetsMathPets · org