Evolving a path to cover a grid 2
I got a few comments and suggestions from talk.origins on my algorithm, and have made a few refinements.
The main point, I feel, was that my selection algorithm is very unrealistic, and that the real world is far less clean cut. While it was not actually my intent to simulate biological evolution closely (I was working only within the very simple definition of variation, selection, inheritance), they have suggested that implementing less draconian selection may actually improve my algorithm's results.
'Perplexed in Peoria' offered two selection algorithm suggestions:
1. Death Angel selection
As far as I can tell, the name of this is one of Perplexed's invention, but I like it. 'Garamond Lethe' offered a simpler version of it, and that's the one I implemented. It operates as follows:
1) A death angel roam the population, striking at random.
2) When it strikes, the chance of it making a kill is determined by the fitness of the victim (low scoring solutions die more easily).
3) If it is unable to kill a solution, it looks for a different victim.
4) Steps (1) to (3) are repeated a prespecified amount of times.
5) The dead solutions are replaced by the children of the solutions still alive.
2. Tournament selection
It operates as follows:
1) Two solutions are randomly selected to battle each other. A solution's chance of winning is determined by its fitness.
2) The winner of the battle goes into a hall of victory. The loser dies.
3) Steps (1) and (2) are repeated a prespecified amount of times.
4) The dead solutions are replaced by children from matings between the victors, and the solutions who were not chosen for battle. The victors return to the population.