1 / 33

GENETIC ALGORITHM

GENETIC ALGORITHM. General Introduction to GAs. Genetic algorithms (GAs) are a technique to solve problems which need optimization. GAs are a subclass of Evolutionary Computing and are random search algorithms. GAs are based on Darwin’s theory of evolution.

rachel
Télécharger la présentation

GENETIC ALGORITHM

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 ALGORITHM

  2. General Introduction to GAs • Genetic algorithms (GAs) are a technique to solve problems which need optimization. • GAs are a subclass of Evolutionary Computing and are random search algorithms. • GAs are based on Darwin’s theory of evolution. • i.e fundamental principle of natural selection(Which • states “Survival of Fittest”). • History of GAs: • Evolutionary computing evolved in the 1960s. • GAs were created by John Holland in the mid-1970s.

  3. Biological Background (1) – The Cell • Every cell is a complex of many small “factories” • working together. • The center of this all is the cell nucleus. • The nucleus contains the genetic information.

  4. Biological Background (2) – Chromosomes • Genetic information is stored in the chromosomes. • Each chromosome is build of DNA(Deoxyribonucleic acid, a self-replicating material present in nearly all living organisms as the main constituent of chromosomes). • Chromosomes in humans form pairs. • There are 23 pairs. • The chromosome is divided in parts: genes. • Genes code for properties. • The posibilities of the genes for one property is called: allele. • Every gene has an unique position on the chromosome: locus.

  5. Biological Background (3) – Genetics • The entire combination of genes is called genotype. • A genotype develops into a phenotype. • Dominant genes will always express from the genotype to the fenotype. • Recessive genes can survive in the population for many generations without being expressed.

  6. Biological Background (4) – Reproduction • Reproduction of genetical information: • Mitosis, • Meiosis. • Mitosis is copying the same genetic information to new offspring: there is no exchange of information. • Mitosis is the normal way of growing of multicell structures, like organs.

  7. Biological Background (5) – Reproduction • Meiosis is the basis of reproduction. • After meiotic division 2 gametes appear in the process. • In reproduction two gametes conjugate to a zygote wich will become the new individual. • Hence genetic information is shared between the parents in order to create new offspring.

  8. Biological Background (6) – Natural Selection • The origin of species: “Preservation of favorable variations and rejection of unfavorable variations.” • There are more individuals born than can survive, so there is a continuous struggle for life. • Individuals with an advantage have a greater chance for survive: survival of the fittest. For example, Giraffes with long necks. • Genetic variations due to crossover and mutation.

  9. Genetic Algorithm (1) – Search Space • Most often one is looking for the best solution in a specific subset of solutions. • This subset is called the search space (or state space). • Every point in the search space is a possible solution. • Therefore every point has a fitness value, depending on the problem definition. • GAs are used to search the search space for the best solution, e.g. a minimum. • Difficulties are the local minima and the starting point of the search.

  10. GeneticAlgorithm (2) – Basic Algorithm • Starting with a subset of n randomly chosen solutions from the search space (i.e. chromosomes). • This is the population. • This population is used to produce a next generation of individuals by reproduction. • Individuals with a higher fitness have more chance to reproduce (i.e. natural selection).

  11. Comparison of Natural and GA Terminology

  12. Genetic Algorithm (3) – Basic Algorithm • Outline of the basic algorithm • 0 START : Create random population of n chromosomes • 1 FITNESS : Evaluate fitness f(x) of each chromosome in the population • 2 NEW POPULATION • 1 REPRODUCTION/SELECTION : Based on f(x) • 2 CROSS OVER : Cross-over chromosomes • 3 MUTATION : Mutate chromosomes • 3 REPLACE : Replace old with new population: the new generation • 4 TEST : Test problem criterium • 5 LOOP : Continue step 1 – 4 untill criterium is satisfied

  13. All individuals in population • evaluated by fitness function. • Individuals allowed to • reproduce (selection), • crossover, mutate. Flowchart of GA

  14. GeneticAlgorithm – Reproduction Cycle • Select parents for the mating pool • (size of mating pool = population size). • Shuffle the mating pool. • For each consecutive pair apply crossover. • For each offspring apply mutation (bit-flip independently for each bit). • Replace the whole population with the resulting offspring.

  15. Genetic Algorithm – Encoding • Encoding is the process of representing individual genes. • The process can be performed using bits,numbers,trees, arrays. • Encoding depends on solving the problem. • Types of Encoding: • 1. Binary Encoding • The most common way of encoding is a binary string. • Each chromosome encodes a binary (bit) string. • Each bit in the string can represent some characterstics of the solution. • Every bit string is the solution but not necessarily the best solution.

  16. Binary Encoding 2. Octal Encoding This encoding uses the string made up of octal numbers (0-7). 3. Hexadecimal Encoding This encoding uses the string made up of hexadecimal numbers(0-9,A-F)

  17. 4. Permutation Encoding(Real Numer Encoding) Every chromosome is a string of numbers represented in a sequence. 5. Value Encoding Every chromosome is a atring of values and the values can be anything connected to the problem.

  18. Genetic Algorithm – Selection • Selection is the process of choosing two parents from the population for crossing. • After deciding on an encoding the next step is to decide how to perform selection that will create new offspring for the next generation. • The purpose of selection is to emphasize fitter individual in the population in hopes that their offspring have higher fitness. • Higher the fitness function the better chance that an individual will be selected. • Broadly two types of selection scheme: • Proportionate based selection. • Ordinal based selection. Picks out individual based on their fitness relative to other individuals Picks out individual based on their rank within the population

  19. Genetic Algorithm – Selection • Selection has to be balanced with variation from crossover and mutation. • Too strong selection means fit individuals will take over the population. • Too weak selection will result in too slow evolution. • The various selection method are discussed: • Roulette Wheel Selection. • Random selection-Randomly selects parent from population. • Rank Selection • Tournament Selection. • Boltzman selection

  20. Roulette Wheel Selection. • The principle of roulett wheel is a linear search through a roulett wheel with the slots in the wheel weighted in proportion to the individual fitness value. • A target value is set , the population is stepped through untill the target value is achieved. • The wheel spuns N times where n is the number of individual in the population . • On each spin the individual under the wheels marker is selected to be in the pool of parents for the next generation.

  21. Rank Selection. • Rank selection ranks the population and every chromosome recieves fitness from the ranking. • The worst has fitness 1 and the best has fitness N. • Tournament Selection. • The best individual from the tournament is the one with the highest fitness , who is the winner of competition among Nu individuals. • The are then inserted into the mating pool . • The tournament is repeated untill the mating pool for generating new offspring is filled. • The mating pool comprising tournament winner has higher average population fitness

  22. Genetic Algorithm – Crossover (Single Point) • Crossover is the process of taking two parent solution and producing from them a child. • After the selection population is enriched with better individuals. • Crossover operator applied over mating pool with the hope that it creates better offspring. • It proceeds in three steps: • The reproduction operator selects at random a pair of two individual string. • A cross site is selected. • Finally position value are swapped between the two string following the cross site.

  23. Genetic Algorithm – Crossover (Single Point) • In a single point crossover cross site is selected at random and bit next to cross sites are exchanged. • Choose a random point on the two parents. • Split parents at this crossover point. • Create children by exchanging tails.

  24. Genetic Algorithm – Crossover (Two Point) • In two point crossover two cross over points are chosen and the content between these points are exchanged between two mated parents.

  25. Genetic Algorithm – Uniform Crossover • A random generated binary crossover mask of the same length as the chromosome. • On producing child 1 Where there is 1 in mask the gene is copied from the first parent, and where there is 0 in mask the gene is copied from the second parent, and for producing child 2 when there is 1 in mask the gene is copied from parent 2 and when 0 gene is copied from parent 1.

  26. Genetic Algorithm – Three Parent Crossover • In this crossover technique three parents are randomly chosen. • Each bit of the first parent is compared with the bit of the second parent. if both are same the bit is taken for the offspring otherwise bit from third parent is taken for the offspring.

  27. Genetic Algorithm – Mutation • Mutation plays the role of recovering the lost genetic material as well as randomly distributing genetic information. • It is an insurance policy against the irreversible loss of genetic material. • Mutation introduces new genetic structure in the population by randomly modifying some of its(genetic) building block. • Flipping • flipping of bit involves changing 0 to 1 and 1 to 0 based on mutation chromosome. For a 1 in mutation chromosome the corresponding bit in a parent chromosome is flipped (0 to 1 and 1 to 0)

  28. Genetic Algorithm –Interchanging • Two random position of bit are chosen and the bits corresponding to those position are interchanged. Reversing : A random position is chosen and the bits next to that position are reversed and child chromosome is produced.

  29. Simple Genetic Algorithm • Has been subject of many (early) studies • still often used as benchmark for novel Gas. • Shows many shortcomings, e.g. • Representation is too restrictive. • Mutation & crossovers only applicable for bit-string & integer representations. • Selection mechanism sensitive for converging populations with close fitness values.

  30. Comparison of GA with Traditional Optimization Techniques • GA works with the coding of solution set and not with the solution itself. • GA uses population of solutions rather than a single solution for searching. • GA uses fitness function for evaluation rather the derivatives. • GA uses probabilistic transition and not deterministic rules.

  31. References • Holland, J. (1992), Adaptation in natural and artificial systems , 2nd Ed. Cambridge: MIT Press. • Davis, L. (Ed.) (1991), Handbook of genetic algorithms. New York: Van Nostrand Reinhold. • Goldberg, D. (1989), Genetic algorithms in search, optimization and machine learning. Addison-Wesley. • Fogel, D. (1995), Evolutionary computation: Towards a new philosophy of machine intelligence. Piscataway: IEEE Press. • Bäck, T., Hammel, U., and Schwefel, H. (1997), ‘Evolutionary computation: Comments on the history and the current state’, IEEE Trans. On Evol. Comp. 1, (1)

  32. Online Resources • http://www.spectroscopynow.com • http://www.cs.bris.ac.uk/~colin/evollect1/evollect0/index.htm\ • IlliGAL (http://www-illigal.ge.uiuc.edu/index.php3) • GAlib (http://lancet.mit.edu/ga/)

More Related