Download presentation

Presentation is loading. Please wait.

Published byAriana Woodward Modified over 2 years ago

1
Genetic Algorithms Lecture 5 Addendum to the slides of Jason Noble

2
Evolutionary Algorithms NNII NI NI NINI NN NI II

3
Evolutionary Algorithms Binary Genetic Algorithms Variable Encoding and Decoding Generating a Population Generating Offspring: Crossover Mutation Selection Real chromosomes diploid GA almost always (haploid) exception will be explicitly mentioned

4
Evolutionary Algorithms Example (Haupt & Haupt, 2004) Suppose we have a digital map of a mountain range We want to find the highest peak on the map Automatically! Difficult problem for conventional optimization techniques

5
Evolutionary Algorithms

6
Variable Encoding VariableValueDecimalBinary Latitude (min) 40 o,1510000000 Latitude (max) 40 o,161281111111 Longitude (min) 105 0 3610000000 Longitude (max) 105 0 37301281111111 Chromosome =[11000110011001] X y

7
Evolutionary Algorithms Generate an Initial Population 0010111100011012359 1110010110010011872 0011001000110013477 0010111100100012363 1100111111101111631 0100010111101112097 1110110000000112588 0100110111001111860 Assign each chromosome a fitness (in this case simply the height of the point)

8
Evolutionary Algorithms Selection (at 50% selection rate) 0010111100011012359 0011001000110013477 0010111100100012363 1110110000000112588 Selection: Choose a selection rate Choose a threshold (all above survive)

9
Evolutionary Algorithms Assume random mating 0010111100011012359 0011001000110013477 0010111100100012363 1110110000000112588 Selection: Choose a selection rate Choose a threshold (all above survive)

10
Evolutionary Algorithms Assume random mating 0010111100011012359 0011001000110013477 0010111100100012363 1110110000000112588 Selection: Choose a selection rate Choose a threshold (all above survive)

11
Evolutionary Algorithms Crossover 00101111000110 00110010001100 00101111001000 11101100000001

12
Evolutionary Algorithms Crossover 00101111000110 00110010001100 00101111001000 11101100000001 Crossover point

13
Evolutionary Algorithms Crossover 00101111000110 00110010001100 00101111001000 11101100000001 Crossover point

14
Evolutionary Algorithms Crossover 00101111000110 00110010001100 00101111001000 11101100000001 Crossover point

15
Evolutionary Algorithms Crossover 0010111100011000101100000001 00110010001100 00101111001000 1110110000000111101111000110 Crossover point

16
Evolutionary Algorithms Crossover 0010111100011000101100000001 00110010001100 00101111001000 1110110000000111101111000110 Crossover point

17
Evolutionary Algorithms Crossover 0010111100011000101100000001 0011001000110000110111001000 0010111100100000101010001100 1110110000000111101111000110 Crossover point

18
Evolutionary Algorithms New generation (almost) 0010111100011000101100000001 0011001000110000110111001000 0010111100100000101010001100 1110110000000111101111000110 Crossover point

19
Evolutionary Algorithms Mutation 0010111100011000101100000001 0011001010110000110111001000 0010111100100000101010101100 1110110000000111101111000110

20
Evolutionary Algorithms Over the generations ….

21
Evolutionary Algorithms Summary: Canonical Genetic Algorithm S1: Set t= 0 S2: Initialize chromosome population P(t) Usually by random init. S3: Evaluate P(t) by a fitness measure S4: while (termination not satisfied) do: begin S4.1 Select for recombination chromosomes from P(t). Let P 1 be the set of selected chromosomes. Choose individuals from P 1 to enter the mating pool (MP) S4.2 Recombine the chromosomes in MP forming P 2. Mutate chromosomes in P 2 forming P 3 S4.3 Select for replacement from P 3 and P(t) forming P(t+1) t = t + 1 end

22
Evolutionary Algorithms Generating offspring Weighted random pairing (roulette wheel weighting) Rank weighting Cost weighting Equivalently allow a number of copies to mate (weighted)

23
Evolutionary Algorithms Generating offspring Roulette wheel selection How many copies take part in mating? Rank weighting Cost weighting http://www.edc.ncl.ac.uk/highlight/rhjanuary2007g02.php/

24
Evolutionary Algorithms Roulette wheel weighting (1) 0011001000110013477 1110110000000112588 0010111100011012359 0010111100100012363 0.4 0.30.7 0.20.9 0.11.0 Rank weighting: assign distributions by rank, make sure that total probability is 1.0 pnpn ΣpnΣpn

25
Evolutionary Algorithms Roulette wheel weighting (2) 0011001000110013477 1110110000000112588 0010111100100012363 0010111100011012359 0.265 0.2480.513 0.2430.756 0.2431.0 Fitness based weighting: assign distributions by fitness, make sure that total probability is 1.0 pnpn ΣpnΣpn

26
Evolutionary Algorithms Roulette wheel weighting (3) 0011001000110013477-12097 = 1380 1110110000000112588-12097 = 491 0010111100100012363-12097 = 266 0010111100011012359-12097 = 262 0.575 0.2050.780 0.1110.891 0.1091.0 Cost based weighting: assign distributions by cost, make sure that total probability is 1.0 pnpn ΣpnΣpn

27
Evolutionary Algorithms Pairing offspring Randomly Rank based (1-2) (3-4) Prevents overly quick convergence Tournament: Pick two chromosomes Set parameter k Generate random nr r If (r < k) pick fitter (eg. k = 0.75) Elitism: always pick (a couple of) the best

28
Evolutionary Algorithms Real valued chromosomes In case of example: (x, y), where x and y are the spatial coordinates Crossover Discrete recombination Intermediate recombination Line recombination

29
Evolutionary Algorithms Real valued chromosomes Crossover Line recombination (122, 45, 77) and (3,4,3) Generate random positions: (1,2,2) and (1,1,2) Results in: (122, 4, 3) and (122, 45, 3)

30
Evolutionary Algorithms Real valued chromosomes Intermediate recombination Offspring = parent 1 + α(parent 2 – parent 1) Allow area to be slightly larger than hypercube defined by parents Generate α for each position Line recombination Use a single value for α

31
Evolutionary Algorithms Genetic Programming (Koza, 1992,1994,…) Example (Mitchell, 1998): Keplers law P 2 = cA 3, P orbital Period, A average distance from sun Programme for Mars: Program Orb // Mars A = 1.52; P = SQRT(A*A*A); PRINT P END

32
Evolutionary Algorithms Genetic Programming Lisp version (defun orbital_period () ; Mars; (setf A 1.52) (sqrt (A A (* A A))))

33
Evolutionary Algorithms Parse tree for LISP expression SQRT * A * AA

34
Evolutionary Algorithms Kozas algorithm Trees consist of functions and terminals Choose a set of functions and terminals, e.g { +, -, *, /, }; {A} Generate random programmes (trees) which are syntactically correct Evaluate fitness Apply crossover (mutation)

35
Evolutionary Algorithms Crossover / A/ // AAAA * A- * AAA / A/ // AAA * A- *A AA X A

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google