Download presentation
Presentation is loading. Please wait.
Published byHoward Greer Modified over 9 years ago
1
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis 03-12-2007
2
2 Agenda The overview of the genetic idea The structure of genetic algorithms Where to use? The genetic algorithm for Traveling Salesman Problem Summary
3
3 The overview – definitions Genotype (genome) – population of abstract representations of candidate solutions. Phenotype – the candidate solution. Fitness function – particular type of objective function that quantifies the optimality of the solution.
4
4 Generation, Selection, Modification The genetic algorithm usually starts from randomly generated population. In each generation, the fitness of every individual in the population is evaluated, Multiple individuals are stochastically selected from the current population (based on their fitness), and modified (recombined and possibly randomly mutated) to form a new population. The new population is then used in the next iteration of the algorithm.
5
5 Algorithm Choose initial population Evaluate the fitness of each individual in the population Repeat until gen_no > max_gen_no or best <= Select best-ranking individuals to reproduce Breed new generation through crossover and mutation (genetic operations) and give birth to offspring (gen_no++) Evaluate the individual fitnesses of the offspring (set best) Replace worst ranked part of population with offspring
6
6 Changes - Mutation, Crossover Mutation – the random change in the chromosome. Crossover – two chromosomes change some portion of information i.e. Random change of some bits in the representation
7
7 Genotype representation Usually binary arrays (lists) are used, to make the crossover operations easy however other representation are also used.
8
8 Termination A solution is found that satisfies minimum criteria. Fixed number of generations reached. Allocated budget (computation time/money) reached. The highest ranking solution's fitness is reaching or has reached a plateau such that successive iterations no longer produce better results. Manual inspection. Combinations of the above.
9
9 Applications of GA Designing neural networks, both architecture and weights Robot trajectory Evolving LISP programs (genetic programming) Strategy planning Finding shape of protein molecules TSP and sequence scheduling Functions for creating images
10
10 Traveling Salesman Problem Input – the set of cities (nodes) and the distances between them. Output – the permutation of cities. Goal – to find the minimal Hamiltonian tour. d x i x i+1 is a distance between x i and x i+1 ( d x i x i+1 + d x n x 1 ) min n-1 i=1
11
11 Traveling Salesman Problem Permutation encoding used to encode chromosomes. Each chromosome is a string of numbers, which represents number of town in a entry sequence. Chromosome A1 5 3 2 6 4 7 9 8 Chromosome B8 5 6 7 2 3 1 4 9
12
12 TSP – crossover and mutation Mutation – take 2 arbitrary elements and swap them Crossover Chromosome A1 5 3 2 6 4 7 9 8 Chromosome B8 5 6 7 2 3 1 4 9 Offspring A1 5 3 2 6 4 8 7 9 Offspring B5 6 2 3 1 4 7 9 8
13
13 Traveling Salesman Problem Traveling salesman problem is NP-hard. The time to find the optimal solution is exponential. Application of the GA can reduce the time to polynomial, but do not guarantee that the optimal solution will be found. Example: Genetic Algorithm for TSP.Genetic Algorithm for TSP
14
14 Summary Improvements by crossing over Random mutation to avoid stucking in local min/max Widely used
15
15 Questions
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.