CS 540 | Lecture Notes | Fall 1996 |
Many human inventions were inspired by nature. Artificial neural networks is one example. Another example is Genetic Algorithms (GA), a.k.a. Genetic Programming and Evolutionary Programming. This particular branch of AI was inspired by the way living things evolved into more successful organisms in nature. The main idea is survival of the fittest, a.k.a. natural selection.
A chromosome is a long, complicated thread of DNA (deoxyribonucleic acid). Hereditary factors that determine particular traits of an individual are strung along the length of these chromosomes, like beads on a necklace. Each trait is coded by some combination of DNA (there are four bases, A (Adenine), C (Cytosine), T (Thymine) and G (Guanine). Like an alphabet in a language, meaningful combinations of the bases produce specific instructions to the cell.
Changes occurs during reproduction. The chromosomes from the parents exchange randomly by a process called cross-over. Therefore, the offspring exhibit some traits of the father and some traits of the mother.
A rarer process called mutation also changes some traits. Sometimes an error may occur during copying of chromosomes (mitosis). The parent cell may have -A-C-G-C-T- but an accident may occur and changes the new cell to -A-C-T-C-T-. Much like a typist copying a book, sometimes a few mistakes are made. Usually this results in a nonsensical word and the cell does not survive. But over millions of years, sometimes the accidental mistake produces a more beautiful phrase for the book, thus producing a better species.
In nature, the individual that has better survival traits will survive for a longer period of time. This in turn provides it a better chance to produce offspring with its genetic material. Therefore, after a long period of time, the entire population will consist of lots of genes from the superior individuals and less from the inferior individuals. In a sense, the fittest survived and the unfit died out. This force of nature is called natural selection.
The existence of competition among individuals of a species was recognized certainly before Darwin. The mistake made by the older theorists (like Lamarck) was that the environment had an effect on an individual. That is, the environment will force an individual to adapt to it. The molecular explanation of evolution proves that this is biologically impossible. The species does not adapt to the environment, rather, only the fittest survive.
To simulate the process of natural selection in a computer, we need to define the following:
For example, say we want to find the optimal quantity of the three major ingredients in a recipe (say, sugar, wine, and sesame oil). We can use the alphabet {1, 2, 3 ..., 9} denoting the number of ounces of each ingredient. Some possible solutions are 1-1-1, 2-1-4, and 3-3-1.
As another example, the traveling salesperson problem is the problem of finding the optimal path to traverse, say, 10 cities. The salesperson may start in any city. This is a very practical problem because it will save a company a lot of money if its salesperson always travels the shortest route. A solution will be a permutation of the 10 cities: 1-4-2-3-6-7-9-8-5-10.
For another example see page 620 in the textbook for a bit-string representation of a logical conjunction.
For example, one can give a subjective judgement from 1 to 5 for the dish prepared with the recipe 2-1-4.
Similarly, the length of the route in the traveling salesperson problem is a good measure, because the shorter the route, the better the solution.
A simple selection method is each individual has the probability f(i) / sum_of_all_f surviving to the next generation, where f(i) is the fitness function value for individual i.
Genetic Algorithms are easy to apply to a wide range of problems. The results can be very good on some problems, and rather poor on others.
If only mutation is used, the algorithm is very slow. Cross-over makes the algorithm significantly faster than using pure chance.
G.A. is a kind of hillclimbing search. As with all hillclimbing algorithms, there is a problem of local maxima. Local maxima in a genetic problem are those individuals that get stuck with a pretty good, but not optimal, fitness measure. Any small mutation gives worse fitness. Fortunately, cross-over might help them get out of a local maximum. Also, mutation is a random process, so it is possible that we may have a sudden large mutation to get these individuals out of this situation. (In fact, these individuals never get out. It's their offspring that get out of local maxima.) One significant difference between G.A. and hillclimbing is that, it is generally a good idea in G.A. to fill the local maxima up with individuals. Diversity is the nature of life.
Last modified December 4, 1996
Copyright © 1996 by Bryan So and Charles R. Dyer. All rights reserved.