CS 540Lecture NotesFall 1996

Genetic Algorithms (Chapter 20.8)


Evolution

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.

Natural Selection

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.

Simulated Evolution

To simulate the process of natural selection in a computer, we need to define the following:

With the above defined, we can define a Genetic Algorithm as follows:

  1. Create the initial population of one chromosome
  2. Mutate one or more genes in one or more chromosomes in the current population
  3. Cross over one or more pairs of chromosomes
  4. Add the offspring generated in Steps 2 and 3 to the population
  5. Create a new generation by using the selection criteria
  6. Go to Step 2 until a good solution is found or out of time

Conclusion

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.