Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
CourseSwarmIntelligence
Chapter3:Assignments
WS16/17
SanazMostaghim
IntelligentSystemsGroupIKS,FIN
©SanazM
ostaghim
Assignment1:SearchSpace/SoluFonSpace
ForatravelingsalesmanproblemofciFes,a) Whatisthesizeofthe“SoluFonSpace”?b) WewanttosolvethisproblemusingaPSOmethod.Note
thatPSOworksonconFnuousproblems.WhatshouldwechangeintheproblemformulaFon,sothatwecansolveTSPwithPSO?
c) Whatisthesizeofthe“SearchSpace”fortheaboverepresentaFon?
T-3-2
©SanazM
ostaghim
Assignment1:soluFona) Whatisthesizeofthe“SoluFonSpace”?WehaveapermutaFonproblem,sothesizeofthesoluFonspaceis:
• (𝑛−1)! forcyclicandnon-symmetricroutes
• (𝑛−1)!/2 forcyclicandsymmetricroutes
Examplefor𝑛= 5:• 4!=24 forcyclicandnon-symmetricroutes
• 4!/2 =12 forcyclicandsymmetricroutes
T-3-3
1-2-3-4-51-2-3-5-41-2-4-3-51-2-4-5-31-2-5-3-41-2-5-4-3
1-3-2-4-51-3-2-5-41-3-4-2-51-3-4-5-21-3-5-2-41-3-5-4-2
1-4-2-3-51-4-2-5-31-4-3-2-51-4-3-5-21-4-5-2-31-4-5-3-2
1-5-2-3-41-5-2-4-31-5-3-2-41-5-3-4-21-5-4-2-31-5-4-3-2
Symmetric
©SanazM
ostaghim
Assignment1:soluFonb) WewanttosolvethisproblemusingaPSOmethod.NotethatPSO
worksonconFnuousproblems.WhatshouldwechangeintheproblemformulaFon,sothatwecansolveTSPwithPSO?
c) Whatisthesizeofthe“SearchSpace”fortheaboverepresentaFon?
SoluFon:ThestandardsoluFoncandidateforTSPisapermutaFon.HerewechangethesearchspacesothatwecanusePSOtosolvesuchaproblem.wedesignn-dimensionalreal-valuedsearchspaceForexample:n=5à(0.3,0.2,0.7,0.4,0.9)Toeachcityweassignareal-valuedasapriority,thentheciFesareorderedwithrespecttotheirprioriFes:(0.3,0.2,0.7,0.4,0.9)à5-3-4-1-212345
T-3-4
©SanazM
ostaghim
Assignment2:FitnesslandscapesandPSO
DescribethemoFonofPSOinthefollowingenvironments.WhichofthedesignissuessuchasturbulencefactororstartpopulaFoncanhelptofindamaximuminsuchenvironments?
T-3-5
©SanazM
ostaghim
Assignment2:soluFon(a) RandomLandscape:PSOhasdifferentglobalbestparFclesateachiteraFon.TheswarmismovingalltheFme.- StartpopulaFoncanbeiniFalizedusingrandom
samplingorGapsearch.InthiscasePSOcannotgetanybeberthanRandomSearchmethod!
- Turbulencefactordoesn’thelp(b) NeedleinHay-StackorFlatLandscapes:PSOdoesn‘tmove,ifwedonotapplyturbulencefactorandstartwithzerovelociFes.- Weneedtoapplyturbulencefactortolettheswarm
moveanddoarandomsearchtobeabletofindthemaximumsoluFon
- AwelldesignedstartpopulaFondoesn’thelpmuch
T-3-6
©SanazM
ostaghim
Assignment2:soluFon(c) PSOgoesveryquicklytowardsthewrongdirecFon.BothturbulencefactorandgoodstatpopulaFonneedtobeconsidered(d) NiceLandscapes:PSOcanfindthemaximalpoint,butitcanhappenthatitistrappedintothelocalopFmum.- Soweneedtoconsideraturbulencefactorto
avoidlocalopFmum- AgoodstartpopulaFonisrequired
T-3-7
©SanazM
ostaghim
Assignment3:NeighborhoodtopologyConsiderthefollowingpopulaFonofparFclesandaminimizaFonproblem.WhichparFclecanbeselectedasglobalbestfortheparFclewiththeindex=4:a) usingthefullyconnectedtopology(knownasstandardordefault)?SoluFon:ParFclewithindex2->x=1.0a) usingtheringtopology(indicesshowthetwoneighbors)?SoluFon:ParFclewithindex5->x=2.0
T-3-8
©SanazM
ostaghim
Assignment4:PSO
PSOisdesignedtouseabracFonfuncFonstowardstheglobalbestandthepersonalbest.YouhavelearnedinChapter2thatwecandesignrepulsionfuncDons.HowwouldyouintegraterepulsionintoPSOsothatwedonotrequireturbulencefactor?WritethemoFonequaFonsforPSOwithrepulsion.
T-3-9
©SanazM
ostaghim
Assignment4:soluFon
TurbulencefactorisappliedeitherrandomlyorwhenthevelociFesarezero(thereisnomoFon).Velocitygetszero,becausetheparFclesaresoclosetothe->WeaddrepulsionheretoavoidparFclestogotothesameposiFonasAbracFon-RepulsionfuncFon:Repelwhenclose,otherwiseabracFontowardsit
T-3-10
Pg
vi(t+ 1) = wvi(t) + �1c1(Pi � xi(t))�
�(xi(t)� Pg)(a� b exp(
� || xi(t)� Pg ||2
c
))
Pg
xi(t+ 1) = xi(t) + vi(t+ 1)
©SanazM
ostaghim
Assignment5:DynamicPSO
WritethemoFonequaFonsforthetwodifferentkindsofparFclesinthecharged-PSO(slideSI-3-53).SoluFon:1. chargedparFcles:repeleachother->leadingtoacloudof
chargedparFclesaroundtheneutralparFcles2. neutralparFcles:convergetothecurrentopFmum.
T-3-11
ChargedparFcles
NeutralparFcles
©SanazM
ostaghim
Assignment5:soluFon
1. chargedparFclesinthepopulaFonPc:repulsiontoeachother!
isthenumberofparFclesinthechargedpopulaFonPc2. neutralparFcles:convergetothecurrentopFmum(PSO).
MoFonequaFonsforallparFclesiintheneuralpopulaFonPn
T-3-12
xi(t+ 1) = xi(t) + vi(t+ 1)
vi(t+ 1) = wvi(t) + �1c1(Pi � xi(t)) + �2c2(Pg � xi(t))
vi(t+ 1) =McX
j,j 6=i
Krep(xi(t)� xj(t))
Mc
xi(t+ 1) = xi(t) + vi(t+ 1)
©SanazM
ostaghim
Assignment6:InteracFveOpFmizaFon
SupposethatauserobservestheopFmizaFonprocessonamonitor.a)HowcanheguideaPSOtowardshispreferredsoluDonasshownbelow?
T-3-13
OpFmalsoluFon PreferredsoluFon
ParFcles
Feasiblearea x1
x2
©SanazM
ostaghim
Assignment6:soluFonWeselectafullyconnectedtopologyanddefinethepreferredsoluFonastheglobalbestparFcle:Wecanselectφ1tobezero.SowecanforcetheopFmizaFontofocusmorearoundthepreferredsoluFon.iindicatesthei-thparFcle.
OpFmalsoluFon PreferredsoluFon
ParFcles
Feasiblearea x1
x2
T-3-14
~
Pg = (x1g, x2g)
x1g
x2g
~vi(t+ 1) = w~vi(t) + �1c1(~Pi � ~xi(t)) + �2c2(~Pg � ~xi(t))
©SanazM
ostaghim
Assignment6:InteracFveOpFmizaFon
b)Whatifhehasapreferredarea?
OpFmalsoluFon
Preferredarea
Feasiblearea x1
x2 x11x12
x21
x22
T-3-15
©SanazM
ostaghim
Assignment6:soluFonLikein(a)weselectafullyconnectedtopology.WeselecttheparFcleclosesttothecenterofthepreferredarea:astheglobalbest:(Likein(a)wecanselectφ1tobezeroforabeberfocusingeffect)
Preferredarea
Feasiblearea
x11x12
x21
x22
T-3-16
~xc = (x11 +x12 � x11
2, x21 +
x22 � x21
2)
~vi(t+ 1) = w~vi(t) + �1c1(~Pi � ~xi(t)) + �2c2(~Pg � ~xi(t))
©SanazM
ostaghim
Assignment6:soluFon
c)Whathappensifthepreferredareaislocatedintheinfeasibleregion?
Preferredarea
Feasiblearea x1 x2
SoluFon:WefindtheclosestfeasibleparFcletothepreferredareaanddothesameasin(b).
T-3-17
©SanazM
ostaghim
Assignment7:MOPs
Inthefigurebelowa) findthesetofnon-dominatedparFcles.b) rankalltheparFclesintermsofthenumberofparFclesthey
dominatec) rankalltheparFclesintermsofthenumberofparFclesby
whichtheyaredominatedd) whatcanwechangeintherankingfromslideSI-3-72,sothat
weavoidlargegapsonthefront.
T-4-18
©SanazM
ostaghim
Assignment7:MOPs(a)and(b)
N=0
N=5
N=5
N=3
N=3
N=2
N=1 N=0N=0
N=0
N=0
T-4-19
©SanazM
ostaghim
Assignment7:MOPs(c)
N=0
N=0
N=0
N=0
N=2
N=2
N=3 N=5N=6
N=1
N=1
T-4-20
©SanazM
ostaghim
Assignment7:MOPs(d)
N=0
N=0N=0
N=0
N=2
N=2
N=3 N=5N=6
N=1
N=1
S=0
S=5
S=5
S=3
S=3
S=2
S=1 S=0S=0
S=0
S=0
Wecalltherankingfrom(b)asstrength(𝑆(𝑖)).
(b) (c)
T-5-21
©SanazM
ostaghim
Assignment7:MOPs(d)
R=0
R=5R=5
R=3
R=13
R=12
R=16 R=16R=16
R=3
R=3
S=0
S=5
S=5
S=3
S=3
S=2
S=1 S=0S=0
S=0
S=0
(b) (d)
T-5-22
Weusetherankingsin(b)tofindtherankofthesoluFons.ParFclei’srankisthesumoverthestrengthoftheparFcleswhichdominateitplusitsownstrength.Inthiscasethesmallertherank,thebeberisthefitness:
R(i) =X
j�i
s(j) + s(i)
©SanazM
ostaghim
Assignment8:ConeDominaFon
LetuschangethedefiniFonofdominaFontothefollowing.ParFcle𝑖dominatesalltheotherparFclesasshowninthefollowingfigure.a) MarkthedominatedsoluFonsinthefigurebelow.b) Whatwillchangein(a)ifhavethefollowingdefiniFonsfor
dominaFon?
T-5-23
©SanazM
ostaghim
Assignment8:ConeDominaFon
T-5-24
©SanazM
ostaghim
Assignment8:ConeDominaFon(a)
T-5-25
©SanazM
ostaghim
Assignment8:ConeDominaFon(b)
T-5-26
©SanazM
ostaghim
Assignment8:ConeDominaFon(b)
T-5-27
©SanazM
ostaghim
Assignment8:ConeDominaFon(b)
Conclusion:
1. andfindcomplementarynon-dominatedsoluFons:2. findsthekneesofafront
T-5-28
©SanazM
ostaghim
Assignment9:MO-PSO
SupposethatalltheparFclesinthecurrentpopulaFonofaMO-PSOarenon-dominatedasshowninFigurebelow.NotethatourgoalistofindasetofdiversesoluFons.a) HowdoesaMO-PSOwithRankingLeaderSelecFonMethod
wouldworkhere?b) Proposearankingmethodtodealwiththeproblem.
T-5-29
©SanazM
ostaghim
Assignment9:soluFon
a) HowdoesaMO-PSOwithRankingLeaderSelecFonMethodwouldworkhere?TheparFclecannotmove!Wehaveaflatlandscape
b) Proposearankingmethodtodealwiththeproblem:InordertoobtainagooddiversesetofsoluFons,weneedtofavorthesoluFonsclosetothegaps(markedby):
T-5-30
***
**
©SanazM
ostaghim
Assignment9:soluFonT-5-31
****
*
© S
anaz
Mo
stag
him
Assignment 9: MO-PSO
• We sort the particles in terms of one of the objectives.
• We compute the Euclidian distances between the particle 𝑖 and its two neighbors 𝑖 − 1 and 𝑖 + 1: 𝐷(𝑖, 𝑖 − 1) and 𝐷(𝑖, 𝑖 + 1)
𝑅𝑎𝑛𝑘(𝑖)
= 𝐷(𝑖, 𝑖 − 1) + 𝐷(𝑖, 𝑖 + 1)
• Here the larger the rank, the better is the solution
• The extreme solutions will get the highest ranks (𝑅 1 = 𝑅 𝑀 = ∞ )
T-4-21
* * *
* *
©SanazM
ostaghim
Assignment10:FocusingMO-PSO
SupposethattheuserhasgivenhispreferencesintheobjecFvespaceasinpicturesbelow.HowcanwechangetheMO-PSOleaderselecFonmechanismthattheswarmfocusesthesearchinthegivenpartintheobjecFvespace?
T-5-32
©SanazM
ostaghim
Assignment10:FocusingMO-PSO
Inthiscase,alltheparFcleswillselecttheirglobalbestfromthenon-dominatedparFcleswhichareinthearea.IfthereisnosoluFoninthearea,allofthemwillselectoneleader,whichistheclosesttothearea.
T-5-33
©SanazM
ostaghim
Assignment10:FocusingMO-PSO
WeselectthesigmamethodforleaderselecFon.TheparFclesselecttheparFclewiththesigmavalueclosesttozeroastheleader.
T-5-34
©SanazM
ostaghim
Assignment10:FocusingMO-PSO
Weusesigmamethod.TheparFcleswiththesigmavaluesbetweenthetwosigmavaluesofthebordersofthepreferredarea(asshownabove)areselectedastheleaders.
T-5-35
©SanazM
ostaghim
Assignment10:FocusingMO-PSO
Herethepreferredareaisnotfeasible.Itistheso-calledIdealpoint.Onlythenon-dominatedparFclesclosesttotheidealpointareselectedastheglobalbest.ItcouldonlybeoneparFcleinthepopulaFon/archivewhocanfulfillthis.
T-5-36
©SanazM
ostaghim
Assignment11:Archiving
ProposeanarchivingmethodforMO-PSOwhichmustkeepafixednumberofN=5soluFonsandaddiFonallyhelptofindasetofnon-dominatedparFclesascloseaspossibletotheidealpointasshowninthefigurebelow?
T-5-37
©SanazM
ostaghim
Assignment11:soluFon
• Inthiscasethediversityisnotimportant.SowealwayskeeptheNclosetsparFclestotheIdealpoint
T-5-38
©SanazM
ostaghim
Assignment12:Hypervolume(HV)
a) WhichoneofthefollowingsoluFonshasthelargestmarginalHV?
b) WhichonehasthesmallestmarginalHV?
T-5-39
©SanazM
ostaghim
Assignment12:soluFon
a) A(NoteitisnotthepointC!,why?)b) B
T-5-40
A
B
C
©SanazM
ostaghim
Assignment12:Hypervolume(HV)
c) SupposewearecomparingtwosetsAandBwitheachotherandobtainHV(A)<HV(B).Whichoneofthefollowingscenarioscanbetrueandwhy?
T-5-41
(1) (2)
©SanazM
ostaghim
Assignment12:soluFon
c) HV(A)<HV(B)->Scenario(1)“A”musthaveboththeworstdiversityandconvergence.
T-5-42
(1) (2)
©SanazM
ostaghim
Assignment13:𝜖-dominaFon
a) WhichoneofthefollowingparFclescanbenon-𝜖-dominated,ifweselect𝜖=1?a) Whatabout𝜖 =3?
T-5-43
©SanazM
ostaghim
Assignment13:soluFon
a) 𝜖=1
T-5-44
f/1+𝜖
f
f1
©SanazM
ostaghim
Assignment13:soluFon
b) 𝜖=3
T-5-45
f/1+𝜖
f
f1
©SanazM
ostaghim
Assignment14:Archiving
SupposewehaveapopulaFonofMparFclesandwanttofindanarchiveofnon-dominatedparFclebyinserFngthenon-dominatedparFclesfromthepopulaFonintothearchive.WriteafastmechanismforidenFfyingthenon-dominatedparFcleswiththeleastnumberofoperaFonsaspossible.
T-5-46
P(t)M
A(t+1)
©SanazM
ostaghim
Assignment14:soluFon
© S
anaz
Mos
tagh
im
Assignment 14: solution Input: Given set 𝑃 of size 𝑀 Output: The non-dominated set 𝐴
Step 1: Set counter 𝑖 = 1 and create an empty non-dominated set A. Step 2: For a particle 𝑗 ∈ 𝑃 (but 𝑗 ≠ 𝑖), check if particle 𝑗 dominates particle
𝑖. If yes, go to Step 4. Step 3: If more particles are left in 𝑃, increment 𝑗 by one and go to Step 2;
otherwise, set A = 𝐴 ∪ {𝑖}. Step 4: Increment 𝑖 by one. If 𝑖 ≤ 𝑀, go to Step 2; otherwise stop and declare
A as the non-dominated set.
P M
A Perform maximal 𝑀2 comparisons and insert the found non-dominated particle in the archive
Naive and Slow
T-5-47
©SanazM
ostaghim
Assignment14:soluFon
© S
anaz
Mos
tagh
im
Assignment 14: solution Input: Given set 𝑃 of size 𝑀 Output: The non-dominated set 𝐴
Step 1: Set counter 𝑖 = 1 and include first member in A. Step 2: For each solution 𝑗 ∈ 𝑃 (but 𝑗 ∉ 𝐴), Take one solution at a time Include 𝑗 in 𝐴 (𝐴 = 𝐴 ∪ {𝑗}) Include 𝑗 temporarily in 𝐴 For each 𝑖 ∈ 𝐴 𝑖 ≠ 𝑗 if 𝑗 dominates 𝑖 then 𝐴 = 𝐴\{𝑖} elseif 𝑖 dominates 𝑗 then 𝐴 = 𝐴\{𝑗}
Fast Non-dominated Sorting
P M
A Insert one particle into A
Compare the members of A to each other and make it dominate free P
MAInsertoneparFcle
intoA
ComparethemembersofAtoeachotherandkeepitdominated-free
T-5-48
©SanazM
ostaghim
Assignment15:D-WARranking
RanktheparFclesA–FaccordingtotheirfuncFonsvaluesshownbelow,byusingtheDistance-basedWARranking.A=(1,1,1,1,1)B=(0,1,1,1,1)C=(1,0,1,1,1)D=(1,1,0,1,1)E=(1,1,1,0,1)F=(1,1,1,1,0)
T-5-49
©SanazM
ostaghim
Assignment15:soluFon
RanktheparFclesA–FaccordingtotheirfuncFonsvaluesshownbelow,byusingtheDistance-basedWARranking.rankA=(1,1,1,1,1)2B=(0,1,1,1,1)1C=(1,0,1,1,1)1D=(1,1,0,1,1)1E=(1,1,1,0,1)1F=(1,1,1,1,0)1DWAR=5.00006.65696.65696.65696.65696.6569
T-5-50