Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Genetic Algorithm and Some Experience Sharing

Similar presentations


Presentation on theme: "Introduction to Genetic Algorithm and Some Experience Sharing"— Presentation transcript:

1 Introduction to Genetic Algorithm and Some Experience Sharing
2019/4/24

2 Genetic Algorithm (GA) Evolutionary Procedure
Outline Introduction Genetic Algorithm (GA) Evolutionary Procedure Some Experience Discussion Conclusion 2019/4/24

3 Introduction 2019/4/24

4 Introduction Presented by John Holland in 1975
Mimicking the Natural Selection and Natural Genetics A Numerical Optimization Method of Global Search Suited to Large Scale and Complicated System Riddle with Some Local Minimum Exploitation and exploration Near-optimal Solution 2019/4/24

5 Introduction y=x2 × o 2019/4/24

6 Introduction GA’s Form: Binary Genetic Algorithm
Continuous Parameter Genetic Algorithm 2019/4/24

7 GA Evolutionary Procedure
2019/4/24

8 The flow chart of genetic algorithm
Define chromosome formation and fitness function Create initial population Evaluate fitness value Select Crossover Mutate Stop Test stopping criterion 2019/4/24

9 Define chromosome formation and fitness function
P1 Q1 system, experiment, equation,... P2 Q2 P3 QM PN chromosome=[P1, P2, P3, ...,PN] P1, P2, P3, ...,PN: gene fitness function or cost function Chromosome formation and fitness choice are depending on problem 2019/4/24

10 Define chromosome formation
and fitness function fitness function: Represent pros and cons of a chromosome. fitness function=-cost function or fitness function=1/cost function 2019/4/24

11 Define chromosome formation and fitness function
binary GA: quantization and encode | | …| P1, P2, P3, ...,PN real number chromosome=[ | |…| ] P1 P2 PN continuous parameter GA: chromosome=[P1, P2, P3, ...,PN] 2019/4/24

12 Define chromosome formation
and fitness function EX: chromosome formation continuous parameter GA: chromosome=[x, y] binary GA: chromosome=[ | ] cost function C C=-h or C=1/h fitness function f f=-C or 1/C h y x x, y: space coordinate input h: height output 2019/4/24

13 Create Initial Population
Generate chromosomes of first generation. Determine the number of chromosome K at every generation. Random generated Methods: Generate K initial chromosomes to evolve directly. Generate L initial chromosomes, in which L>K. Choose best K to evolve. 2019/4/24

14 Select Determine parents chromosomes to mate.
Select procedure: Rank according to fitness Select appropriate members into mating pool Select appropriate parents from mating pool  Send to mate. 2019/4/24

15 Select n<=K Rank mating pool n K :: Select n better chromosomes
Generated by initialization or mate 1 2 3 n mating pool n<=K Select n better chromosomes Select parents to mate 2019/4/24

16 Select Mechanism A method selecting parents from the mating pool.
Method 1: Paring from top to bottom :: Rank 1 2 3 K mating pool pair To mate 2019/4/24

17 Select Mechanism Method 2: Random Paring
Random generate two parents from the mating pool to mate. The selected probability for each chromosome is the same. The procedure does not stop until K/2 pairs parents are generated. 2019/4/24

18 Method 3: Weighted Random Paring
Select Mechanism Method 3: Weighted Random Paring (a). Rank weighting: The selected probability is determined according to their rank. Ex. n=6 Selected probability rank i cost Pi 1 -13778 0.2857 2 -13360 0.2381 0.5238 3 -13338 0.1905 0.7143 4 -13255 0.1429 0.8572 5 -13166 0.0952 0.9524 6 -13164 0.0476 1.0000 n: the number of chromosome in the mating pool i : rank 2019/4/24

19 Select Mechanism Method 3: Weighted Random Paring
(b). Cost weighting: The selected probability is calculated from the cost of the chromosome. Ex. n=6 Selected probability Pi rank i cost Ci Pi 1 -13778 -699 0.4401 2 -13360 -281 0.1772 0.6174 3 -13338 -259 0.1632 0.7805 4 -13255 -176 0.1109 0.8915 5 -13166 -87 0.0547 0.9461 6 -13164 -85 0.0539 1.0000 7 -13079 × i : rank 2019/4/24

20 Method 4: Tournament selection
Select Mechanism Method 4: Tournament selection Two chromosomes are selected randomly. The chromosome which fitness is better selected as parent. Ex. n=6 selected chromosomes parent paring 2,1 1 1,5 5,5 5 6,3 3 3,4 4,5 4 1,1 1,4 Hint: numerical represents the rank of the chromosome 2019/4/24

21 Crossover (Mating) A GA operation creating one or more temporary offspring from the parents selected in the mating pool. Exploitation and exploration Crossover type: single-point crossover two-point crossover uniform crossover blending crossover (continuous parameter GA) 2019/4/24

22 Crossover (Mating)-binary GA
single-point crossover: parent parent crossover point offspring offspring 2019/4/24

23 Crossover (Mating)-binary GA
two-point crossover: parent parent crossover point offspring offspring 2019/4/24

24 Crossover (Mating)-binary GA
uniform crossover: parent parent offspring offspring mask 2019/4/24

25 Crossover-continuous parameter GA
single-point crossover: parent1 = [Pm1,Pm2,Pm3,Pm4,Pm5,Pm6, …, PmN] crossover point parent2 = [Pd1,Pd2,Pd3, Pd4,Pd5,Pd6, …,PdN] offspring2 = [Pd1,Pd2,Pd3, Pm4,Pm5,Pm6, …, PmN] offspring1 = [Pm1,Pm2,Pm3, Pd4,Pd5,Pd6, …,PdN] 2019/4/24

26 Crossover-continuous parameter GA
two-point crossover: parent1 = [Pm1,Pm2, Pm3,Pm4, Pm5,Pm6, …, PmN] crossover point parent2 = [Pd1,Pd2, Pd3, Pd4, Pd5,Pd6, …,PdN] offspring2 = [Pd1,Pd2, Pm3,Pm4, Pd5,Pd6, …, PdN] offspring1 = [Pm1,Pm2, Pd3,Pd4, Pm5,Pm6, …,PmN] 2019/4/24

27 Crossover-continuous parameter GA
uniform crossover: parent1 = [Pm1,Pm2, Pm3,Pm4, Pm5,Pm6, …, PmN] parent2 = [Pd1,Pd2, Pd3, Pd4, Pd5,Pd6, …,PdN] offspring2 = [Pm1,Pd2, Pm3,Pm4, Pd5,Pd6, …, PmN] offspring1 = [Pd1,Pm2, Pd3,Pd4, Pm5,Pm6, …,PdN] mask= [ … 1] 2019/4/24

28 Crossover-continuous parameter GA
blending crossover: parent1 = [Pm1,Pm2,Pm3,Pm4,Pm5,Pm6, …, PmN] parent2 = [Pd1, Pd2, Pd3, Pd4, Pd5, Pd6, …, PdN] offspring = [Pnew1,Pnew2, Pnew3,Pnew4, Pnew5,Pnew6, …,PnewN] =random number on interval [0, 1] for i-th gene in the offspring Pmi=the i-th gene in the mother chromosome Pdi=the i-th gene in the father chromosome 2019/4/24

29 Mutation Operation on temporary offspring from crossover
Escape from the local minimum and explore other zone. Avoid pre-maturity Low mutation rate (typically 1%~20%) For binary GA, the mutated bit will be flip. (10, 01) For continuous parameter GA, the mutated gene will be replaced by an arbitrary value. 2019/4/24

30 generated by crossover
Mutation-binary GA chromosome cost -13778 -11956 -13338 -13553 -13289 -12164 -13372 -13642 -13036 -10586 -12587 -13652 chromosome temporary offspring generated by crossover mutation rate=5% 12×14× 0.05≒8 mutation 2019/4/24

31 Mutation-continuous parameter GA
0<=x<=10 Chromosome=[x,y] temporary offspring generated by crossover 0<=y<=10 chromosome x y 1 9.0465 8.3128 2 9.0469 8.7384 10 9.3469 7.9025 11 1.5034 9.0860 21 0.6056 5.1942 22 4.1539 4.7773 23 8.6750 2.7271 24 4.1208 3.1754 mutation rate=4% 24×2× 0.04≒2 chromosome10=[9.3469, ] chromosome10=[3.5746, ] chromosome23=[8.6750, ] chromosome23=[8.6750, ] 2019/4/24

32 Stopping Criterion (a) A pre-set number of iterations.
(b) The same best chromosome is selected repeated for successive iterations. (c) A acceptable solution is obtained. 2019/4/24

33 Elitism Permit some better chromosomes surviving into next generation.
Rank 1 2 3 K n : sent to next generation directly K-n present generation next generation generated by GA operation 2019/4/24

34 Elitism Advantage: Fast convergence Better solution
Lower computation load Drawback: Pre-maturity (Easy sink into the local minimum) 2019/4/24

35 Some Experience Discussion
2019/4/24

36 Elitism or non-Elitism?
Comparison of GA with elitism and GA without elitism Ex. Find F(x,y)=xsin(4x)+1.1ysin(2y) minimum value, 0<=x, y<=10 Binary GA Chromosome=[x,y] x,y: encode by 10bits Population size=40 Ngood=20 Crossover rate=0.6 Mutation rate=0.1 Iteration number=100 Run number=30 2019/4/24

37 Size of population More chromosomes: Less chromosomes: Advantage
Better solution Drawback Larger computation load Less chromosomes: Advantage Lighter computation load Drawback Worse solution 2019/4/24

38 Ex. Find F(x,y)=xsin(4x)+1.1ysin(2y) minimum value, 0<=x, y<=10
Size of population Ex. Find F(x,y)=xsin(4x)+1.1ysin(2y) minimum value, 0<=x, y<=10 Binary GA Chromosome=[x,y] x,y: encode by 10bits Ngood=population*0.4 Crossover rate=0.6 Mutation rate=0.05 Iteration number=50 Elitism Run number=30 population size 2019/4/24

39 Selection mechanism Paring from top to bottom Random Paring
Rank weighting (ˇ) Cost weighting Tournament selection (ˇ) 2019/4/24

40 Which crossover is better?
binary GA: uniform crossover Continuous parameter GA: blending crossover 2019/4/24

41 The number of iteration
Best choice 2019/4/24

42 The selection of GA operators and parameters is depend on problem.
Conclusion The selection of GA operators and parameters is depend on problem. 2019/4/24

43 Thank you for your attention
2019/4/24


Download ppt "Introduction to Genetic Algorithm and Some Experience Sharing"

Similar presentations


Ads by Google