Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Particle swarm optimization
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Algorithm == A basic variant of the PSO algorithm works by having a population (called a swarm) of [[candidate solution]]s (called particles). These particles are moved around in the search-space according to a few simple formulae.<ref>{{cite journal|last1=Zhang|first1=Y.|title=A Comprehensive Survey on Particle Swarm Optimization Algorithm and Its Applications|journal=Mathematical Problems in Engineering|date=2015|volume=2015|page=931256|url=http://www.hindawi.com/journals/mpe/2015/931256}}</ref> The movements of the particles are guided by their own best-known position in the search-space as well as the entire swarm's best-known position. When improved positions are being discovered these will then come to guide the movements of the swarm. The process is repeated and by doing so it is hoped, but not guaranteed, that a satisfactory solution will eventually be discovered. Formally, let ''f'': β<sup>''n''</sup> β β be the cost function which must be minimized. The function takes a candidate solution as an argument in the form of a [[Row vector|vector]] of [[real number]]s and produces a real number as output which indicates the objective function value of the given candidate solution. The [[gradient]] of ''f'' is not known. The goal is to find a solution '''a''' for which ''f''('''a''') β€ ''f''('''b''') for all '''b''' in the search-space, which would mean '''a''' is the global minimum. Let ''S'' be the number of particles in the swarm, each having a position '''x'''<sub>i</sub> β β<sup>''n''</sup> in the search-space and a velocity '''v'''<sub>i</sub> β β<sup>''n''</sup>. Let '''p'''<sub>i</sub> be the best known position of particle ''i'' and let '''g''' be the best known position of the entire swarm. A basic PSO algorithm to minimize the cost function is then:<ref name=clerc12spso/> <!-- Please see discussion page why this particular PSO variant was chosen. --> '''for''' each particle ''i'' = 1, ..., ''S'' '''do''' Initialize the particle's position with a [[Uniform distribution (continuous)|uniformly distributed]] random vector: '''x'''<sub>i</sub> ~ ''U''('''b<sub>lo</sub>''', '''b<sub>up</sub>''') Initialize the particle's best known position to its initial position: '''p'''<sub>i</sub> β '''x'''<sub>i</sub> '''if''' ''f''('''p'''<sub>i</sub>) < ''f''('''g''') '''then''' update the swarm's best known position: '''g''' β '''p'''<sub>i</sub> Initialize the particle's velocity: '''v'''<sub>i</sub> ~ ''U''(-|'''b<sub>up</sub>'''-'''b<sub>lo</sub>'''|, |'''b<sub>up</sub>'''-'''b<sub>lo</sub>'''|) '''while''' a termination criterion is not met '''do''': '''for''' each particle ''i'' = 1, ..., ''S'' '''do''' '''for''' each dimension ''d'' = 1, ..., ''n'' '''do''' Pick random numbers: ''r''<sub>p</sub>, ''r''<sub>g</sub> ~ ''U''(0,1) Update the particle's velocity: '''v'''<sub>i,d</sub> β w '''v'''<sub>i,d</sub> + Ο<sub>p</sub> ''r''<sub>p</sub> ('''p'''<sub>i,d</sub>-'''x'''<sub>i,d</sub>) + Ο<sub>g</sub> ''r''<sub>g</sub> ('''g'''<sub>d</sub>-'''x'''<sub>i,d</sub>) Update the particle's position: '''x'''<sub>i</sub> β '''x'''<sub>i</sub> + '''v'''<sub>i</sub> '''if''' ''f''('''x'''<sub>i</sub>) < ''f''('''p'''<sub>i</sub>) '''then''' Update the particle's best known position: '''p'''<sub>i</sub> β '''x'''<sub>i</sub> '''if''' ''f''('''p'''<sub>i</sub>) < ''f''('''g''') '''then''' Update the swarm's best known position: '''g''' β '''p'''<sub>i</sub> The values '''b<sub>lo</sub>''' and '''b<sub>up</sub>''' represent the lower and upper boundaries of the search-space respectively. The w parameter is the inertia weight. The parameters Ο<sub>p</sub> and Ο<sub>g</sub> are often called cognitive coefficient and social coefficient. The termination criterion can be the number of iterations performed, or a solution where the adequate objective function value is found.<ref name="bratton2007" /> The parameters w, Ο<sub>p</sub>, and Ο<sub>g</sub> are selected by the practitioner and control the behaviour and efficacy of the PSO method ([[#Parameter selection|below]]).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)