 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 1Lecture 9Lecture 9Evolutionary Computation:Ev...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 2II Intelligence can be defined as the capabil...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 3II The behaviour ofThe behaviour of an indivi...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 4II On 1 July 1858,On 1 July 1858, Charles Dar...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 5II NeoNeo--DarwinismDarwinism is based on pro...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 6II Evolution can be seen as a process leading...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 7How is a population with increasingHow is a p...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 8II All methods of evolutionary computation si...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 9II In the early 1970s, JohnIn the early 1970s...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 10II Nature has an ability to adapt and learn ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 11Step 1Step 1:: Represent the problem variabl...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 12Step 3Step 3:: Randomly generate an initial ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 13Step 6Step 6:: Create a pair of offspring ch...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 14II GA represents an iterative process. Each ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 15A simple example will help us to understand ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 16Suppose that the size of the chromosome popu...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 17The fitness function and chromosome location...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 18II In natural selection, only the fittest sp...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 19RouletteRoulette wheelwheel selectionselecti...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 20Crossover operatorCrossover operatorII In ou...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 21II First, the crossover operator randomly ch...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 22X6i 1 00 0 01 0 X2i0 01 0X2i 0 11 1 X5i0X1i ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 23II Mutation represents a change inMutation r...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 24MutationMutation0 11 1X5i 01 0X6i 1 000 01 0...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 25TheThe genetic algorithm cyclegenetic algori...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 26GeneticGenetic algorithmsalgorithms:: caseca...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 27II We also chooseWe also choose the size of ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 28II Now the range of integers that can be han...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 29II Using decoded values ofUsing decoded valu...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 30Chromosome locations on the surface of theCh...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 31Chromosome locations on the surface of theCh...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 32Chromosome locations on the surface of theCh...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 33Chromosome locations on the surface of theCh...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 34Performance graphs for 100 generations of 6P...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 35Performance graphs for 100 generations of 6P...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 36pc = 0.7, pm = 0.001BestAverage20G e n e r a...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 37CaseCase studystudy:: maintenancemaintenance...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 38Steps in the GA developmentSteps in the GA d...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 39CaseCase studystudyScheduling of 7 units in ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 40CaseCase studystudyUnit data and maintenance...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 41CaseCase studystudyUnit gene poolsUnit gene ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 42CaseCase studystudyThe crossover operatorThe...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 43CaseCase studystudyThe mutation operatorThe ...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 44PerformancePerformance graphs and the best m...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 45PerformancePerformance graphs and the best m...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 46PerformancePerformance graphs and the best m...
 Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 47PerformancePerformance graphs and the best m...
Upcoming SlideShare
Loading in …5
×

2013-1 Machine Learning Lecture 07 - Michael Negnevitsky - Evolutionary Co…

561 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
561
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
32
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

2013-1 Machine Learning Lecture 07 - Michael Negnevitsky - Evolutionary Co…

  1. 1.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 1Lecture 9Lecture 9Evolutionary Computation:Evolutionary Computation:Genetic algorithmsGenetic algorithmsII Introduction, orIntroduction, or cancan evolutionevolution bebeintelligentintelligent??II Simulation ofSimulation of naturalnatural evolutionevolutionII GeneticGenetic algorithmsalgorithmsII CaseCase studystudy:: maintenancemaintenance schedulingscheduling withwithgeneticgenetic algorithmsalgorithmsII SummarySummary
  2. 2.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 2II Intelligence can be defined as the capability of aIntelligence can be defined as the capability of asystem to adapt its behaviour to eversystem to adapt its behaviour to ever--changingchangingenvironment. According to Alan Turing, the formenvironment. According to Alan Turing, the formor appearance of a system is irrelevant to itsor appearance of a system is irrelevant to itsintelligence.intelligence.II Evolutionary computation simulates evolution on aEvolutionary computation simulates evolution on acomputer. The result of such a simulation is acomputer. The result of such a simulation is aseries of optimisation algorithmsseries of optimisation algorithms, usually based on, usually based ona simple set of rules. Optimisationa simple set of rules. Optimisation iterativelyiterativelyimproves the quality of solutions until an optimal,improves the quality of solutions until an optimal,or at least feasible, solution is found.or at least feasible, solution is found.Can evolution be intelligentCan evolution be intelligent??
  3. 3.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 3II The behaviour ofThe behaviour of an individual organisman individual organism isis ananinductive inference about some yet unknowninductive inference about some yet unknownaspects of its environment.aspects of its environment. If,If, over successiveover successivegenerations, the organism survives, we can saygenerations, the organism survives, we can saythat this organism is capable of learning to predictthat this organism is capable of learning to predictchanges in its environment.changes in its environment.II The evolutionary approach is based onThe evolutionary approach is based oncomputational models of natural selection andcomputational models of natural selection andgenetics. We call themgenetics. We call them evolutionaryevolutionarycomputationcomputation, an umbrella term that combines, an umbrella term that combinesgenetic algorithmsgenetic algorithms,, evolution strategiesevolution strategies andandgenetic programminggenetic programming..
  4. 4.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 4II On 1 July 1858,On 1 July 1858, Charles DarwinCharles Darwin presented hispresented histheory of evolution before thetheory of evolution before the LinneanLinnean Society ofSociety ofLondon. This day marks the beginning of aLondon. This day marks the beginning of arevolution in biology.revolution in biology.II DarwinDarwin’’ss classicalclassical theory of evolutiontheory of evolution, together, togetherwithwith WeismannWeismann’’ss theory of natural selectiontheory of natural selection andandMendelMendel’’ss concept ofconcept of geneticsgenetics, now represent the, now represent theneoneo--Darwinian paradigm.Darwinian paradigm.Simulation ofSimulation of naturalnatural evolutionevolution
  5. 5.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 5II NeoNeo--DarwinismDarwinism is based on processes ofis based on processes ofreproduction, mutation, competition and selection.reproduction, mutation, competition and selection.The power to reproduce appears to be an essentialThe power to reproduce appears to be an essentialproperty of life. The power to mutate is alsoproperty of life. The power to mutate is alsoguaranteed in any living organism that reproducesguaranteed in any living organism that reproducesitself in a continuously changing environment.itself in a continuously changing environment.Processes of competition and selection normallyProcesses of competition and selection normallytake place in the natural world, where expandingtake place in the natural world, where expandingpopulations of different species are limited by apopulations of different species are limited by afinite space.finite space.
  6. 6.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 6II Evolution can be seen as a process leading to theEvolution can be seen as a process leading to themaintenancemaintenance of a populationof a population’’ss ability to surviveability to surviveand reproduce in a specific environment. Thisand reproduce in a specific environment. Thisability is calledability is called evolutionary fitnessevolutionary fitness..II Evolutionary fitness can also be viewed as aEvolutionary fitness can also be viewed as ameasure of the organismmeasure of the organism’’s ability to anticipates ability to anticipatechanges in its environment.changes in its environment.II TheThe fitness, or the quantitative measure of thefitness, or the quantitative measure of theability to predict environmental changes andability to predict environmental changes andrespond adequately, can be considered as therespond adequately, can be considered as thequality that isquality that is optimisedoptimised in natural life.in natural life.
  7. 7.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 7How is a population with increasingHow is a population with increasingfitness generated?fitness generated?II Let us considerLet us consider a population of rabbits. Somea population of rabbits. Somerabbits are faster than others, and we may say thatrabbits are faster than others, and we may say thatthese rabbits possess superior fitness, because theythese rabbits possess superior fitness, because theyhave a greater chance of avoiding foxes, survivinghave a greater chance of avoiding foxes, survivingand then breedingand then breeding..II If two parents have superior fitness, there is a goodIf two parents have superior fitness, there is a goodchance that a combination of their genes willchance that a combination of their genes willproduce an offspring with even higher fitness.produce an offspring with even higher fitness.Over time the entire population of rabbits becomesOver time the entire population of rabbits becomesfaster to meet their environmental challenges in thefaster to meet their environmental challenges in theface of foxes.face of foxes.
  8. 8.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 8II All methods of evolutionary computation simulateAll methods of evolutionary computation simulatenaturalnatural evolution by creatingevolution by creating a population ofa population ofindividuals, evaluating their fitness, generating aindividuals, evaluating their fitness, generating anew population through genetic operations, andnew population through genetic operations, andrepeating this process a number of timesrepeating this process a number of times..II We will start withWe will start with Genetic AlgorithmsGenetic Algorithms (GAs) as(GAs) asmost of the other evolutionarymost of the other evolutionary algorithms can bealgorithms can beviewed as variations ofviewed as variations of genetic algorithmsgenetic algorithms..Simulation ofSimulation of naturalnatural evolutionevolution
  9. 9.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 9II In the early 1970s, JohnIn the early 1970s, John Holland introduced theHolland introduced theconcept of genetic algorithms.concept of genetic algorithms.II HisHis aim was to make computers do what natureaim was to make computers do what naturedoes.does. Holland was concerned withHolland was concerned with algorithmsalgorithmsthat manipulate strings of binary digitsthat manipulate strings of binary digits..II Each artificialEach artificial ““chromosomeschromosomes”” consists of aconsists of anumber ofnumber of ““genesgenes””, and each gene is represented, and each gene is representedby 0 or 1:by 0 or 1:Genetic AlgorithmsGenetic Algorithms1 10 1 0 1 0 0 0 0 0 1 0 1 10
  10. 10.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 10II Nature has an ability to adapt and learn withoutNature has an ability to adapt and learn withoutbeing told what to do. In other words, naturebeing told what to do. In other words, naturefinds good chromosomes blindly.finds good chromosomes blindly. GAsGAs do thedo thesame. Two mechanisms link a GA to the problemsame. Two mechanisms link a GA to the problemit is solving:it is solving: encodingencoding andand evaluationevaluation..II The GA uses a measure of fitness of individualThe GA uses a measure of fitness of individualchromosomes to carry out reproduction. Aschromosomes to carry out reproduction. Asreproduction takes place, the crossover operatorreproduction takes place, the crossover operatorexchanges parts of two single chromosomes, andexchanges parts of two single chromosomes, andthe mutation operator changes the gene value inthe mutation operator changes the gene value insome randomly chosen location of thesome randomly chosen location of thechromosome.chromosome.
  11. 11.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 11Step 1Step 1:: Represent the problem variable domain asRepresent the problem variable domain asa chromosome of a fixed length, choose the sizea chromosome of a fixed length, choose the sizeof a chromosome populationof a chromosome population NN, the crossover, the crossoverprobabilityprobability ppcc and the mutation probabilityand the mutation probability ppmm..StepStep 22:: DefineDefine a fitness function to measure thea fitness function to measure theperformance, or fitness, of an individualperformance, or fitness, of an individualchromosome in the problem domain. The fitnesschromosome in the problem domain. The fitnessfunction establishes the basis for selectingfunction establishes the basis for selectingchromosomes that will be mated duringchromosomes that will be mated duringreproduction.reproduction.BasicBasic geneticgenetic algorithmsalgorithms
  12. 12.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 12Step 3Step 3:: Randomly generate an initial population ofRandomly generate an initial population ofchromosomes of sizechromosomes of size NN::xx11,, xx22, . . . ,, . . . , xxNNStep 4Step 4:: Calculate the fitness of each individualCalculate the fitness of each individualchromosome:chromosome:ff ((xx11),), ff ((xx22), . . . ,), . . . , ff ((xxNN))Step 5Step 5:: Select a pair of chromosomes for matingSelect a pair of chromosomes for matingfrom the current population. Parentfrom the current population. Parentchromosomes are selected with a probabilitychromosomes are selected with a probabilityrelated to their fitness.related to their fitness.
  13. 13.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 13Step 6Step 6:: Create a pair of offspring chromosomes byCreate a pair of offspring chromosomes byapplying the genetic operatorsapplying the genetic operators −− crossovercrossover andandmutationmutation..Step 7Step 7:: Place the created offspring chromosomesPlace the created offspring chromosomesin the new population.in the new population.Step 8Step 8:: RepeatRepeat Step 5Step 5 until the size of the newuntil the size of the newchromosome population becomeschromosome population becomes equal to theequal to thesize of thesize of the initial population,initial population, NN..Step 9Step 9:: ReplaceReplace the initial (parent) chromosomethe initial (parent) chromosomepopulation with the new (offspring) population.population with the new (offspring) population.StepStep 1010:: Go toGo to Step 4Step 4, and repeat the process until, and repeat the process untilthe termination criterion is satisfied.the termination criterion is satisfied.
  14. 14.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 14II GA represents an iterative process. Each iteration isGA represents an iterative process. Each iteration iscalled acalled a generationgeneration. A typical number of generations. A typical number of generationsfor a simple GA can range from 50 to overfor a simple GA can range from 50 to over 500. The500. Theentire setentire set of generations is called aof generations is called a runrun..II Because GAs use a stochastic search method, theBecause GAs use a stochastic search method, thefitness of a population mayfitness of a population may remain stable for aremain stable for anumber of generations before a superior chromosomenumber of generations before a superior chromosomeappears.appears.II A common practice is to terminate a GA after aA common practice is to terminate a GA after aspecified number of generations and then examinespecified number of generations and then examinethe best chromosomes in the population. If nothe best chromosomes in the population. If nosatisfactory solution is found, the GA is restarted.satisfactory solution is found, the GA is restarted.GeneticGenetic algorithmsalgorithms
  15. 15.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 15A simple example will help us to understand howA simple example will help us to understand howa GA works. Let us find the maximum value ofa GA works. Let us find the maximum value ofthe function (15the function (15xx −− xx22) where parameter) where parameter xx variesvariesbetween 0 and 15. For simplicity, we maybetween 0 and 15. For simplicity, we mayassume thatassume that xx takes only integer values. Thus,takes only integer values. Thus,chromosomes can be built with only fourchromosomes can be built with only four genes:genes:GeneticGenetic algorithmsalgorithms:: casecase studystudyInteger Binary code Integer Binary code Integer Binary code1 0 0 0 1 6 0 1 1 0 11 1 0 1 12 0 0 1 0 7 0 1 1 1 12 1 1 0 03 0 0 1 1 8 1 0 0 0 13 1 1 0 14 0 1 0 0 9 1 0 0 1 14 1 1 1 05 0 1 0 1 10 1 0 1 0 15 1 1 1 1
  16. 16.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 16Suppose that the size of the chromosome populationSuppose that the size of the chromosome populationNN is 6, the crossover probabilityis 6, the crossover probability ppcc equals 0.7, andequals 0.7, andthe mutation probabilitythe mutation probability ppmm equals 0.001. Theequals 0.001. Thefitness function in our example is definedfitness function in our example is defined bybyff((xx) =) = 1515 xx −−−−−−−− xx22
  17. 17.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 17The fitness function and chromosome locationsThe fitness function and chromosome locationsChromosomelabelChromosomestringDecodedintegerChromosomefitnessFitnessratio, %X1 1 1 0 0 12 36 16.5X2 0 1 0 0 4 44 20.2X3 0 0 0 1 1 14 6.4X4 1 1 1 0 14 14 6.4X5 0 1 1 1 7 56 25.7X6 1 0 0 1 9 54 24.8x50403020601000 5 10 15f(x)(a) Chromosome initial locations.x50403020601000 5 10 15(b) Chromosome final locations.
  18. 18.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 18II In natural selection, only the fittest species canIn natural selection, only the fittest species cansurvive, breed, and thereby pass their genes on tosurvive, breed, and thereby pass their genes on tothe next generation.the next generation. GAsGAs use a similar approach,use a similar approach,but unlike nature, the size of the chromosomebut unlike nature, the size of the chromosomepopulation remains unchanged from onepopulation remains unchanged from onegeneration to the next.generation to the next.II The last column in Table shows the ratio of theThe last column in Table shows the ratio of theindividual chromosomeindividual chromosome’’s fitness to thes fitness to thepopulationpopulation’’s total fitness. This ratio determiness total fitness. This ratio determinesthe chromosomethe chromosome’’s chance of being selected fors chance of being selected formating.mating. The chromosomeThe chromosome’’s average fitnesss average fitnessimproves from one generation to the next.improves from one generation to the next.
  19. 19.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 19RouletteRoulette wheelwheel selectionselectionThe most commonly used chromosome selectionThe most commonly used chromosome selectiontechniques is thetechniques is the roulette wheel selectionroulette wheel selection..100 016.536.743.149.575.2X1: 16.5%X2: 20.2%X3: 6.4%X4: 6.4%X5: 25.3%X6: 24.8%
  20. 20.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 20Crossover operatorCrossover operatorII In our example, we have an initial population of 6In our example, we have an initial population of 6chromosomes. Thus, to establish the samechromosomes. Thus, to establish the samepopulation in the next generation, the roulettepopulation in the next generation, the roulettewheel would be spun six timeswheel would be spun six times..II Once a pair of parent chromosomes is selected,Once a pair of parent chromosomes is selected,thethe crossovercrossover operator is applied.operator is applied.
  21. 21.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 21II First, the crossover operator randomly chooses aFirst, the crossover operator randomly chooses acrossover point where two parent chromosomescrossover point where two parent chromosomes““breakbreak””, and then exchanges the chromosome, and then exchanges the chromosomeparts after that point. As a result, two newparts after that point. As a result, two newoffspring are created.offspring are created.II If a pair of chromosomes does not cross over,If a pair of chromosomes does not cross over,thenthen the chromosome cloning takes place, and thethe chromosome cloning takes place, and theoffspring are created as exact copies of eachoffspring are created as exact copies of eachparent.parent.
  22. 22.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 22X6i 1 00 0 01 0 X2i0 01 0X2i 0 11 1 X5i0X1i 0 11 1 X5i1 01 00 10 011 101 0CrossoverCrossover
  23. 23.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 23II Mutation represents a change inMutation represents a change in the gene.the gene.II Mutation is a background operator. Its role is toMutation is a background operator. Its role is toprovide a guarantee thatprovide a guarantee that the search algorithm isthe search algorithm isnot trapped on a local optimum.not trapped on a local optimum.II The mutation operator flips a randomly selectedThe mutation operator flips a randomly selectedgene in a chromosome.gene in a chromosome.II The mutation probability is quite small in nature,The mutation probability is quite small in nature,and is kept low forand is kept low for GAsGAs, typically in the range, typically in the rangebetween 0.001 and 0.01.between 0.001 and 0.01.Mutation operatorMutation operator
  24. 24.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 24MutationMutation0 11 1X5i 01 0X6i 1 000 01 0X2i 0 10 00 1 111X5i1 1 1 X1"i1 1X2"i0 1 00X1i 1 1 10 1 0X2i
  25. 25.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 25TheThe genetic algorithm cyclegenetic algorithm cycle1 01 0X1iGeneration i0 01 0X2i0 00 1X3i1 11 0X4i0 11 1X5i f = 561 00 1X6i f = 54f = 36f = 44f = 14f = 141 00 0X1i+1Generation (i + 1)0 01 1X2i+11 10 1X3i+10 01 0X4i+10 11 0X5i+1 f = 540 11 1X6i+1 f = 56f = 56f = 50f = 44f = 44CrossoverX6i 1 00 0 01 0 X2i0 01 0X2i 0 11 1 X5i0X1i 0 11 1 X5i1 01 00 10 011 101 0Mutation0 11 1X5i 01 0X6i 1 000 01 0X2i 0 10 00 1 111X5i1 1 1 X1"i1 1X2"i0 1 00X1i 1 1 10 1 0X2i
  26. 26.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 26GeneticGenetic algorithmsalgorithms:: casecase studystudyII Suppose it is desired to find the maximum of theSuppose it is desired to find the maximum of the““peakpeak”” function of two variables:function of two variables:where parameterswhere parameters xx andand yy vary betweenvary between −−3 and 3.3 and 3.II The first step is to represent the problem variablesThe first step is to represent the problem variablesas aas a chromosomechromosome −− parametersparameters xx andand yy as aas aconcatenated binary string:concatenated binary string:2222)()1(),( 33)1(2 yxyxeyxxexyxf −−+−−−−−−=1 00 0 1 10 0 0 10 1 1 10 1yx
  27. 27.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 27II We also chooseWe also choose the size of the chromosomethe size of the chromosomepopulation, for instance 6, and randomly generatepopulation, for instance 6, and randomly generatean initial population.an initial population.II The next step is to calculate the fitness of eachThe next step is to calculate the fitness of eachchromosome. This is done in two stages.chromosome. This is done in two stages.II First, a chromosome, that is a string of 16 bits, isFirst, a chromosome, that is a string of 16 bits, ispartitioned into two 8partitioned into two 8--bit strings:bit strings:10012345672 )138(2021202120202021)10001010( =×+×+×+×+×+×+×+×=and10012345672 )59(2121202121212020)00111011( =×+×+×+×+×+×+×+×=II Then these strings are converted from binaryThen these strings are converted from binary(base 2) to decimal (base 10):(base 2) to decimal (base 10):1 00 0 1 10 0 0 10 1 1 10 1and
  28. 28.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 28II Now the range of integers that can be handled byNow the range of integers that can be handled by88--bits, that is the range from 0 to (2bits, that is the range from 0 to (288−− 1), is1), ismapped to the actual range of parametersmapped to the actual range of parameters xx andand yy,,that is the range fromthat is the range from −−3 to 3:3 to 3:II ToTo obtain the actual values ofobtain the actual values of xx andand yy, we multiply, we multiplytheir decimal values by 0.0235294 and subtract 3their decimal values by 0.0235294 and subtract 3from the results:from the results:0235294.012566=−2470588.030235294.0)138( 10 =−×=xand6117647.130235294.0)59( 10 −=−×=y
  29. 29.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 29II Using decoded values ofUsing decoded values of xx andand yy as inputs in theas inputs in themathematical function, the GA calculates themathematical function, the GA calculates thefitness of each chromosome.fitness of each chromosome.II ToTo find the maximum of thefind the maximum of the ““peakpeak”” function, wefunction, wewill use crossover with the probability equal to 0.7will use crossover with the probability equal to 0.7and mutation with the probability equal to 0.001.and mutation with the probability equal to 0.001.As we mentioned earlier, a common practice inAs we mentioned earlier, a common practice inGAsGAs is to specify the number of generations.is to specify the number of generations.Suppose the desired number of generations is 100.Suppose the desired number of generations is 100.That is, the GA will create 100 generations of 6That is, the GA will create 100 generations of 6chromosomes before stopping.chromosomes before stopping.
  30. 30.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 30Chromosome locations on the surface of theChromosome locations on the surface of the““peakpeak”” function: initial populationfunction: initial population
  31. 31.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 31Chromosome locations on the surface of theChromosome locations on the surface of the““peakpeak”” function: first generationfunction: first generation
  32. 32.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 32Chromosome locations on the surface of theChromosome locations on the surface of the““peakpeak”” function: local maximumfunction: local maximum
  33. 33.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 33Chromosome locations on the surface of theChromosome locations on the surface of the““peakpeak”” function: global maximumfunction: global maximum
  34. 34.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 34Performance graphs for 100 generations of 6Performance graphs for 100 generations of 6chromosomeschromosomes:: local maximumlocal maximumpc = 0.7, pm = 0.001G e n e r a t i o n sBestAverage80 90 10060 7040 5020 30100-0.10.50.60.7Fitness00.10.20.30.4
  35. 35.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 35Performance graphs for 100 generations of 6Performance graphs for 100 generations of 6chromosomeschromosomes:: global maximumglobal maximumBestAverage100G e n e r a t i o n s80 9060 7040 5020 3010pc = 0.7, pm = 0.011.8Fitness00.20.40.60.81.01.21.41.6
  36. 36.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 36pc = 0.7, pm = 0.001BestAverage20G e n e r a t i o n s16 1812 148 104 620Fitness0.20.40.60.81.01.21.41.61.8Performance graphs forPerformance graphs for 2020 generations ofgenerations of6060 chromosomeschromosomes
  37. 37.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 37CaseCase studystudy:: maintenancemaintenance schedulingschedulingII Maintenance scheduling problems are usuallyMaintenance scheduling problems are usuallysolved using a combination of search techniquessolved using a combination of search techniquesandand heuristics.heuristics.II These problems are complex and difficult toThese problems are complex and difficult tosolve.solve.II They are NPThey are NP--complete and cannot be solved bycomplete and cannot be solved bycombinatorial searchcombinatorial search techniques.techniques.II Scheduling involves competition for limitedScheduling involves competition for limitedresources, and is complicated by a great numberresources, and is complicated by a great numberof badly formalised constraints.of badly formalised constraints.
  38. 38.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 38Steps in the GA developmentSteps in the GA development1. Specify1. Specify the problem, define constraintsthe problem, define constraints andandoptimumoptimum criteria;criteria;22. Represent. Represent the problem domain asthe problem domain as aachromosomechromosome;;3.3. DefineDefine a fitness function to evaluate thea fitness function to evaluate thechromosomechromosome performance;performance;4. Construct4. Construct the geneticthe genetic operators;operators;5. Run5. Run the GA and tune itsthe GA and tune its parameters.parameters.
  39. 39.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 39CaseCase studystudyScheduling of 7 units in 4 equal intervalsScheduling of 7 units in 4 equal intervalsThe problem constraints:The problem constraints:II The maximum loads expected during four intervals areThe maximum loads expected during four intervals are80, 90, 65 and 70 MW;80, 90, 65 and 70 MW;II Maintenance of any unit starts at the beginning of anMaintenance of any unit starts at the beginning of aninterval and finishes at the end of the same or adjacentinterval and finishes at the end of the same or adjacentinterval. The maintenance cannot be aborted or finishedinterval. The maintenance cannot be aborted or finishedearlier than scheduled;earlier than scheduled;II The net reserve of the power system must be greater orThe net reserve of the power system must be greater orequal to zero at any interval.equal to zero at any interval.The optimum criterion is the maximum of the netThe optimum criterion is the maximum of the netreserve at any maintenance period.reserve at any maintenance period.
  40. 40.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 40CaseCase studystudyUnit data and maintenance requirementsUnit data and maintenance requirementsUnitnumberUnit capacity,MWNumber of intervals requiredfor unit maintenance1 20 22 15 23 35 14 40 15 15 16 15 17 10 1
  41. 41.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 41CaseCase studystudyUnit gene poolsUnit gene poolsUnit 1: 1 01 0 0 11 0 0 10 1Unit 2: 1 01 0 0 11 0 0 10 1Unit 3: 1 00 0 0 01 0 0 10 0 0 00 1Unit 4: 1 00 0 0 01 0 0 10 0 0 00 1Unit 5: 1 00 0 0 01 0 0 10 0 0 00 1Unit 6: 1 00 0 0 01 0 0 10 0 0 00 1Unit 7: 1 00 0 0 01 0 0 10 0 0 00 1Chromosome for the scheduling problemChromosome for the scheduling problem0 11 0 0 10 1 0 00 1 1 00 0 0 01 0 0 10 0 1 00 0Unit 1 Unit 3Unit 2 Unit 4 Unit 6Unit 5 Unit 7
  42. 42.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 42CaseCase studystudyThe crossover operatorThe crossover operator0 11 0 0 10 1 0 00 1 1 00 0 0 01 0 0 10 0 1 00 0Parent 11 01 0 0 11 0 0 01 0 0 00 1 0 10 0 1 00 0 0 01 0Parent 20 11 0 0 10 1 0 00 1 1 00 0 0 10 0 1 00 0 0 01 0Child 11 01 0 0 11 0 0 01 0 0 00 1 0 01 0 0 10 0 1 00 0Child 2
  43. 43.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 43CaseCase studystudyThe mutation operatorThe mutation operator1 01 0 0 11 0 0 01 0 0 00 1 0 01 0 0 10 0 1 00 00 01 01 01 0 0 11 0 0 01 0 0 00 1 0 01 0 0 10 0 1 00 00 00 1
  44. 44.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 44PerformancePerformance graphs and the best maintenancegraphs and the best maintenanceschedules created in a population of 20 chromosomesschedules created in a population of 20 chromosomesG e n e r a t i o n s0306090120150Unit 2 Unit 2Unit 7Unit 1Unit 6Unit 1Unit 3Unit 5Unit 41 2 3 4T i m e i n t e r v a lMWN e t r e s e r v e s:15 35 35 25N = 20, pc = 0.7, pm = 0.001BestAverage5 15 25 3510 3020 40 45 50G e n e r a t i o n s0Fitness-10-5051015((aa) 50) 50 generationsgenerations
  45. 45.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 45PerformancePerformance graphs and the best maintenancegraphs and the best maintenanceschedules created in a population of 20 chromosomesschedules created in a population of 20 chromosomesG e n e r a t i o n s030601 2 3 4T i m e i n t e r v a lMWN e t r e s e r v e s :40 25 20 25Unit 2Unit 2Unit 7Unit 1Unit 6Unit 1Unit 3Unit 5Unit 490120150N = 20, pc = 0.7, pm = 0.001BestAverage10 30 50 70200 6040 80 90 100Fitness-1001020G e n e r a t i o n s((bb)) 100100 generationsgenerations
  46. 46.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 46PerformancePerformance graphs and the best maintenancegraphs and the best maintenanceschedules created in a population ofschedules created in a population of 100100 chromosomeschromosomes((aa)) Mutation rate is 0.001Mutation rate is 0.0011 2 3 4T i m e i n t e r v a l35 25 25 25Unit 2 Unit 2Unit 7Unit 1Unit 6Unit 1Unit 3Unit 5Unit 403060MW90120150N = 100, pc = 0.7, pm = 0.001G e n e r a t i o n sN e t r e s e r v e s :BestAverage10 30 50 70200 6040 80 90 100-10Fitness0102030
  47. 47.  Negnevitsky, Pearson Education, 2011Negnevitsky, Pearson Education, 2011 47PerformancePerformance graphs and the best maintenancegraphs and the best maintenanceschedules created in a population ofschedules created in a population of 100100 chromosomeschromosomes((bb)) Mutation rate is 0.01Mutation rate is 0.011 2 3 4T i m e i n t e r v a lN e t r e s e r v e s :25 25 30 30Unit 2Unit 2Unit 7Unit 6Unit 1Unit 3Unit 5Unit 403060MW90120150Unit 1N = 100, pc = 0.7, pm = 0.01G e n e r a t i o n s10 30 50 70200 6040 80 90 100BestAverageFitness-20-100103020

×