You are on page 1of 30

What is an Evolutionary Algorithm?

Chapter 2

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Contents
ecap o! Evolutionary "etaphor #asic scheme o! an EA #asic Components$ % epresentation & Evaluation & 'opulation & 'arent Selection & ecombination & "utation & Survivor Selection & (ermination

E)amples $ eight *ueens & +napsac+ (ypical behaviours o! EAs EC in conte)t o! global optimisation

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Recap of EC metaphor
A population o! individuals e)ists in an environment ,ith limited resources Competition !or those resources causes selection o! those fitter individuals that are better adapted to the environment (hese individuals act as seeds !or the generation o! ne, individuals through recombination and mutation (he ne, individuals have their !itness evaluated and compete -possibly also ,ith parents. !or survival. /ver time Natural selection causes a rise in the !itness o! the population

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Recap 2:
EAs !all into the category o! 0generate and test1 algorithms (hey are stochastic, population2based algorithms 3ariation operators -recombination and mutation. create the necessary diversity and thereby !acilitate novelty Selection reduces diversity and acts as a !orce pushing *uality

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

General Scheme of EAs

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Pseudo code for typical EA

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

What are the different types of EAs


4istorically di!!erent !lavours o! EAs have been associated ,ith di!!erent representations
% % % %

#inary strings $ 5enetic Algorithms eal2valued vectors $ Evolution Strategies 6inite state "achines$ Evolutionary 'rogramming 7IS' trees$ 5enetic 'rogramming

(hese di!!erences are largely irrelevant, best strategy


% %

choose representation to suit problem choose variation operators to suit representation

Selection operators only use !itness and so are independent o! representation

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Representations
Candidate solutions -individuals. e)ist in phenotype space (hey are encoded in chromosomes, ,hich e)ist in genotype space
% %

Encoding $ phenotype89 genotype -not necessarily one to one. :ecoding $ genotype89 phenotype -must be one to one.

Chromosomes contain genes, ,hich are in -usually !i)ed. positions called loci -sing. locus. and have a value -allele. !n order to find the glo"al optimum# every feasi"le solution must "e represented in genotype space

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Evaluation $%itness& %unction


epresents the re*uirements that the population should adapt to a.+.a. quality !unction or objective !unction Assigns a single real2valued !itness to each phenotype ,hich !orms the basis !or selection % So the more discrimination -di!!erent values. the better (ypically ,e tal+ about !itness being ma)imised % Some problems may be best posed as minimisation problems, but conversion is trivial

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Population
4olds -representations o!. possible solutions ;sually has a !i)ed si<e and is a multiset o! genotypes Some sophisticated EAs also assert a spatial structure on the population e.g., a grid. Selection operators usually ta+e ,hole population into account i.e., reproductive probabilities are relative to current generation :iversity o! a population re!ers to the number o! di!!erent !itnesses & phenotypes & genotypes present -note not the same thing.

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Parent Selection 'echanism


Assigns variable probabilities o! individuals acting as parents depending on their !itnesses ;sually probabilistic % high *uality solutions more li+ely to become parents than lo, *uality % but not guaranteed % even ,orst in current population usually has non2 <ero probability o! becoming a parent (his stochastic nature can aid escape !rom local optima

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

(ariation )perators
ole is to generate ne, candidate solutions ;sually divided into t,o types according to their arity -number o! inputs.$
% % %

Arity = $ mutation operators Arity 9= $ ecombination operators Arity 8 2 typically called crossover

(here has been much debate about relative importance o! recombination and mutation
% %

>o,adays most EAs use both Choice o! particular variation operators is representation dependant

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

'utation
Acts on one genotype and delivers another Element o! randomness is essential and di!!erentiates it !rom other unary heuristic operators Importance ascribed depends on representation and dialect$
%

% %

#inary 5As % bac+ground operator responsible !or preserving and introducing diversity E' !or 6S"?s& continuous variables % only search operator 5' % hardly used

"ay guarantee connectedness o! search space and hence convergence proo!s

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Recom"ination
"erges in!ormation !rom parents into o!!spring Choice o! ,hat in!ormation to merge is stochastic "ost o!!spring may be ,orse, or the same as the parents 4ope is that some are better by combining elements o! genotypes that lead to good traits 'rinciple has been used !or millennia by breeders o! plants and livestoc+

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Survivor Selection
a.+.a. replacement "ost EAs use !i)ed population si<e so need a ,ay o! going !rom -parents @ o!!spring. to ne)t generation /!ten deterministic % 6itness based $ e.g., ran+ parents@o!!spring and ta+e best % Age based$ ma+e as many o!!spring as parents and delete all parents Sometimes do combination -elitism.

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

!nitialisation * +ermination
Initialisation usually done at random,
%

>eed to ensure even spread and mi)ture o! possible allele values Can include e)isting solutions, or use problem2speci!ic heuristics, to 0seed1 the population

(ermination condition chec+ed every generation


% % % %

eaching some -+no,n&hoped !or. !itness eaching some ma)imum allo,ed number o! generations eaching some minimum level o! diversity eaching some speci!ied number o! generations ,ithout !itness improvement

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

E)ample$ the A *ueens problem

'lace A *ueens on an A)A chessboard in such a ,ay that they cannot chec+ each other

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

+he , -ueens pro"lem: representation

'henotype$ a board con!iguration

5enotype$ a permutation o! the numbers = 2 A

/bvious mapping

1 3 5 2 6 4 7 8

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

A Cueens 'roblem$ 6itness evaluation


B 'enalty o! one *ueen$ the number o! *ueens she can chec+. B 'enalty o! a con!iguration$ the sum o! the penalties o! all *ueens. B >ote$ penalty is to be minimi<ed B 6itness o! a con!iguration$ inverse penalty to be ma)imi<ed

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

(he A *ueens problem$ "utation


Small variation in one permutation, e.g.$
B s,apping values o! t,o randomly chosen positions,

1 3 5 2 6 4 7 8

1 3 7 2 6 4 5 8

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

(he A *ueens problem$ ecombination


Combining t,o permutations into t,o ne, permutations$ B choose random crossover point B copy !irst parts into children B create second part by inserting values !rom other parent$ B in the order they appear there B beginning a!ter crossover point B s+ipping values already in child

1 3 5 2 6 4 7 8 8 7 6 5 4 3 2 1

1 3 5 4 2 8 7 6 8 7 6 2 4 1 3 5

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

(he A *ueens problem$ Selection


'arent selection$
%

'ic+ D parents and ta+e best t,o to undergo crossover When inserting a ne, child into the population, choose an e)isting member to replace by$ sorting the ,hole population by decreasing !itness enumerating this list !rom high to lo, replacing the !irst ,ith a !itness lo,er than the given child

Survivor selection -replacement.


%

% % %

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

, .ueens Pro"lem: summary

>ote that is is only one possible set o! choices o! operators and parameters

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

+ypical "ehaviour of an EA
'hases in optimising on a =2dimensional !itness landscape Early phase$ *uasi2random population distribution "id2phase$ population arranged around&on hills 7ate phase$ population concentrated on high hills

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

+ypical run: progression of fitness


#est !itness in population

(ime -number o! generations.

(ypical run o! an EA sho,s so2called 0anytime behavior1

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Are long runs "eneficial?


#est !itness in population

'rogress in 2nd hal!

'rogress in =st hal!

B Ans,er$ 2 it depends ho, much you ,ant the last bit o! progress 2 it may be better to do more shorter runs

(ime -number o! generations.

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

!s it /orth e0pending effort on smart initialisation?


#est !itness in population

6$ !itness a!ter smart initialisation ($ time needed to reach level 6 a!ter random initialisation

(ime -number o! generations.

Ans,er $ it depends$
2 possibly, i! good solutions&methods e)ist. 2 care is needed, see chapter on hybridisation

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

Evolutionary Algorithms in Conte0t


(here are many vie,s on the use o! EAs as robust problem solving tools 6or most problems a problem2speci!ic tool may$ % per!orm better than a generic search algorithm on most instances, % have limited utility, % not do ,ell on all instances 5oal is to provide robust tools that provide$ % evenly good per!ormance % over a range o! problems and instances

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

EAs as pro"lem solvers: Gold"erg1s 23,3 vie/


'er!ormance o! methods on problems

Special, problem tailored method Evolutionary algorithm

andom search

Scale o! 0all1 problems

A.E. Eiben and J.E. Smith, Introduction to Evolutionary Computing What is an Evolutionary Algorithm?

EAs and domain 4no/ledge


(rend in the EF?s$ adding problem speci!ic +no,ledge to EAs -special variation operators, repair, etc. esult$ EA per!ormance curve 0de!ormation1$ % better on problems o! the given type % ,orse on problems di!!erent !rom given type % amount o! added +no,ledge is variable ecent theory suggests the search !or an 0all2purpose1 algorithm may be !ruitless

You might also like