Ant Colony Optimization April 8 2009 CS 591: Complex Adaptive Systems Melanie Moses, Assistant Professor, Computer Science University of New Mexico
AntColonyOptimization
April82009CS591:ComplexAdaptiveSystems
MelanieMoses,AssistantProfessor,ComputerScienceUniversityofNewMexico
KeyConceptsFromDorigo’sACO• Antalgorithmsuse‘self‐organizingprinciples’tocoordinateagents
tosolvecomputationalproblems• Stigmergy:indirectcommunicationandcoordinationthrough
signalsthatmodifytheenvironmentandstimulateotheragents• Pheromones:achemicalsignalthattriggersaresponseinanother
agent– Pheromoneconcentrationincreasestheprobabilitythatanantwill
followapath– Evaporation– Backwardsvsforwards
• ShortestPaths&Doublebridges• Chapter1walksthroughaseriesofprogressivelymore‘useful’ant‐
inspiredalgorithims– Dorigo’sinitialevaluationofeachalgorithmdependsonhowfastit
convergesonasolution
Gossetalantexperiments: Pheromoneslaidonreturntrip Accumulatesfasteronshorterbranch Evaporationontoolongatimescaletoaffectexperiments
RealAntsareunabletofindtheshorterpathintheseexperiments
DeneubougandGossstochasticmodel
Inthismodel:Nopheromoneevaporation,antsdepositpheromoneinbothdirectionswithoutbidirectionalpheromonedepositions,antsdonotchoosetheshortestbranchconfirmedbyexperiments?
pis:Theprobabilityofanantselectingtheshortbranchts:timetotraversetheshortbranchPhiis:pheromoneontheshortbranch=numberofantsthathavealreadychosenshortalpha:determinedbyfittingtoexperimentaldata
Probabilityis(roughly)~theproportionoftotalpheromoneontheshortbranchpil:iscalculatedsimilarly
Theratesofchangeofproportionofantsselectingeachbranch
iandjaredecisionpoints:
ResultsofMonteCarloSimulation
ADiscretetimemodelgivessimilarresults
Simple‐ACO
• S‐ACOmodificationsofpreviousmodels– Antsremembertheirpaths
– Onlybackwardpheromonedeposition– Deterministicbackwardpath– Pheromoneevaporation
– Pheromonedepositionratedependsonqualityofsolution(antsdepositmorepheromoneonshorterpaths)
– Loopavoidance
Forwardmovement• Alledges(taui,j)initializedwithequalpheromone
• Neighborhoodincludesadjacentnodes,excludingpreviousnode
Backwardmovement
• Eachantretracesitsstepsbacktothenest
• Depositsanamountofpheromoneoneachlink– Amountofpheromonedepositedisafunctionofpathlength
• Pheromoneevaporatesatratepaftereachantstep
Experiments
ConvergenceTradeoff
Experimentalconvergence:PheromonewashigheronlongerpathlessoftenwithmoreantsandwithpheromoneDepositioninverselyproportionaltopathlength
IncreasingevaporationreducesconvergencetimeConvergencetopathlength5withp=0.01(optimal)Convergencetopathlength6withp=0.1(suboptimal)
SummaryofS‐ACOexperiments
• Convergencetimeandpathlengthsareshorterwhenpheromonedepositionisinverselyproportionaltopathlength
• Convergenceisfasterwith– higherp(pheromoneevaporationrate)
– Higheralpha(selectionbiasbypheromoneconcentration)
• Whenpandalphaaretoohigh,convergencetosuboptimalpathsismorelikely
Avoidingloopsandgettinghome
FIGURE1.PheromonetrailnetworksofPharaoh'santsonasmokedglasssurface.FromTrailgeometrygivespolaritytoantforagingnetworksDuncanE.Jackson,MikeHolcombeandFrancisL.W.RatnieksNature432,907‐909(16December2004)doi:10.1038/nature03105
• AntSystemforTSP,DorigoACOchapter3
• Kartiktodiscuss– parameterselection– Dorigo1996– HisACOcode
• ACOtorouteinterconnectonmicroprocessors• ReadingforMonday:AntHocNetDiCaroetal2004
TravelingSalesmanProblem
TSPisanNPhardoptimizationproblem• Findtheshortesttourthroughasetofcitiesbackhome,
visitingeachcityexactlyonce.G=(N,A)NnodesandAarcs(oredges)Eacharchaslengthdij.Findπ,apermutationofthenodeindicesthatminimizesf(π)
e.g.π={5,7,3,8,2,1}
€
(i, j)∈ A
€
f (π ) = dπ ( i)+π (i+1)i=1
n−1
∑ + dπ (n )π ( i)
TSP
AntSystem
PheromoneisstoredinamatrixHeuristicinformation(distancesbetweennodes)isstoredinanothermatrixAntsrememberwherethey’vebeenonagiventour
InitializePheromoneConstructAntSolutions Foreachant, chooseastartcity, constructatour,biasingstepsbypheromone,optionallyevaporatingpheromone, returnhomeUpdatePheromoneRepeat
Variations:elitist,rankbased,max‐min:alterpheromonedepositionandupdate
AntSystem• Antcycle:pheromonedepositisdeterminedglobally(notveryantlike)basedonthelength
ofthetour• Initialization:
Initializepheromoneand m=#ants,Cnn=lengthofnearest neighbortour
heuristicinformationforalli,j: di,j=distancefromitoj
• Tourconstructionformula
• Whatdoalphaandbeta
represent?
€
τ i, j =mCnn
ηi, j =1di, j
• Pheromoneupdate
• Pheromoneevaporation
• ASparametersettings:– Alpha=1
– Beta=2to5
– Rho=.5
– m=n(numberofants=numberofcities)
– Tau0initialization=m/Cnn
• AntCycle:pheromoneupdatedependsontourlength,
Soitisupdatedonlyafteracompletedtour
• ElististAS:ReinforceTbs(bestsofartour)
€
Δτi , j
k =1Ck
CkistourlengthofkthantIf(i,j)areonthetourofthekthant0otherwise
€
τi , j
= τi , j
+ Δτi , j
k + eΔτi , j
bs
k=1
m
∑
Δτi , j
bs =1Cbs
Dorigo1996
• Thecomplexityoftheant‐cyclealgorithmisO(NC*n2*m)– NC=NumberofCycles– n=numberofcities– m=numberofants
• ExperimentallyASworksbestwhenm=n• ComplexityisO(NC*n3)• Note:globalcommunicationinAntCyclerestrictsparallelization
– LamarkianpheromonesvsDarwinianpheromones• Whydoesitwork?
– Reducesthesizeofthesearchspace(focusthesearch)– Howquicklydotoursconvergeorstagnate?
• Lambdaisthenumberofarcspernodelikelytobechosen
• Pheromonebiasvspheromoneevaporation(Alphavsrho)?