Professional Documents
Culture Documents
Fhen all the ants have 8inished this travel round 4this iteration57 the pheromone =ill <e updated
as 8ollo=s#
p is the parameter =hich indicates the persistence o8 pheromone7 p! 1
is the quantity o8 pheromone =hich the ant
a
k
leaves =hen it moves 8rom city i to city H1 I is a
constant and
l
k
is the path o8 ant
a
k
in this iteration7
k
is its len3th1
2.2 #he condition to stop
!"# fix a number of times maximal of the iteration$
!%#the current solution dosn&t change for successive k times, which means that the algorithm has
already converged$
!2/20
5 2 4
5 4 5 4
!
=
=
+ = +
m
k
k
ij ij
ij ij ij
t n t
425
k
k
k ij
'
ij l
otherwise
:
i +!
i =!
:
i!
, :
i+!
i=27111 , n!
:
i !
i=n
1 "he ant at the su<interval
:
i =ill move
to its nei3h<orhood accordin3 to the =ei3ht o8 virtual ed3e
e( :
i
, :
i +!
)
#
f ( x
i
) f ( x
i+!
)
7 =e
de8ine the 8unction o8 inspiration
p
ij
=
f ( x
i
)f ( x
i+!
)
1 Fe suppose that the ant
a
k
=as
currently at the su<interval
:
i
7 i8
f ( x
i
) f ( x
i+!
)>
7 the ant
a
k
=ill move to its nei3h<or
:
j
M other=ise7 it =ill not move1 Fe note
allowed
k
as the set o8 su<intervals =here the ant
a
k
can move to ne>t step and )
ij
(k )
(t ) as the pro<a<ility =ith =hich the ant
a
k
move 8rom
su<interval
:
i
to
:
j
at the t
th
iteration1 Fe have the e>pression o8 )
ij
(k )
(t ) as 8ollo=s#
!C/20
Y
x
x1 x2 x3 x4 x5 x6 x7 x8 x10
f(x1)
f(x2)
f(x3) f(x4)
f(x5)
f(x6)
f(x7)
f(x8)
f(x9)
0
)
ij
(k )
(t )=
t
j
o
(t ) p
ij
hallowed
k
t
h
o
(t )p
ih
j allowed
k
otherwise
o is the 8actor si3nin3 the inspiration o8 in8ormation and beta is the 8actor si3nin3 the
inspiration o8 e>pectation1
Step # -$pdate of the pheromone
)8 the ant
a
k
move 8rom su<interval
:
i
to
:
j
accordin3 to the pro<ility7 it =ill leave the
pheromone in the su<interval
:
j
7 =e note the quantity o8 pheromone it leaves as At
j
( k)
(t ) 7 so
=e have At
j
( k)
(t )=+
!
( f ( x
i
) f ( x
j
)) 7 the 3reater the value o8
f ( x
i
) f ( x
j
)
7 the more
pheromone the ant
a
k
=ill leave7 the more pro<a<le the su<interval
:
j
=ill appeal to other
ants1 Each ant =ho moves to
:
j
=ill all leave the pheromone7 in this case7 =e suppose that there
are q ants movin3 to
:
j
at the t
th
iteration7 so the total pheromone they leave is
At
j
(t )=
)=!
;
At
j
( j
)
)
(t ) 1 A8ter all the ants 8inish this iteration o8 movement7 =e update the
pheromone as 8ollo=s#
t
j
(t +!)=(!p)t
j
(t )+At
j
(t )
1 )n =hich7 p is the coe88icient
si3nin3 the volatilisation o8 pheromone and !p is the coe88icient si3nin3 the remainder o8
pheromone1
"his mechanism is viey reasona<le and e88ective <eacause i8 many ants assem<le to one su<interval
=hich means the value o8 8unction at this point is very small7 the pheromone in this su<interval =ill
<e very much and the 3reat quantity o8 pheromone =ill appeal to more ants to come7 =e =ill 8inally
8ind this point7 it may <e the minimum1 (ther=ise7 the su<interval =ith 3reat 8unction value =ill <e
8or3otten <ecause less ants pass it and its pheromone =ill volatili:e7 thus it =ill not appeal to the
ants to come1
Step % -&arro' the research spac e
A8ter some iterations7 =hen all the ants stop movin37 the distri<ution o8 intervals =ill have the
8eature as 8ollo=s# the su<intervals =hich contan the ants =ill must contain the minimaM the
su<intervals =hich have no ant =ill impossi<ly have the minima1 Fe taEe out these su<intervals and
re8ine them# at the ne>t iteration =e maEe the ants search 8or the minima only in these su<intervals1
A8ter many iterations7 the scope o8 searchin3 =ill <e smaller and smaller and =hen the su<interval
re8ined is enou3h small7 all the ants =ill stop near<y the minima1
!0/20
3.3 Applications and results
&unction J
2
(x)=!sin(72 xsin(!72x +7! x
?
+72 x+9))
Fith the ant colony al3orithm7 =e 8ind the 3lo<al minimum is 619!2 4the point in cercle5 =ith the
error J 1! in 9 iterations1
!6/20
&unction
J
!72
( x)=2xsin (2x)
Fith the ant colony al3orithm7 Fe 8ind the 3lo<al minimum is !126 4the point in cercle5 =ith the
error J 1! in 6 iterations1
'raph2# "he relation <et=een compute time and the num<er o8 ants#
!9/20
IV.Particle sarm optimisation algorithm
1.History
"his al3orithm has <een inspired <y the livin3 =orld1 )t's <ased on a model developed <y ;rai3
$eynolds at the end o8 the 9's7ena<lin3 to simulate the movement o8 a 3roup <irds or 8ishes1 An
other source o8 inspiration 7de8ended <y some people7<elon3 to socialDpsycholo3y1
"his optimi:ation method is <ased on mutual colla<oration o8 a3ents1)t's similar to ant colony
al3orithms7=hich also rely on a autoDor3ani:ation concept1"his idea supports a 3roup o8
unintelli3ent individuals can have a comple> 3lo<al or3ani:ation1"hat means each a3ent moves
accordin3 to its <est past per8omance and the <est per8omance o8 its nei3h<ourhood1
2.Principle,algorithm and choice of parameters
Fe have N points
)
i
randomly distri<uted <y an uni8orm pro<a<ility la= over a part o8 the
space 3iven <y a So<ol sequence1
"he 3oal o8 the al3orithm is to assem<le these points7 that =e called hence8orth particles7 as much
as possi<le to the 3lo<al minimum o8 the 8unction that =e seeE to optimi:e1 "he set o8 particles is
called s=arm1
&or each particle
)
i
7 =e de8ine its nei3h<ourhood
<
i
8ormed <y the set o8 particles
)
j
=hich are OcloseO to
)
i
1"he notion o8 closeness can <e considered 8rom several di88erent
=ays1Each o8 them creates a particular particules 's topolo3y 1
E>amples o8 topolo3y #
)n star # each particle is linEed to all the others1
)n radius # Particles are connected to an only one central particle1
"here are others Einds o8 topolo3ies 1
Al3orithm #
"he <ases o8 this al3orithm are the 8ollo=in3 #
DEach particle o8 the s=arm have a memory =hich retain the <est solution o8 the optimi:ation
pro<lem it has achieved so 8ar1
DEach particle is ena<le to communicate =ith the particles o8 its nei3h<ourhood1
DEach particle move in the space <y 8ollo=in3 a trend =hich depends on its intention to 3o to the
<est solution it has 8ound 4noted
x)=est
i
5 and that to =ant to 3o to the optimal solution o8 his
nei3h<ourhood1
Fe intend to solve the 8ollo=in3 optimisation pro<lem #
Trouver xD
f ( x)=min
x D
f ( x)
x=argmin
x D
f ( x)
1
Step ! # ;reate a set o8 points4 particles5 uni8ormly distri<uted over D 1
!B/20
Step 2# Evaluate the 8unction 8 in each position
x
i
correspondin3 to particle
)
i
1
Step 2 # &or each particle7i8 the current position
x
i
is <etter than the <est solution Eno=n <y7 ie7
i8
f (x
i
(t )) f ( x)=est
i
(t !))
7 then the value o8 the <est solution Eno=n <y
)
i
is updated as
8ollo=s #
x)=est
i
(t )=x
i
(t )
1
Step ? # Determine 8or each particle the position o8 the <est solution o<tained <y the nei3h<ourhood
xv=est
i
(t!)
1i8 the current position is <etter7 ie7 i8
f ( x
i
(t )) f ( xv=est
i
(t !))
7then the
value o8 the <est solution Eno=n <y the nei3h<ourhood is updated as 8olo=s #
x)=est
i
(t )=x
i
(t )
Step C # "he movin3 o8 each particle is computed taEin3 into account a conseravative trend 48ollo=
its o=n solution5 and a trend to 8ollo= the nei3h<ourhood's solution1 "he movin3 is called velocity
o8 the particle1)t's de8ined <y #
v
i
(t+!)=v
i
(t )+c
!
r
!
(t )(x)=est
i
(t )x
i
(t ))+c
2
r
2
(xv=est
i
(t )x
i
(t ))
=ith
c
!
>
7
c
2
>
et
c
!
+c
2
?
and called inertia 8actor1
r
!
et
r
2
are random varia<les =hich 8ollo= a uni8orm la= over ; !| 1
Step 0 #
"he particles
)
i
are moved to their ne= position <y #
x
i
(t +!)=x
i
(t )+v
i
( t+!)
Step 6 #
'o <acE to step 2 until one o8 stoppin3 criteria are satis8ied1
"he 8ollo=in3 8i3ures 3ive an idea o8 the particle s=arm optimi:ation al3orithm =ith a 2DD8unction#
J (x , y)=!( x
2
y)
2
+( x!)
2
$osen<rocE's O *anana 8unctionO 4see pa3e !C51
2/20
2!/20
22/20
;hoice o8 parameters
"he particule s=arm optimi:ation al3orithm depends on some parameters =hich7accordin3 to the
pro<lem7 must <e chosen care8ully1 )tSs num<er o8 particles N7 topolo3y and the si:e o8
nei3h<ourhood7 the inertia 8actor =hich impose a ma>imal velocity7the coe88icients
c
!
and
c
2
1
"he set o8 these parameters determine the conver3ence o8 the method and a<ove all his speed o8
conver3ence1
"he more particules there are7 the 8aster a 3lo<al minimum =ill <e approached 1 "he topolo3y is
also very important1&or e>ample7topolo3y in star 3uarantee to approach all particles to 3lo<al
minimum M topolo3y in star =ould permit to approch central particule to 3lo<al minimum1
"he inertia 8actor represents the a<ility to e>plore o8 each particule1 A 3reat value o8 4L !5 is
synonym o8 a lar3e ran3e o8 motion7 there8ore o8 3lo<al e>ploration1 At the opposite a small value
o8 4K !5 is synonym o8 a small ran3e o8 motion7 and there8ore o8 local e>ploration1
;oe88icients
c
!
et
c
2
characteri:e respectively conservative trend and trend to 8ollo= the
nei3h<ourhood1 )8 the 8irst is 3reater than the other7a particle =ould try to approach its <est solution
more than that o8 his nei3h<ourhood and inversely1 "he t=o parameters must <e chosen also
relyin3 on the si:e o8 space to e>plore1 &or a continuous 8onction =hich o8ten varies 7thus =hich has
numerous e>trema7 they must <e taEen enou3h small1
3.Applications and results
)n a space o8 dimension !
&unction J!72#
J
!7 u
( x)=2x sin(u x)
"he al3orithm conver3es in 26 iterations 7the computin3 time is 1B0?62 seconds and the
minimum 3lo<al 8ound is >J!120B9 1
&unction J2# J
2
(x)=!sin(72 xsin(!72x +7! x
?
+72 x+9))
22/20
"he al3orithm conver3es in 2C iterations 7the computin3 time is 91!9229 seconds and the
minimum 3lo<al 8ound is >JD619!221
)n a space o8 dimension 2
&unction# J (x , y)=!( x
2
y)
2
+( x!)
2
'raph# $osen<rocE's O *anana 8unctionO
"he al3orithm conver3es in 22 iterations 7the computin3 time is 1C!!?0 and the minimum 3lo<al
8ound is Q!1!! 7 !122R 1
)n a space o8 dimension 2
&unction J# J (x , y , >)=(x!)
2
+( y!)
?
+(>+!!)
2
C;
"he al3orithm conver3es in 22 iterations 7the computin3 time is 1C!!?0? seconds and the
minimum 3lo<al 8ound is >JQD10BB9 7 212!?C 7 D!10B?R
)n a space o8 dimension n
&unction J#
J
n
(x)=
!
2
x
T
?
n
xb
n
x
=ith ?
n
=
(
? 2 111
2 ? 2 111
2 ? 111
111 2 ?
)
a 4n7n5Dmatri> and
b
n
=!7!1117!|
a nDsi:e vector1
Fith nJ27 the al3orithm conver3es in 90 iterations 7the computin3 time is !100!B0 seconds and
the minimum 3lo<al 8ound is >JQ16?B9 7 1BBBC 7 16?B!R 1
Fith nJ!7 the al3orithm conver3es in 96? iterations7the computin3 time is !!1?B0!B0 seconds and
the minimum 3lo<al 8ound is#
>JQ219?20 7 ?12692 7 C1!!90 7 C10C6B 7 01!0B! 7012B6 7C1B22 7C12BC2 7C1!26C 7212022R
2?/20
Fith nJ!7 the al3orithm conver3es in C2!2 iterations 7the computin3 time is !CC1!B69CB seconds
and the minimum 3lo<al 8ound is a vector o8 ! components1
V. !omparison o" algorithms
1.Calculation time
&unction J!72#
Optimisation algorithm (alculation time
Simulated annealin3 1!CC?? seconds
Ant ;olony 1026?? seconds
Particle s=arm 1B0?62 seconds
&unction J2#
Optimisation algorithm (alculation time
Simulated annealin3 10?0! seconds
Ant ;olony 10C602 seconds
Particle s=arm 91!9229 seconds
;omments#"he simulatin3 annealin3 is the 8astest1
2.(um"er of iterations
&unction J!72#
Optimisation algorithm &umber of iterations
Simulated annealin3 2
Ant ;olony 0
Particle s=arm 26
&unction J2#
Optimisation algorithm &umber of iterations
Simulated annealin3 2
Ant ;olony 6
Particle s=arm 2C
;omments# "he num<er o8 iterations o8 ant colony al3orithm is the least o8 the three1"he others
need very more iterations1
2C/20
3. Precision
&unction J!72#
Optimisation algorithm Error )!recision*
Simulated annealin3 !TD2
Ant ;olony !TD2
Particle s=arm !TD2
&unction J2#
Optimisation algorithm Error)!recision*
Simulated annealin3 !
Ant ;olony 21!TD!
Particle s=arm !TD2
;omments# Ant colony and particle s=arm 3ives a lo=er error than the simulated annealin31
).*pecifities
"he simulated annnealin3 is 8aster than the t=o other <ut less precise and i8 it conver3es7it can <e
need many iterations to conver3e to a 3lo<al minimum1
"he ant colony al3orithm is 8aster than the particle s=arm <ut it is not simple to pro3ram 8or
8unction =hich have more than 2 varia<les1 )n the case o8 oneDdimension 8unction it's as precise as
the particle s=arm1
"he particule s=arm has the main advanta3e to <e usa<le 8or a 8unction o8 any dimension and its
precision can <e chosen or controlled1
!onclusion
"o sum up7 =e have tested three al3orihms 8or continuous optimi:ation# 8ind a 3lo<al
minimum 8or real7 continuous7 di88erentia<le and nonDlinear 8unctions1Each al3orithm has its o=n
advanta3e7 ho=ever since they all aim to 8ind the 3lo<al optimum7 so they taEe a little time than
classical al3orithms 3ivin3 local minimum1
20/20