Genetic-Algorithms(遺傳算法)課件

上傳人:文**** 文檔編號:240609144 上傳時間:2024-04-24 格式:PPT 頁數:64 大?。?68.50KB
收藏 版權申訴 舉報 下載
Genetic-Algorithms(遺傳算法)課件_第1頁
第1頁 / 共64頁
Genetic-Algorithms(遺傳算法)課件_第2頁
第2頁 / 共64頁
Genetic-Algorithms(遺傳算法)課件_第3頁
第3頁 / 共64頁
資源描述:

《Genetic-Algorithms(遺傳算法)課件》由會員分享,可在線閱讀,更多相關《Genetic-Algorithms(遺傳算法)課件(64頁珍藏版)》請在裝配圖網上搜索。

1、Genetic Algorithms Chapter 3A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsGA Quick OverviewlDeveloped:USA in the 1970slEarly names:J.Holland,K.DeJong,D.GoldberglTypically applied to:discrete optimizationlAttributed features:not too fastgood heuristic for combinatori

2、al problemslSpecial Features:Traditionally emphasizes combining information from good parents(crossover)many variants,e.g.,reproduction models,operatorsA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsGenetic algorithmslHollands original GA is now known as the simple g

3、enetic algorithm(SGA)lOther GAs use different:RepresentationsMutationsCrossoversSelection mechanismsA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSGA technical summary tableauRepresentationBinary stringsRecombinationN-point or uniformMutationBitwise bit-flipping wit

4、h fixed probabilityParent selectionFitness-ProportionateSurvivor selectionAll children replace parentsSpecialityEmphasis on crossoverA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsGenotype space=0,1LPhenotype spaceEncoding(representation)Decoding(inverse representati

5、on)011101001010001001RepresentationA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSGA reproduction cycle1.Select parents for the mating pool(size of mating pool=population size)2.Shuffle the mating pool3.For each consecutive pair apply crossover with probability pc,o

6、therwise copy parents4.For each offspring apply mutation(bit-flip with probability pm independently for each bit)5.Replace the whole population with the resulting offspringA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSGA operators:1-point crossoverlChoose a random

7、point on the two parentslSplit parents at this crossover pointlCreate children by exchanging tailslPc typically in range(0.6,0.9)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSGA operators:mutationlAlter each gene independently with a probability pm lpm is called th

8、e mutation rateTypically between 1/pop_size and 1/chromosome_lengthA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmslMain idea:better individuals get higher chanceChances proportional to fitnessImplementation:roulette wheel techniquelAssign to each individual a part of

9、 the roulette wheell Spin the wheel n times to select n individualsSGA operators:Selectionfitness(A)=3fitness(B)=1fitness(C)=2AC1/6=17%3/6=50%B2/6=33%A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsAn example after Goldberg 89(1)lSimple problem:max x2 over 0,1,31lGA a

10、pproach:Representation:binary code,e.g.01101 13Population size:41-point xover,bitwise mutation Roulette wheel selectionRandom initialisationlWe show one generational cycle done by hand A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic Algorithmsx2 example:selectionA.E.Eiben and J

11、.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsX2 example:crossoverA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsX2 example:mutationA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsThe simple GAlHas been subject of ma

12、ny(early)studiesstill often used as benchmark for novel GAslShows many shortcomings,e.g.Representation is too restrictiveMutation&crossovers only applicable for bit-string&integer representationsSelection mechanism sensitive for converging populations with close fitness valuesGenerational population

13、 model(step 5 in SGA repr.cycle)can be improved with explicit survivor selectionA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsAlternative Crossover OperatorslPerformance with 1 Point Crossover depends on the order that variables occur in the representationmore likel

14、y to keep together genes that are near each otherCan never keep together genes from opposite ends of stringThis is known as Positional BiasCan be exploited if we know about the structure of our problem,but this is not usually the caseA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGene

15、tic Algorithmsn-point crossoverlChoose n random crossover pointslSplit along those pointslGlue parts,alternating between parentslGeneralisation of 1 point(still some positional bias)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsUniform crossoverlAssign heads to one

16、parent,tails to the otherlFlip a coin for each gene of the first childlMake an inverse copy of the gene for the second childlInheritance is independent of positionA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsCrossover OR mutation?lDecade long debate:which one is be

17、tter/necessary/main-background lAnswer(at least,rather wide agreement):it depends on the problem,butin general,it is good to have bothboth have another rolemutation-only-EA is possible,xover-only-EA would not workA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsExplora

18、tion:Discovering promising areas in the search space,i.e.gaining information on the problemExploitation:Optimising within a promising area,i.e.using informationThere is co-operation AND competition between theml Crossover is explorative,it makes a big jump to an area somewhere“in between”two(parent)

19、areasl Mutation is exploitative,it creates random small diversions,thereby staying near(in the area of)the parentCrossover OR mutation?(contd)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmslOnly crossover can combine information from two parentslOnly mutation can int

20、roduce new information(alleles)lCrossover does not change the allele frequencies of the population(thought experiment:50%0s on first bit in the population,?%after performing n crossovers)lTo hit the optimum you often need a lucky mutationCrossover OR mutation?(contd)A.E.Eiben and J.E.Smith,Introduct

21、ion to Evolutionary ComputingGenetic AlgorithmsOther representationslGray coding of integers(still binary chromosomes)Gray coding is a mapping that means that small changes in the genotype cause small changes in the phenotype(unlike binary coding).“Smoother”genotype-phenotype mapping makes life easi

22、er for the GANowadays it is generally accepted that it is better to encode numerical variables directly aslIntegerslFloating point variablesA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsInteger representationslSome problems naturally have integer variables,e.g.image

23、 processing parameters lOthers take categorical values from a fixed set e.g.blue,green,yellow,pinklN-point/uniform crossover operators worklExtend bit-flipping mutation to make“creep”i.e.more likely to move to similar valueRandom choice(esp.categorical variables)For ordinal problems,it is hard to kn

24、ow correct range for creep,so often use two mutation operators in tandem A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsReal valued problemslMany problems occur as real valued problems,e.g.continuous parameter optimisation f:n lIllustration:Ackleys function(often use

25、d in EC)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsMapping real values on bit stringsz x,y represented by a1,aL 0,1Lx,y 0,1L must be invertible(one phenotype per genotype):0,1L x,y defines the representation lOnly 2L values out of infinite are representedlL deter

26、mines possible maximum precision of solutionlHigh precision long chromosomes(slow evolution)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsFloating point mutations 1General scheme of floating point mutations lUniform mutation:lAnalogous to bit-flipping(binary)or rand

27、om resetting(integers)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsFloating point mutations 2lNon-uniform mutations:Many methods proposed,such as time-varying range of change etc.Most schemes are probabilistic but usually only make a small change to valueMost commo

28、n method is to add random deviate to each variable separately,taken from N(0,)Gaussian distribution and then curtail to rangeStandard deviation controls amount of change(2/3 of deviations will lie in range(-to+)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsCrossover

29、 operators for real valued GAslDiscrete:each allele value in offspring z comes from one of its parents(x,y)with equal probability:zi =xi or yi Could use n-point or uniformlIntermediateexploits idea of creating children“between”parents(hence a.k.a.arithmetic recombination)zi=xi +(1-)yi where :0 1.The

30、 parameter can be:constant:uniform arithmetical crossovervariable(e.g.depend on the age of the population)picked at random every timeA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSingle arithmetic crossoverParents:x1,xn and y1,yn Pick a single gene(k)at random,child

31、1 is:reverse for other child.e.g.with =0.5A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSimple arithmetic crossoverParents:x1,xn and y1,yn Pick random gene(k)after this point mix valueschild1 is:reverse for other child.e.g.with =0.5A.E.Eiben and J.E.Smith,Introducti

32、on to Evolutionary ComputingGenetic AlgorithmsMost commonly usedParents:x1,xn and y1,yn child1 is:reverse for other child.e.g.with =0.5Whole arithmetic crossoverA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsPermutation RepresentationslOrdering/sequencing problems fo

33、rm a special typelTask is(or can be solved by)arranging some objects in a certain order Example:sort algorithm:important thing is which elements occur before others(order)Example:Travelling Salesman Problem(TSP):important thing is which elements occur next to each other(adjacency)lThese problems are

34、 generally expressed as a permutation:if there are n variables then the representation is as a list of n integers,each of which occurs exactly onceA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsPermutation representation:TSP examplelProblem:Given n citiesFind a compl

35、ete tour with minimal lengthlEncoding:Label the cities 1,2,nOne complete tour is one permutation(e.g.for n=4 1,2,3,4,3,4,2,1 are OK)lSearch space is BIG:for 30 cities there are 30!1032 possible toursA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsMutation operators fo

36、r permutationslNormal mutation operators lead to inadmissible solutionse.g.bit-wise mutation:let gene i have value jchanging to some other value k would mean that k occurred twice and j no longer occurred lTherefore must change at least two valueslMutation parameter now reflects the probability that

37、 some operator is applied once to the whole string,rather than individually in each positionA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsInsert Mutation for permutationslPick two allele values at randomlMove the second to follow the first,shifting the rest along to

38、 accommodatelNote that this preserves most of the order and the adjacency informationA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsSwap mutation for permutationslPick two alleles at random and swap their positionslPreserves most of adjacency information(4 links brok

39、en),disrupts order moreA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsInversion mutation for permutationslPick two alleles at random and then invert the substring between them.lPreserves most adjacency information(only breaks two links)but disruptive of order informa

40、tionA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsScramble mutation for permutationslPick a subset of genes at randomlRandomly rearrange the alleles in those positions(note subset does not have to be contiguous)A.E.Eiben and J.E.Smith,Introduction to Evolutionary Co

41、mputingGenetic Algorithmsl“Normal”crossover operators will often lead to inadmissible solutionslMany specialised operators have been devised which focus on combining order or adjacency information from the two parentsCrossover operators for permutations1 2 3 4 55 4 3 2 11 2 3 2 15 4 3 4 5A.E.Eiben a

42、nd J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsOrder 1 crossoverlIdea is to preserve relative order that elements occurlInformal procedure:1.Choose an arbitrary part from the first parent2.Copy this part to the first child3.Copy the numbers that are not in the first part,to the

43、 first child:lstarting right from cut point of the copied part,lusing the order of the second parent land wrapping around at the end4.Analogous for the second child,with parent roles reversedA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsOrder 1 crossover examplelCop

44、y randomly selected set from first parentlCopy rest from second parent in order 1,9,3,8,2A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsInformal procedure for parents P1 and P2:1.Choose random segment and copy it from P1 2.Starting from the first crossover point look

45、 for elements in that segment of P2 that have not been copied3.For each of these i look in the offspring to see what element j has been copied in its place from P14.Place i into the position occupied j in P2,since we know that we will not be putting j there(as is already in offspring)5.If the place

46、occupied by j in P2 has already been filled in the offspring k,put i in the position occupied by k in P26.Having dealt with the elements from the crossover segment,the rest of the offspring can be filled from P2.Second child is created analogouslyPartially Mapped Crossover(PMX)A.E.Eiben and J.E.Smit

47、h,Introduction to Evolutionary ComputingGenetic AlgorithmsPMX examplelStep 1lStep 2lStep 3A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsCycle crossoverBasic idea:Each allele comes from one parent together with its position.Informal procedure:1.Make a cycle of allele

48、s from P1 in the following way.(a)Start with the first allele of P1.(b)Look at the allele at the same position in P2.(c)Go to the position with the same allele in P1.(d)Add this allele to the cycle.(e)Repeat step b through d until you arrive at the first allele of P1.2.Put the alleles of the cycle i

49、n the first child on the positions they have in the first parent.3.Take next cycle from second parentA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsCycle crossover examplelStep 1:identify cycleslStep 2:copy alternate cycles into offspringA.E.Eiben and J.E.Smith,Intro

50、duction to Evolutionary ComputingGenetic AlgorithmsEdge RecombinationlWorks by constructing a table listing which edges are present in the two parents,if an edge is common to both,mark with a+le.g.1 2 3 4 5 6 7 8 9 and 9 3 7 8 2 6 5 1 4A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGe

51、netic AlgorithmsEdge Recombination 2Informal procedure once edge table is constructed1.Pick an initial element at random and put it in the offspring2.Set the variable current element=entry3.Remove all references to current element from the table4.Examine list for current element:If there is a common

52、 edge,pick that to be next elementOtherwise pick the entry in the list which itself has the shortest listTies are split at random5.In the case of reaching an empty list:Examine the other end of the offspring is for extensionOtherwise a new element is chosen at randomA.E.Eiben and J.E.Smith,Introduct

53、ion to Evolutionary ComputingGenetic AlgorithmsEdge Recombination exampleA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsMultiparent recombinationlRecall that we are not constricted by the practicalities of naturelNoting that mutation uses 1 parent,and“traditional”cro

54、ssover 2,the extension to a2 is natural to examinelBeen around since 1960s,still rare but studies indicate usefull Three main types:Based on allele frequencies,e.g.,p-sexual voting generalising uniform crossoverBased on segmentation and recombination of the parents,e.g.,diagonal crossover generalisi

55、ng n-point crossoverBased on numerical operations on real-valued alleles,e.g.,center of mass crossover,generalising arithmetic recombination operatorsA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsPopulation ModelslSGA uses a Generational model:each individual surviv

56、es for exactly one generationthe entire set of parents is replaced by the offspringlAt the other end of the scale are Steady-State models:one offspring is generated per generation,one member of population replaced,lGeneration Gap the proportion of the population replaced1.0 for GGA,1/pop_size for SS

57、GAA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsFitness Based CompetitionlSelection can occur in two places:Selection from current generation to take part in mating(parent selection)Selection from parents+offspring to go into next generation(survivor selection)lSele

58、ction operators work on whole individuali.e.they are representation-independentlDistinction between selectionoperators:define selection probabilities algorithms:define how probabilities are implemented A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsImplementation exa

59、mple:SGAlExpected number of copies of an individual i E(ni)=f(i)/f (=pop.size,f(i)=fitness of i,f avg.fitness in pop.)lRoulette wheel algorithm:Given a probability distribution,spin a 1-armed wheel n times to make n selectionsNo guarantees on actual value of ni lBakers SUS algorithm:n evenly spaced

60、arms on wheel and spin onceGuarantees floor(E(ni)ni ceil(E(ni)A.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmslProblems includeOne highly fit member can rapidly take over if rest of population is much less fit:Premature ConvergenceAt end of runs when fitnesses are sim

61、ilar,lose selection pressure Highly susceptible to function transpositionlScaling can fix last two problemsWindowing:f(i)=f(i)-t lwhere is worst fitness in this(last n)generationsSigma Scaling:f(i)=max(f(i)(f -c f),0.0)lwhere c is a constant,usually 2.0Fitness-Proportionate SelectionA.E.Eiben and J.

62、E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsFunction transposition for FPSA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsRank Based SelectionlAttempt to remove problems of FPS by basing selection probabilities on relative rather than absolute fitn

63、esslRank population according to fitness and then base selection probabilities on rank where fittest has rank and worst rank 1lThis imposes a sorting overhead on the algorithm,but this is usually negligible compared to the fitness evaluation timeA.E.Eiben and J.E.Smith,Introduction to Evolutionary C

64、omputingGenetic AlgorithmsLinear RankinglParameterised by factor s:1.0 s 2.0measures advantage of best individualin GGA this is the number of children allotted to it lSimple 3 member exampleA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsExponential RankinglLinear Ran

65、king is limited to selection pressurelExponential Ranking can allocate more than 2 copies to fittest individuallNormalise constant factor c according to population sizeA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsTournament SelectionlAll methods above rely on globa

66、l population statisticsCould be a bottleneck esp.on parallel machinesRelies on presence of external fitness function which might not exist:e.g.evolving game playersl Informal Procedure:Pick k members at random then select the best of theseRepeat to select more individualsA.E.Eiben and J.E.Smith,Introduction to Evolutionary ComputingGenetic AlgorithmsTournament Selection 2lProbability of selecting i will depend on:Rank of iSize of sample k l higher k increases selection pressureWhether contestant

展開閱讀全文
溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
5. 裝配圖網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
關于我們 - 網站聲明 - 網站地圖 - 資源地圖 - 友情鏈接 - 網站客服 - 聯系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網版權所有   聯系電話:18123376007

備案號:ICP2024067431-1 川公網安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對上載內容本身不做任何修改或編輯。若文檔所含內容侵犯了您的版權或隱私,請立即通知裝配圖網,我們立即給予刪除!

日韩精品一区二区三区在线播放_亚洲中文字幕无码人在线_最新亚洲av日韩av二区_欧美深深色噜噜狠狠网站