



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Class: Artificial Intelligence; Subject: Computer Science; University: Columbus State University; Term: Fall 2009;
Typology: Study notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




In this chapter, we discuss another method of mimicking natural processes in our design of computer software. This time, we discuss evolutionary computation , of which genetic algorithms are one of the major components. There are two simple requirements for a problem to be solvable by genetic algorithms.
Genetic algorithms function by applying two basic operations to partial solutions in order to find better partial solutions. These operations might be called mutation and crossing. The process is as follows: one applies the operation to single partial solutions or pairs of partial solutions and then evaluates the resulting partial solutions. If the newly generated partial solutions are better than the previous the new ones are kept; otherwise they are likely discarded. Genetic algorithms apply processes seen to operate well in nature: changes are made randomly and the better ones kept. Mutation Mutation refers to taking a partial solution and changing one or more bits. In common practice, only one of the bits is changed. The bit to be changed is selected randomly. The sequence 1111000011110 0 0011110000 can mutate to 1111000011110 1 0011110000. Note only one bit was changed. Crossing Crossing (the textbook calls this mating) refers to swapping parts of two partial solutions. It operates by selecting a bit number at random, splitting each of the two partial solutions at that point, and then recombining by swapping parts. Consider the following two partial solutions which are split at the indicated point. 111100001111000011110000 => 11110000111100 0011110000 111111000000111111000000 => 11111100000011 1111000000 Crossing at this point gives 11110000111100 1111000000 or 111100001111001111000000 and 11111100000011 0011110000 or 111111000000110011110000.
Genetic Algorithms My Way The basic process of genetic algorithms, as discussed on page 220 of the textbook, comes down to a simple process.
Step 3 Select the initial population of solutions X 1 , X 2 , …, X 14. The book suggests a random selection, but one may specify solutions if there is any reason to favor some. Our solution set will begin with four non-random 24-bit partial solutions and 10 partial solutions derived from this set. In other problems, one might have an idea of a beginning solution. Dr. Tim Howard, of the CSU Math Department, is working on a problem called the “Prisoners and Guards Puzzle”. This involves placing 1’s and 0’s on a square array and attempts to optimize the number of 1’s given a specific constraint. Dr. Howard has a method for generating solutions that are known to be good and wants to use genetic algorithms to explore for solutions that are better. It just makes sense to seed the initial solution set with those solutions that are known to be good. Of course, random selection of the solutions for the initial set is as good a method as any. It should be employed if one has no reasons to favor another solution. For this example, I choose to generate non-random solutions for the initial set because that is easier. Here are the four solutions that will form the basis of the initial set of 14.
Note on Random Numbers It is not possible in software to generate a true sequence of random numbers. Most generators, such as the Microsoft function Rnd() supplied with Visual Basic, are pseudo-random generators that generate a sequence of numbers with a long repetition pattern; that is, one can generate a very long sequence before the numbers repeat. This suffices for our purpose. Step 4 Each potential solution is used to encrypt the known plaintext and the ciphertext produced is compared against the known answer. The number of differences is counted. For example, one of our starting keys will be 111111000000111111000000.
This solution scores an 11 of possible 24. We would hope that the genetic algorithms quickly find a potential key with a smaller non-negative score.
Steps 5 – 8 At each step, we use the following algorithm to generate the set of 14 potential solutions.