1 of 19

A Gentle Introduction to Genetic Algorithms

By:

Noman Islam

2 of 19

Introduction

  • A genetic algorithm is a search technique used to find true or approximate solutions to optimization and search problems
  • Were formally introduced in the US in the 1970s by John Holland at University of Michigan

3 of 19

Introduction – continued

  • Genetic algorithms are a particular class of evolutionary algorithms that use techniques inspired by evolutionary biology such as inheritance, mutation, selection, and crossover (also called recombination)

4 of 19

Introduction – continued

  • Genetic algorithms are implemented as a computer simulation in which a population of abstract representations of candidate solutions to an optimization problem evolves toward better solutions

5 of 19

Introduction – continued

  • The evolution usually starts from a population of randomly generated individuals(candidates) and happens in generations.
  • In each generation, the fitness of every individual in the population is evaluated, multiple individuals are stochastically selected from the current population (based on their fitness), and modified (recombined and possibly mutated) to form a new population. The new population is then used in the next iteration of the algorithm.

6 of 19

A Simple Genetic Algorithm

{

initialize population;

evaluate population;

while TerminationCriteriaNotSatisfied

{

select parents for reproduction;

perform recombination and mutation;

evaluate population;

}

}

7 of 19

Initialization of parent population

  • Generate the M number of solution string known as parent population
  • Mostly random

1

0

1

0

0

1

0

0

1

0

1

1

1

0

1

0

1

1

0

1

0

0

1

1

8 of 19

Evaluation

  • Give fitness to each of the solution

1

0

1

1

0

1

0

0

1

0

1

1

1

0

1

0

1

1

0

1

0

0

1

1

Parent population

2

2

4

3

fitness

9 of 19

Selection

  • Fit solution are likely to survive and bad solution are likely to die off
  • Select some of the best fit chromosomes from parent population according some selection criteria (eg. Roulette wheel selection)

1

0

1

1

0

1

0

0

1

0

1

1

1

0

1

0

1

1

0

1

0

0

1

1

Parent population

2

2

4

3

fitness

1

0

1

0

1

1

4

0

1

0

0

1

1

3

0

1

0

0

1

1

3

1

0

1

1

0

1

4

selection

fitness

10 of 19

Crossover/Recombination

  • Exchange partial solution between pair of selected solution with some probability value eg 70%

1

0

1

0

1

1

0

1

0

0

1

1

0

1

0

0

1

1

1

0

1

1

0

1

Selected Solution

0

1

1

0

1

1

1

0

0

0

1

1

0

1

0

1

0

1

1

0

1

0

1

1

Child Population After Crossover

11 of 19

Mutation

  • Change the value of an allele of solution with some small probability value eg 1%
  • Motivation is to explore new point in the solution space

0

1

1

0

1

1

1

0

0

0

1

1

0

1

0

1

0

1

1

0

1

0

1

1

Child Population After Crossover

0

1

1

0

1

1

1

0

0

0

1

0

0

1

0

1

0

1

1

0

1

0

1

1

Child Population After mutation

12 of 19

Replace with parent population and repeat process

  • Evaluate child population and replace parent population
  • Go to selection step and repeat the process until termination criteria satisfies
  • Eg. Exit after given number of iteration finishes

0

1

1

0

1

1

1

0

0

0

1

0

0

1

0

1

0

1

1

0

1

0

1

1

Replaced Parent Population

1

2

4

6

fitness

13 of 19

x2 example: selection

f(x) = {MAX(x2): 0 <= x <= 32 }

14 of 19

X2 example: crossover

15 of 19

X2 example: mutation

16 of 19

How GA are Different than Traditional Search Methods?

  • GAs work with a coding of the parameter set, not the parameters themselves.
  • GAs search from a population of points, not a single point.
  • GAs use payoff information, not derivatives or auxiliary knowldege.
  • GAs use probablistic transition rules, not deterministic rules.

17 of 19

Advantages of GA

  • Very simple
  • Performs well on many different types of problems
  • Less susceptible to getting 'stuck' at local optima than gradient search methods.

18 of 19

Conclusion

  • When to use GA?
    • Alternate solutions are too slow or overly complicated
    • Problem is similar to one that has already been successfully solved by using a GA
    • Benefits of the GA technology meet key problem requirements
  • GAs are in used in Machine Learning, Robotics, Signal Processing etc.

19 of 19

Further Readings

  • Books:
    • Genetic Algorithms in Search, Optimization, and Machine Learning by David E. Goldberg
  • Websites:
    • Applet, http://www.rennard.org/alife/english/gavintrgb.html
    • http://www.wikipedia.com