Genetic algorithms are a method of generatively and somewhat randomly approaching a solution to a problem.
The general approach is:
1) Create a generation of random string representations of solutions to your problem
2) From among those, select parents to breed.
-This selection should be weighted - those whose "fitness score" is highest should be more likely to be selected
-these parents mate by randomly selecting a crossover point. The children are created by taking the first half of the first parent and the second half of the second parent for c1 and the reverse for c2, treating the crossover point as the half marker.
3) These children are then the next generation for step 2. Depending on the algorithm used, a mutation rate is factored in that has a chance to randomly change the value of each position in each child string.
For a better explanation, check this tutorial out.
Probably the most useful page for finding a better general description from that tutorial is here.
So the first part of the challenge is to write a genetic solver that begins with a population of character strings of length 26 characters and evolves the population until it finds a solution that is the English alphabet, or:
'abcdefghijklmnopqrstuvwxyz'
Once you've accomplished this, try to see how few generations (on average, obviously) it takes achieve this evolution. I haven't come up with some genius way of making this fair without seeding the initial population, so for now we'll just see what the results look like while I try to think of some way to find a winner.
This post has been edited by xclite: 15 February 2012 - 12:39 PM

New Topic/Question
Reply





MultiQuote





|