Genetic Algorithms

Duane A. Bailey
In this lecture we consider the design and implementation of genetic algorithms. Genetic algorithms are an important tool in conquering problems that are intractable because the solutions are difficult to find, or because the solutions are difficult to directly describe.
Outline of this class (resources are below)
  1. Notion of intractible problems.
    1. Two classes of problems:
      • P Problems that can be computed in "polynomial time" on a Turing machine.
      • NP Problems that can be computed in polynomial time on a nondeterministic Turing Machine. (Recall that a nondeterministic machine can be thought of as a Turing Machine that, given a choice of rules to apply always applies the rule that leads to the correct answer the fastest.)
    2. Generally, problems in P are considered tractible. Problems outside of P (including, possibly, many in NP) are not.
    3. Problems in P:
      • Sorting.
      • Straightforward string matching.
      • Dynamic Programming.
      • Many approximation algorithms for intractible problems.
    4. Problems in NP
      • All problems in P.
      • Traveling Salesman Problem (TSP).
      • Graphs: determining if one is a subgraph of another.
      • Clique detection: Given m people, is there are group of n that all know each other.
    5. Recall: Some problems cannot be generally solved (efficiently or not):
      • Will a program halt on a particular input?
      • Do two programs compute the same thing?
      • We're intrigued, but not concerned with these unsolvable problems.
  2. Notions of approximate solutions to problems.
    1. Partial solutions are often satisfactory for tough problems: consider the weather forecast.
    2. Sometimes we can get within a certain percentage of an optimal solution.
      Example: Efficiently packing unusual shaped items in a carton can be intractable, but we know the optimial solution cannot be packed into a carton smaller than the total volume of the items. If we could get within 5%, we'd be happy.
  3. The genetic algorithm.
    1. Appropriate representation as genetic material.
      1. Playing mastermind?
      2. Traveling salesperson?
      3. Puzzle design?
      4. Protein folding?
    2. Identification of a fitness function: should be monotonically increasing with solution quality.
    3. Identification of appropriate genetic operations:
      • crossover - how do we combine parent solutions to make children
      • mutation - how do we inject movement in the search space
      • inversion - is it meaningful to rearrange a solution to improve it?
    4. Techniques for "directing the evolution": selecting only the most fit, random unique selection, etc.
  4. Applications we'll be looking at:
    1. Mastermind, the game.
    2. Our friend, circling the square.
    3. Traveling salesman.
    4. Walking robots.
  5. Comments on a related technique: simulated annealing
    1. "Temperature" of the search starts hot, cools slowly.
    2. Under high temperatures, we allow significant jumping in the search space.
    3. Under low temperatures, we focus on small optimizations.
    4. Few guarantees.
Resources needed for this class:

Readings for next week:

These items require Acrobat Reader.
These items are Java applets, and require Java to be installed on your machine.