4. Genetic Algorithm - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

4. Genetic Algorithm

Description:

4. Genetic Algorithm Genetic algorithms are a part of evolutionary computing, which is a rapidly growing area of artificial intelligence. Based on Darwinian ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 28
Provided by: MFYeh
Category:

less

Transcript and Presenter's Notes

Title: 4. Genetic Algorithm


1
4. Genetic Algorithm
  • Genetic algorithms are a part of evolutionary
    computing, which is a rapidly growing area of
    artificial intelligence.
  • Based on Darwinian principles of biological
    evolution. ????,????
  • First proposed by Prof. John Holland and his
    colleague at Univ. of Michigan.

2
Biological Background 1
  • Chromosomes are strings of DNA and serves as a
    model for the whole organism.
  • A chromosome consists of genes.
  • Each gene encodes a trait.
  • Complete set of genetic material (all
    chromosomes) is called genome.
  • Particular set of genes in genome is called
    genotype.

3
Biological Background 2
  • During reproduction, first occurs recombination
    (or crossover).
  • Genes from parents form in some way the whole new
    chromosome.
  • The new created offspring can then be mutated.
    Mutation means, that the elements of DNA are a
    bit changed. This changes are mainly caused by
    errors in copying genes from parents.
  • The fitness of an organism is measured by success
    of the organism in its life.

4
Search Space
  • The space of all feasible solutions (it means
    objects among those the desired solution is) is
    called search space (also state space).
  • Each point in the search space represent one
    feasible solution.
  • The looking for a solution is then equal to a
    looking for some extreme (minimum or maximum) in
    the search space.
  • Search methods hill climbing, tabular search,
    simulated annealing and genetic algorithm.

5
Basic Description of GA
  • Algorithm is started with a set of solutions
    (represented by chromosomes) called population.
  • Solutions from one population are taken and used
    to form a new population.
  • The new population (offspring) will be better
    than the old one (parent).
  • Solutions which are selected to form new
    solutions are selected according to their fitness
    - the more suitable they are the more chances
    they have to reproduce.

6
Basic Genetic Algorithm
7
Basic GA part 1
  • Step 1 Start Generate random population of n
    chromosomes (suitable solutions for the problem.)
  • Step 2 Fitness Evaluate the fitness f(x) of
    each chromosome x in the population.
  • Step 3 New population Create a new population
    by repeating following steps until the new
    population is complete.

8
Basic GA part 2
  • Step 3 Create a new population
  • Selection Select two parent chromosomes from a
    population according to their fitness.
  • Crossover With a crossover probability cross
    over the parents to form a new offspring
    (children). If no crossover was performed,
    offspring is an exact copy of parents.
  • Mutation With a mutation probability mutate new
    offspring at each locus.
  • Accepting Place new offspring in a new
    population

9
Basic GA part 3
  • Step 4 Replace Use new generated population
    for a further run of algorithm
  • Step 5 Test If the end condition is satisfied,
    stop, and return the best solution in current
    population
  • Step 6 Loop Go to step 2.

10
Operators of GA Encoding
  • The chromosome should in some way contain
    information about solution which it represents.
  • The most used way of encoding is a binary string.
  • Chromosome 1 ?1101100100110110
  • Chromosome 2 ?1101111000011110
  • Each bit in this string can represent some
    characteristic of the solution.
  • One can encode directly integer or real numbers.

11
Operators of GA Selection
  • Chromosomes are selected from the population to
    be parents to crossover.
  • According to Darwin's evolution theory the best
    ones should survive and create new offspring.
  • For example roulette wheel selection, Boltzman
    selection, tournament selection, rank selection,
    steady state selection and some others.

12
Roulette Wheel Selection
  • Parents are selected according to their fitness.
  • The better the chromosomes are, the more chances
    to be selected they have.

13
Example
  • fitness values f(x)x2

x string fitness f(x) of total
13 01101 169 14.4
24 11000 576 49.2
8 01000 64 5.5
19 10011 361 30.9
total total 1170 100.0
14
Rank Selection 1
  • Rank selection first ranks the population and
    then every chromosome receives fitness from this
    ranking.

15
Rank Selection 2
  • After this all the chromosomes have a chance to
    be selected.
  • But this method can lead to slower convergence,
    because the best chromosomes do not differ so
    much from other ones.

16
Operators of GA Crossover
  • Crossover selects genes from parent chromosomes
    and creates a new offspring.
  • Chromosome 1?11011 00100110110
  • Chromosome 2?11011 11000011110
  • Offspring 1 ?11011 11000011110
  • Offspring 2 ?11011 00100110110
  • is the crossover point

17
Crossover
  • Single point crossover 1100101111011111
    11001111
  • Two point crossover 11001011 11011111
    11011111
  • Uniform crossover 11001011 11011101 11011111
  • Arithmetic crossover 11001011 11011111
    11001001
    (AND)

18
Operators of GA Mutation
  • Prevent falling all solutions in population into
    a local optimum of solved problem
  • Mutation changes randomly the new offspring.
  • Original offspring 1?1101111000011110
  • Mutated offspring 1?1100111000011110
  • Original offspring 2?1101100100110110
  • Mutated offspring 2?1101101100110110

19
Control Parameters
  • GA has two control parameters crossover rate
    (pc) and mutation rate (pm).
  • pc (0.51.0) The higher the value of pc, the
    quicker are the new solutions introduced into the
    population.
  • pm (0.0050.05) Large values of pm transform the
    GA into a purely random search algorithm, while
    some mutations are required to prevent the
    premature convergence of the GA to suboptimal
    solutions.

20
Numerical Example
No. string x fitness of total
1 01101 13 169 14.4
2 11000 24 576 (max) 49.2
3 01000 8 64 5.5
4 10011 19 361 30.9
total total 1170 100.0
21
Numerical Example
No. actual count
1 0.14 0.58 1
2 0.49 (max) 1.97 (max) 2 (max)
3 0.06 0.22 0
4 0.31 1.23 1
average 0.25 1.0 1.0
22
Numerical Example
No. string mate crossover site new string
1 01101 2 4 01100
2 11000 1 4 11001
3 11000 4 2 11011
4 10011 3 2 10000
23
Numerical Example
No. new population x f(x)x2
1 01100 12 144
2 11001 25 625
3 11011 27 729 (max)
4 10000 16 256
1 01101 13 169
2 11000 24 576 (max)
3 01000 8 64
4 10011 19 361
24
Real-Valued GA
  • Basic (binary) GA????????,??(encoding)???(decoding
    )??????,??????????,????????????????,??????????????
    ???
  • ??????????????????,?????????????????????????,?????
    ???????

25
?????????
  • ??P1?P2???,C1?C2???
  • ????C1 ? ? P1 (1??) ? P2C2 ? ? P1 (1?
    ?) ? P2?? ? ? ? ????,? ?, ? ? 0, 1
  • ????C C random_noise?? random_noise
    ?????????

26
????????
  • ????????????????,???????????
  • ??????? 0, ?,?? 4 ????,?????????15??

??? 0000 0001 --- 1000 --- 1111
?? 0 1 --- 8 --- 15
?? 0 ? / 15 --- 8? / 15 --- ?
27
?????????
  • ?????Binary GA ??
  • ???????????? ? ????? 123456 ? 125436
Write a Comment
User Comments (0)
About PowerShow.com