Speaker: Pei-Ni Tsai. Outline Introduction Fitness Function GA Parameters GA Operators Example ...

50
GENETIC ALGORITHMS Speaker: Pei-Ni Tsai
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    226
  • download

    2

Transcript of Speaker: Pei-Ni Tsai. Outline Introduction Fitness Function GA Parameters GA Operators Example ...

  • Slide 1
  • Speaker: Pei-Ni Tsai
  • Slide 2
  • Outline Introduction Fitness Function GA Parameters GA Operators Example Shortest Path Routing Problem 2
  • Slide 3
  • Introduction Biological background Darwin On the Origin of Species Natural selection Reproduction Recombination (Crossover) Mutation The fittest survives History John Holland 3
  • Slide 4
  • Introduction (Cont.) Population A set of solutions Represented by chromosomes Solutions from one population are taken and used to form a new population. New solutions are selected according to their fitness. This is repeated until some condition (for example number of populations or improvement of the best solution) is satisfied. 4
  • Slide 5
  • Introduction (Cont.) Selection Crossover Mutation 5
  • Slide 6
  • Fitness Function Interprets the chromosome in terms of physical representation and evaluates its fitness based on traits of being desired in the solution. 6
  • Slide 7
  • GA Parameters Crossover probability How often will be crossover performed If there is no crossover, offspring is exact copy of parents. If there is a crossover, offspring is made from parts of parents' chromosome. Mutation probability How often will be parts of chromosome mutated Population size 7
  • Slide 8
  • GA Operators Encoding Selection Crossover Mutation 8
  • Slide 9
  • Encoding The chromosome should in some way contain information about solution which it represents. Binary Encoding Permutation Encoding Value Encoding 9
  • Slide 10
  • Encoding (Cont.) Binary Encoding In binary encoding every chromosome is a string of bits, 0 or 1. Chromosome A 101100101100101011100101 Chromosome B 111111100000110000011111 10
  • Slide 11
  • Encoding (Cont.) Permutation Encoding In permutation encoding, every chromosome is a string of numbers, which represents number in a sequence. Permutation encoding is only useful for ordering problems. Chromosome A1 5 3 2 6 4 7 9 8 Chromosome B 8 5 6 7 2 3 1 4 9 11
  • Slide 12
  • Encoding (Cont.) Value Encoding In value encoding, every chromosome is a string of some values. Values can be anything connected to problem, form numbers, real numbers or chars to some complicated objects. Chromosome A1.2324 5.3243 0.4556 2.3293 2.4545 Chromosome BABDJEIFJDHDIERJFDLDFLFEGT Chromosome C(back), (back), (right), (forward), (left) 12
  • Slide 13
  • Selection According to Darwin's evolution theory the best ones should survive and create new offspring. Roulette Wheel Selection Rank Selection Tournament Selection Elitism 13
  • Slide 14
  • Selection (Cont.) Roulette Wheel Selection Parents are selected according to their fitness. 14
  • Slide 15
  • Selection (Cont.) Rank Selection The previous selection will have problems when the fitnesses differs very much. Rank selection first ranks the population and then every chromosome receives fitness from this ranking. The worst will have fitness 1, second worst 2 etc. and the best will have fitness N (number of chromosomes in population). 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. 15
  • Slide 16
  • Selection (Cont.) Rank Selection Situation before ranking (graph of fitnesses) Situation after ranking (graph of order numbers) 16
  • Slide 17
  • Selection (Cont.) Tournament Selection ( Elitism First copies the best chromosome (or a few best chromosomes) to new population. 17
  • Slide 18
  • Crossover Binary Encoding Single point crossover Two point crossover Uniform crossover Arithmetic crossover Permutation Encoding Single point crossover Value Encoding All crossovers from binary encoding can be used 18
  • Slide 19
  • Crossover (Cont.) Binary Encoding Single point crossover 19
  • Slide 20
  • Crossover (Cont.) Binary Encoding (Cont.) Two point crossover 20
  • Slide 21
  • Crossover (Cont.) Binary Encoding (Cont.) Uniform crossover (mask) 21
  • Slide 22
  • Crossover (Cont.) Binary Encoding Arithmetic crossover some arithmetic operation is performed to make a new offspring 11001011 + 11011111 = 11001001 (AND) 22
  • Slide 23
  • Crossover (Cont.) Permutation Encoding Single point crossover One crossover point is selected, till this point the permutation is copied from the first parent, then the second parent is scanned and if the number is not yet in the offspring it is added. (1 2 3 4 5 6 7 8 9) + (4 5 3 6 8 9 7 2 1) = (1 2 3 4 5 6 8 9 7) There are more ways how to produce the rest after crossover point 23
  • Slide 24
  • Crossover (Cont.) Value Encoding All crossovers from binary encoding can be used Single point crossover Two point crossover Uniform crossover Arithmetic crossover 24
  • Slide 25
  • Mutation Binary Encoding Bit inversion Permutation Encoding Order changing Value Encoding Adding a small number (for real value encoding) 25
  • Slide 26
  • Mutation (Cont.) Binary Encoding Bit inversion Selected bits are inverted 26
  • Slide 27
  • Mutation (Cont.) Permutation Encoding Order changing Two numbers are selected and exchanged (1 2 3 4 5 6 8 9 7) => (1 8 3 4 5 6 2 9 7) 27
  • Slide 28
  • Mutation (Cont.) Value Encoding Adding a small number (for real value encoding) To selected values is added (or subtracted) a small number 28
  • Slide 29
  • Example Shortest Path Routing Problem Genetic Representation Population Initialization Fitness Function Selection Crossover Mutation Repair Function Simulation 29
  • Slide 30
  • Example (Cont.) Genetic Representation Fig. 1. Example of routing path and its encoding scheme. 30
  • Slide 31
  • Example (Cont.) Population Initialization Random initialization Fitness Function : the fitness value of the th chromosome : the length of the th chromosome : the gene (node) of the th locus in the th chromosome : the link cost between nodes 31
  • Slide 32
  • Example (Cont.) Selection Pairwise tournament selection without replacement Two chromosomes are picked and the one that is fitter is selected. The same chromosome should not be picked twice as a parent. 32
  • Slide 33
  • Example (Cont.) Crossover Pseudocode of the crossover. 33
  • Slide 34
  • Example (Cont.) Crossover Example of the crossover procedure. 34
  • Slide 35
  • Example (Cont.) Mutation Pseudocode of the mutation. 35
  • Slide 36
  • Example (Cont.) Mutation Example of the mutation procedure 36
  • Slide 37
  • Example (Cont.) Repair Function Pseudocode of the repair function. 37
  • Slide 38
  • Example (Cont.) Repair Function 38
  • Slide 39
  • Example (Cont.) Repair Function (Cont.) 39
  • Slide 40
  • Example (Cont.) Simulation Performed with MATLAB 5.3 on Pentium III processor ( 850 -MHz clock) The mutation probability is set to 0.05 (a typical mutation option) Each experiment is terminated when all the chromosomes have converged to the same solution 40
  • Slide 41
  • Example (Cont.) (a)Result of the Munemotos algorithm (total path costs: 187). (b) Result of the Inagakis algorithm (total path costs: 234). Simulation Results for a Fixed Network With 20 Nodes Comparison results for the paths found by each algorithm. 41
  • Slide 42
  • Example (Cont.) Simulation Results for a Fixed Network With 20 Nodes Comparison results for the paths found by each algorithm. (c) Result of the proposed algorithm (total path costs: 142). (d) Example network with optimal path in bold line (optimal path costs: 142). 42
  • Slide 43
  • Example (Cont.) Simulation Results for a Fixed Network With 20 Nodes 43
  • Slide 44
  • Example (Cont.) Simulation Results for Random Network Topologies 44
  • Slide 45
  • Example (Cont.) Simulation Results for Random Network Topologies 45
  • Slide 46
  • Example (Cont.) Simulation Results for Random Network Topologies 46
  • Slide 47
  • Example (Cont.) Simulation Results for Random Network Topologies 47
  • Slide 48
  • Example (Cont.) Simulation Results for Random Network Topologies 48
  • Slide 49
  • Reference 2005 1-28 2005 29-56 Introduction to Genetic Algorithms: http://obitko.com/tutorials/genetic-algorithms/ http://obitko.com/tutorials/genetic-algorithms/ Chang Wook Ahn and R.S. Ramakrishna, A Genetic Algorithm for Shortest Path Routing Problem and the Sizing of Populations, IEEE Transactions on Evolutionary Computation, Vol. 6, Dec. 2002. 49
  • Slide 50
  • Q & A 50