Particle swarm optimization: Difference between revisions

Content deleted Content added
OAbot (talk | contribs)
m Open access bot: hdl added to citation with #oabot.
m The description of the PSO problem above is cast as a minimization problem, yet, the algorithm solves a maximization problem. I hope my edits provide consistency.
Line 15:
Formally, let ''f'':&nbsp;ℝ<sup>''n''</sup>&nbsp;→ ℝ 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''')&nbsp;≤&nbsp;''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>&nbsp;∈ ℝ<sup>''n''</sup> in the search-space and a velocity '''v'''<sub>i</sub>&nbsp;∈ ℝ<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. -->
Line 21:
Initialize the particle's position with a [[Uniform distribution (continuous)|uniformly distributed]] random vector: '''x'''<sub>i</sub>&nbsp;~&nbsp;''U''('''b<sub>lo</sub>''',&nbsp;'''b<sub>up</sub>''')
Initialize the particle's best known position to its initial position: '''p'''<sub>i</sub>&nbsp;←&nbsp;'''x'''<sub>i</sub>
'''if''' ''f''('''p'''<sub>i</sub>) >< ''f''('''g''') '''then'''
update the swarm's best known position: '''g'''&nbsp;←&nbsp;'''p'''<sub>i</sub>
Initialize the particle's velocity: '''v'''<sub>i</sub>&nbsp;~&nbsp;''U''(-|'''b<sub>up</sub>'''-'''b<sub>lo</sub>'''|,&nbsp;|'''b<sub>up</sub>'''-'''b<sub>lo</sub>'''|)
Line 30:
Update the particle's velocity: '''v'''<sub>i,d</sub>&nbsp;←&nbsp;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>&nbsp;←&nbsp;'''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>&nbsp;←&nbsp;'''x'''<sub>i</sub>
'''if''' ''f''('''p'''<sub>i</sub>) >< ''f''('''g''') '''then'''
Update the swarm's best known position: '''g'''&nbsp;←&nbsp;'''p'''<sub>i</sub>