1 / 50

Genetic Algorithms

Speaker: Pei-Ni Tsai. Genetic Algorithms. Outline. Introduction Fitness Function GA Parameters GA Operators Example Shortest Path Routing Problem. Introduction. Biological background Darwin On the Origin of Species Natural selection Reproduction Recombination (Crossover)

nanji
Download Presentation

Genetic Algorithms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Speaker: Pei-Ni Tsai Genetic Algorithms

  2. Outline • Introduction • Fitness Function • GA Parameters • GA Operators • Example • Shortest Path Routing Problem

  3. Introduction • Biological background • Darwin • On the Origin of Species • Natural selection • Reproduction • Recombination (Crossover) • Mutation • The fittest survives • History • John Holland

  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.

  5. Introduction (Cont.) Mutation Crossover Selection

  6. Fitness Function • Interprets the chromosome in terms of physical representation and evaluates its fitness based on traits of being desired in the solution.

  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

  8. GA Operators • Encoding • Selection • Crossover • Mutation

  9. Encoding • The chromosome should in some way contain information about solution which it represents. • Binary Encoding • Permutation Encoding • Value Encoding

  10. Encoding (Cont.) • Binary Encoding • In binary encoding every chromosome is a string of bits, 0 or 1.

  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.

  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.

  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(精英挑選)

  14. Selection (Cont.) • Roulette Wheel Selection • Parents are selected according to their fitness.

  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.

  16. Selection (Cont.) • Rank Selection Situation before ranking (graph of fitnesses) Situation after ranking (graph of order numbers)

  17. Selection (Cont.) • Tournament Selection • 在每一代的演化過程中首先隨機地選取兩個或更多的物種(字串),具有最大適應函數值的物種即被選中。 • Elitism • First copies the best chromosome (or a few best chromosomes) to new population. 

  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

  19. Crossover (Cont.) • Binary Encoding • Single point crossover

  20. Crossover (Cont.) • Binary Encoding (Cont.) • Two point crossover

  21. Crossover (Cont.) • Binary Encoding (Cont.) • Uniform crossover • 均一交配又稱為字罩 (mask) 交配,子代的產生係根據事先隨機產生的字罩來決定,字罩是二進位元串其長度等於個體的長度。

  22. Crossover (Cont.) • Binary Encoding • Arithmetic crossover • some arithmetic operation is performed to make a new offspring 11001011 + 11011111 = 11001001 (AND)

  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 56 7 8 9) + (4 5 3 6 89 7 2 1) = (1 2 3 4 56 8 9 7) • There are more ways how to produce the rest after crossover point

  24. Crossover (Cont.) • Value Encoding • All crossovers from binary encoding can be used • Single point crossover • Two point crossover • Uniform crossover • Arithmetic crossover

  25. Mutation • Binary Encoding • Bit inversion • Permutation Encoding • Order changing • Value Encoding • Adding a small number (for real value encoding)

  26. Mutation (Cont.) • Binary Encoding • Bit inversion • Selected bits are inverted

  27. Mutation (Cont.) • Permutation Encoding • Order changing • Two numbers are selected and exchanged (1 23 4 5 6 89 7) => (1 83 4 5 6 29 7)

  28. Mutation (Cont.) • Value Encoding • Adding a small number (for real value encoding) • To selected values is added (or subtracted) a small number

  29. Example • Shortest Path Routing Problem • Genetic Representation • Population Initialization • Fitness Function • Selection • Crossover • Mutation • Repair Function • Simulation

  30. Example (Cont.) • Genetic Representation Fig. 1. Example of routing path and its encoding scheme.

  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 thlocus in the thchromosome : the link cost between nodes

  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.

  33. Example (Cont.) • Crossover Pseudocodeof the crossover.

  34. Example (Cont.) • Crossover Example of the crossover procedure.

  35. Example (Cont.) • Mutation Pseudocode of the mutation.

  36. Example (Cont.) • Mutation Example of the mutation procedure

  37. Example (Cont.) • Repair Function Pseudocode of the repair function.

  38. Example (Cont.) • Repair Function

  39. Example (Cont.) • Repair Function (Cont.)

  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

  41. Example (Cont.) Simulation Results for a Fixed Network With 20 Nodes Comparison results for the paths found by each algorithm. Result of the Munemoto’s algorithm (total path costs: 187). (b) Result of the Inagaki’s algorithm (total path costs: 234).

  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).

  43. Example (Cont.) Simulation Results for a Fixed Network With 20 Nodes

  44. Example (Cont.) Simulation Results for Random Network Topologies

  45. Example (Cont.) Simulation Results for Random Network Topologies

  46. Example (Cont.) Simulation Results for Random Network Topologies

  47. Example (Cont.) Simulation Results for Random Network Topologies

  48. Example (Cont.) Simulation Results for Random Network Topologies

  49. Reference • 林豐澤,2005。演化式計算上篇:演化式演算法的三種理論模式。智慧科技與應用統計學報第三卷第一期,1-28。 • 林豐澤,2005。演化式計算下篇:基因演算法以及三種應用實例。智慧科技與應用統計學報第三卷第一期,29-56。 • Introduction to Genetic Algorithms: http://obitko.com/tutorials/genetic-algorithms/ • Chang WookAhn 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.

  50. Q & A

More Related