1 / 15

Genetic Algorithms

Genetic Algorithms. The Basic Genetic Algorithm. [Start] Generate random population of n chromosomes (suitable solutions for the problem) [Fitness] Evaluate the fitness f(x) of each chromosome x in the population

sheparda
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. Genetic Algorithms

  2. The Basic Genetic Algorithm • [Start] Generate random population of n chromosomes (suitable solutions for the problem) • [Fitness] Evaluate the fitness f(x) of each chromosome x in the population • [New population] Create a new population by repeating following steps until the new population is complete • [Selection] Select two parent chromosomes from a population according to their fitness (the better fitness, the bigger chance to be selected) • [Crossover] With a crossover probability cross over the parents to form new offspring (children). If no crossover was performed, offspring is the exact copy of parents. • [Mutation] With a mutation probability mutate new offspring at each locus (position in chromosome). • [Accepting] Place new offspring in the new population • [Replace] Use new generated population for a further run of the algorithm • [Test] If the end condition is satisfied, stop, and return the best solution in current population • [Loop] Go to step 2

  3. Basicprinciples 1 • Coding or Representation • String with all parameters • Fitness function • Parent selection • Reproduction • Crossover • Mutation • Convergence • When to stop

  4. Basicprinciples 2 • An individual is characterized by a set of parameters: Genes • The genes are joined into a string: Chromosome • The chromosome forms the genotype • The genotype contains all information to construct an organism: the phenotype • Reproduction is a “dumb” process on the chromosome of the genotype • Fitness is measured in the real world (‘struggle for life’) of the phenotype

  5. Initialize Population Evaluate Fitness Yes satisfy constraints ? No Randomly Vary Individuals Select Survivors Output Results Conceptual Algorithm

  6. Genetic Algorithm • Encoding • Fitness Evaluation • Reproduction • Survivor Selection

  7. Reproduction • Crossover • Two parents produce two offspring • There is a chance that the chromosomes of the two parents are copied unmodified as offspring • There is a chance that the chromosomes of the two parents are randomly recombined (crossover) to form offspring • Generally the chance of crossover is between 0.6 and 1.0 • Mutation • There is a chance that a gene of a child is changed randomly • Generally the chance of mutation is low (e.g. 0.001)

  8. One-point crossover • Randomly one position in the chromosomes is chosen • Child 1 is head of chromosome of parent 1 with tail of chromosome of parent 2 • Child 2 is head of 2 with tail of 1 Randomly chosen position Parents: 10100011100011010010 Offspring: 01010100100011001110

  9. Crossover • Choose a random point on the two parents • Split parents at this crossover point • Create children by exchanging tails • Pc typically in range (0.6, 0.9)

  10. Mutation • Alter each gene independently with a probability pm • pm is called the mutation rate • Typically between 1/pop_size and 1/ chromosome_length

  11. Algorithm BEGIN Generate initial population; Compute fitness of each individual; REPEAT /* New generation /* FOR population_size / DO Select two parents from old generation; /* biased to the fitter ones */ Recombine parents for two offspring; Compute fitness of offspring; Insert offspring in new generation END FOR UNTIL population has converged END

  12. Parent/Survivor Selection • Strategies:Survivor selection • Always keep the best one • Elitist: deletion of the K worst

  13. Worked Example

  14. After many random crossover-combination, we get the following generation: In a long terme process only sohn three will survive. Sohn 1 and 2 will be eliminate from the existence because of the nature conditions(fitness function)

  15. Conclusion • The genetic algorithms are very good techniques however the main obstacle is to encode problem, to define a good fitness function! • Demo TSM • AISteroid

More Related