Article Preview
Buy Now
COLUMN
Genetic Algorithms, Part 2
Improve Your Computer's Sex Life
Issue: 2.1 (August/September 2003)
Author: Matt Neuburg
Author Bio: Matt Neuburg is the author of
Article Description: No description available.
Article Length (in bytes): 8,492
Starting Page Number: 34
Article Number: 2116
Resource File(s):
2116.zip Updated: 2013-03-11 19:07:57
Related Web Link(s):
http://www.geatbx.com/docu/algoverv.html
Excerpt of article text...
Last month's column introduced genetic algorithms, where we simulate Mendelian/Darwinian evolution as a way of solving some problem. We start with a population of individuals, each endowed with some DNA. We regard each individual's DNA as a possible answer to our problem, and we rank it according to how good an answer it is. We take the individuals with the best DNA and mate them, generating a new population, repeating the process again and again.
The "problem" in this case, you may recall, was to arrive at a good sequence of bytes, where "goodness" is defined as follows. Every byte is translated into an alphanumeric character or a space, thus arriving at a series of words. A word like "9BJ6" is bad, and reduces the cumulative value of the DNA by multiplying it by 0.8. A word comprising entirely digits, like "46", adds to the cumulative value of the DNA a number of points equal to its length. The word "M" doubles the cumulative value of the DNA. A word like "AG12589" -- the letter "A" followed by only non-digits followed by only digits -- multiplies the cumulative value of the DNA by the numeric value of its digits part. Although this is not an earth-shattering problem, it makes for a good example, since it turns out that in 100 generations, the computer is able to optimize its byte sequence very strongly with respect to these rules.
As I said last time, the heart of the algorithm is a loop that looks a lot like one's idea of real-life evolution:
Core loop:
do
...End of Excerpt. Please purchase the magazine to read the full article.