Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 36

Intelligent Computing

(MIT 554)
Unit 5: Computational Swarm Intelligence

1
Swarm Intelligence
• Introduced by Gerardo Beni and Jing Wang in the year 1989
• Swarm intelligence (SI) is the collective behavior of decentralized, self-
organized systems, natural or artificial
• Using the knowledge of collective objects (people, insects, etc.) together
and then reaching the optimized solution for a given problem
• “Swarm” means a group of objects (people, insects, etc.).
• About a collective behavior of a population of individuals
• In swarm intelligence, each individual (object) in the group is independent
of others, each individual is responsible for their own contribution to solve
that problem regardless of what others are doing
2
Basic Principle of Computational Swarm
Intelligence
• Let us assume that we have a population of N individuals, which move in a n-dimensional real-valued
search space
• In this model, each individual i has a certain position xi (t) at time step t
• The movement of the individuals in a swarm can be modeled based on the following three behaviors
1. Cohesion can be described as behavior that the individuals tend to gather together
• For this they measure their distances to their neighbors and if they are farther than a given predefined distance, they move towards
the neighbors
2. Separation is the opposite behavior by which the individuals keep a minimum distant d to their neighbors and get
repelled once they get closer than this limit
3. Alignment means that the individuals move in the same direction as the average direction of the individuals in
their neighborhood
• The movement in the swarm can be described by Kinematic equation as
 xi(t+1) = xi (t) + vi (t+1)
 vi (t+1) = w.vi (t) + gi
• Where vi refers to the velocity of the individual i and w indicates the inertia weight, gi denotes the force
which model the cohesion and separation behavior of the individual i in the swarm
3
PSO (Particle Swarm Optimization)
• In computational science, particle swarm optimization (PSO) is a computational method that optimizes a
problem by iteratively trying to improve a candidate solution with regard to a given measure of quality
• Sociobiologists believe a school of fish or a flock of birds that moves in a group “can profit from the experience
of all other members”
• Uses a number of agents (particles) that constitute a swarm moving around in the search space looking for the
best solution
• Example
• While a bird flying and searching randomly for food, for instance, all birds in the flock can share their discovery and help the
entire flock get the best hunt
• Now, in the locality of these birds, there is only one food particle. Now, the birds don’t know where the food particle is
hidden or located. In such a scenario, how the algorithm to find the food particle should be designed. If every bird will try to
find the food on its own, it may cause havoc and may consume a large amount of time. Thus on careful observation of this
swarm, it was realized that though the birds don’t know where the food particle is located, they do know their distance from
it. Thus the best approach to finding that food particle is to follow the birds which are nearest to the food particle. This
behavior of birds is simulated in the computation environment and the algorithm so designed is termed as Particle Swarm
Optimization Algorithm
• This is a heuristic solution because we can never prove the real global optimal solution can be found and it is
usually not
4
PSO (Particle Swarm Optimization)…
• Parameters used to model PSO
 S(n) = {s1, s2, ……., sn} : a swarm of n particles
 si : an individual in the swarm with a position pi and velocity vi
 pi : the position of a particle si
 vi : the velocity of a particle pi
 pBesti : the best solution of a particle
 gBest : the best solution of the swarm (global)
 f : fitness function
 c1 : cognitive constant (how much confidence a particle has in itself)
 c2 : social constant (how much confidence a particle has in its neighbors)
 r1, r2 : random numbers between 0 and 1 (they define the stochastic effect of cognitive and social
behaviors)
 t : iteration number
5
PSO (Particle Swarm Optimization)…
• Steps
1. Create a population of particles (agents)
2. Evaluate each particle’s position based on the
objective function
3. If a particle’s current position is better than its
previous best position, update it (pBest)
4. Determine the best particle (according to the
particle’s previous best positions) (gBest)
5. Update particle’s velocities
6. Move particle to their new positions
7. Goto step 2 until stooping criteria are satisfied

6
PSO (Particle Swarm
Optimization)…
• Inertia
• Makes the particle move in the
same direction and with the
same velocity
• Personal Influence
• Improves the individual
• Makes the particle return to a
previous position better than
the current
• Social Influence
• Makes the particle follow the
best neighbors direction
7
PSO (Particle Swarm Optimization)…
• Example
• Step 1 (Define Objective Functions)
• Find the maxima of the given function,
• Step 2 (Initializations)
• Initial Positions : x1 = -1.5, x2 = 0.0, x3 = 0.5, x4 = 1.25 (N = 4)
• Weight Inertia (w) : 0.8
• Acceleration Coefficients: c1 = c2 = 2.05
• Initial Velocities : v1 = v2 = v3 = v4 = 0

8
PSO (Particle Swarm Optimization)…
• Step 3 (Fitness Value)
• Evaluate performance using Objective Function: f(x1) = 5.75, f(x2) = 11, f(x3) = 11.75, f(x4) = 11.93
• Step 4 (Update Personal Best Solution)
• pBest (x1) = -1.5, pBest (x2) = 0.0, pBest (x3) = 0.5, pBest (x4) = 1.25
• Step 5 (Update Global Best Position)
• Since f(x4) is the highest, gBest = pBest(x4) = 1.25
• Step 6 (Update Velocity and Position of each Particle)
• v1t+1 = v0t + c1r1 (pBest0t - p0t) + c2r2 (gBestt – p0t) [r1 = 0.3, r2 = 0.6]
• v1 = 0.80 + 2.050.3 (-1.5 + (-1.5)) + 2.050.6 (1.25 – (-1.5)) = 3.3825
• p1t+1 = p0t + v0t+1
• p1 = p0 + v1 = -1.5 + 3.3825 = 1.88 = x1
• Similarly, v2 = 1.537, p2 = 1.537, v3 = 0.1537, p3 = 0.6537, v4 = 0, p4 = 1.25
• x1 = 1.88, x2 = 1.54, x3 = 0.65, x4 = 1.25
9
PSO (Particle Swarm Optimization)…
• Step 7 (Evaluate New Solution)
• f(x1) = -(1.88)^2 + 21.88 + 11 = 11.23, f(x2) = 11.72, f(x3) = 11.87, f(x4) =
11.93
• Step 8 (Update Personal Best Solution)
• pBest (x1) = 1.88, pBest (x2) = 1.53, pBest (x3) = 0.65, pBest (x4) = 1.25
• Step 9 (Update Global Best Position)
• Since previous highest value is 11.93, and there is no one greater than this
value in this iteration, so the global value bBest is still of x4 i.e. 1.25
• Step 10 (Check Stopping Condition)
• Repeat 6 to 9

10
PSO (Particle Swarm Optimization)…
• Step 6 (Update Velocity and Position for Each Particle for Iteration 2)
• v1 = 3.489, p1 = 5.36 (x1)
• v2 = 0.8852, p2 = 2.41 (x2)
• v3 = 1.045, p3 = 1.695 (x3)
• v4 = 0.2066, p4 = 1.043 (x4)
• Ensure New Solutions within Range -2  x  2
• x1(normalized) = min(2, max(-2,x1)) = min(2, max(-2,5.36)) = min(2, 5.36) = 2
• Similarly, x2 = 2, x3 = 1.695, x4 = 1.043
• Step 7 (Evaluate New Solution)
• f(x1) = -(2^2) + 22 + 11 = 11, f(x2) = 11, f(x3) = 11.51, f(x4) = 11.99

11
PSO (Particle Swarm Optimization)…
• Step 8 (Update Personal Best Solution)
• Check, IF old_pBest > new_pBest
• x1,old_pBest(x1) > new_pBest(x1) : 11.23 > 11
• x2 : 11.72 > 11, x3: 11.87 > 11.51, x4 : 11.93 > 11.99
• In case of x4, it is false so the value is updated as x1 = 1.88, x2 = 1.53, x3 =
0.65, x4 = 1.043
• Step 9 (Update Global Best Position)
• Check, IF old_gBest > new_gBest
• old_gBest = 11.93, new_gBest are 11, 11, 11.32 and 11.99
• Since 11.99 is greater than 11.93, gBest = x4 = 1.043

12
Influence of the Parameters
• Acceleration Coefficients
• Case 1 (c1 = c2 = 0)
 All particles continue flying at their current speed until they hit the search space’s
boundary
• Case 2 (c1 > 0, c2 = 0)
 All particles are independent
• Case 3 (c1 = 0, c2 > 0)
 All particles are attracted to a single point in the entire swarm
• Case 4 (c1 == c2)
 All particles are attracted towards the average of pBest and gBest

13
Influence of the Parameters…
• Inertia Weight
• w can be set to a constant value < 1
• The small values of w enforces the swarm to a very quick
convergences towards the local optima, while the large values
has the opposite behavior
• Large values of w makes the movements steps larger and
larger over iterations which leads to an explosive behavior
• In this case, the solution i cannot get close enough to the
global best solution
• The small values of w results in a very quick convergence
towards the global best solution in the population
• Based on this behavior, we can change w over time so that it
starts with large values (adding some randomness in the
beginning of the optimization) and decreases over time
• That is, as time advances, the influence of the (current)
velocity of the particle decreases and thus the (relative)
influence of the attraction of the personal and the global
memory increases
• Generally, it can be observed that after starting with fairly high
speed (caused by the attraction towards the global memory)
the particles become slower and slower and finally come
(almost) to a halt at the best point discovered by the swarm

14
Influence of the Parameters…
• Turbulence Factor
• Turbulence factor is a diversity control mechanism, which is meant to
prevent a premature convergence to suboptimal solutions
• A naive turbulence factor is to change the position of a randomly selected
particle to a random position
• Another approach is to select the particles with very small velocities and
replace them to random positions in the search space
• In this way, these particles which could not move due to a very small (or even
equal to zero velocity) help explore the search space and eventually avoid the
premature stagnation in the local optima

15
Influence of the Parameters…
• Boundary Handling
• When designing PSO to solve an optimization problem with a given search
space bounded to a range [xmin, xmax ], boundary handling methods need to
be applied to the particles which have left the boundaries
• This is particularly important if, as is often the case, the optimal solutions lie
close to the boundary of the search space
• We can use a boundary handling method in the case that a particle has left
the border, as
• On the border
• IF xi > xmax THEN xi = xmax OR IF xi < xmin THEN xi = xmin
• Or at random position in the search space
• IF xi > xmax OR IF xi < xmin THEN xi = RAND(xmin, xmax)

16
Social Network Structures
• The feature that drives PSO is social interaction
• Particles within the swarm learn from each other and, on the basis of the knowledge obtained, move to
become more similar to their “better” neighbors
• The social structure for PSO is determined by the formation of overlapping neighborhoods, where particles
within a neighborhood influence one another
• This is in analogy with observations of animal behavior, where an organism is most likely to be influenced by
others in its neighborhood, and where organisms that are more successful will have a greater influence on
members of the neighborhood than the less successful
• Within the PSO, particles in the same neighborhood communicate with one another by exchanging information
about the success of each particle in that neighborhood
• All particles then move towards some quantification of what is believed to be a better position
• The performance of the PSO depends strongly on the structure of the social network
• The flow of information through a social network, depends on
1. The degree of connectivity among nodes (members) of the network
2. The amount of clustering (clustering occurs when a node’s neighbors are also neighbors to one another), and
3. The average shortest distance from one node to another
17
Basic Variations
• A number of basic modifications to the basic PSO have been
developed to improve speed of convergence and the quality of
solutions found by the PSO
• Includes
 Velocity Clamping
 Inertia Weight
 Construction Coefficient
 Synchronous vs Asynchronous updates
 Velocity models

18
Velocity Clamping
• An important aspect that determines the efficiency and accuracy of an optimization algorithm is the
exploration–exploitation trade-off
• Exploration is the ability of a search algorithm to explore different regions of the search space in order
to locate a good optimum
• Exploitation, on the other hand, is the ability to concentrate the search around a promising area in
order to refine a candidate solution
• Within the PSO, these objectives are addressed by the velocity update equation
• In the early applications of the basic PSO, it was found that the velocity quickly explodes to large
values, especially for particles far from the neighborhood best and personal best positions
• Consequently, particles have large position updates, which result in particles leaving the boundaries of
the search space – the particles diverge
• To control the global exploration of particles, velocities are clamped to stay within boundary constraints
• If a particle’s velocity exceeds a specified maximum velocity, the particle’s velocity is set to the
maximum velocity

19
Inertia Weight
• A mechanism to control the exploration and exploitation abilities of
the swarm, and as a mechanism to eliminate the need for velocity
clamping
• The inertia weight, w, controls the momentum of the particle by
weighing the contribution of the previous velocity
• Large values for w facilitate exploration, with increased diversity
• A small w promotes local exploitation

20
Constriction Coefficient
• To balance the exploration–exploitation trade-off, where the velocities
are constricted by a constant χ, referred to as the constriction
coefficient

21
Synchronous versus Asynchronous
Updates
• The gbest and lbest PSO algorithms perform synchronous updates of the
personal best and global (or local) best positions
• Synchronous updates are done separately from the particle position updates
• Alternatively, asynchronous updates calculate the new best positions after
each particle position update
• Asynchronous updates have the advantage that immediate feedback is given
about the best regions of the search space, while feedback with synchronous
updates is only given once per iteration
• Asynchronous updates are more important for lbest PSO where immediate
feedback will be more beneficial in loosely connected swarms, while
synchronous updates are more appropriate for gbest PSO
22
Velocity Models
• Cognition-Only Model
• The cognition - only model excludes the social component

• Social-Only Model
• The Social - only model excludes the social component

23
Single-Solution Particle Swarm
Optimization
• A variety of PSO variations have been developed, mainly to improve
the accuracy of solutions, diversity and convergence behavior
• Variations for locating a single solution to unconstrained, single-
objective, static optimization problems

24
Guaranteed Convergence PSO
• The basic idea is to introduce an additional particle, which searches the region around the current
global best position, (i.e. its local best position is equal to the current global best position)
• In that manner, the current global best particle is treated also as a member of the swarm(e.g.
particle )
• The velocity update of the global best particle is updated as

• p(t) is the diameter of the search area and dynamically adapted based on the behavior of the
swarm, if the swarm always finds a better position than the current global best position in
consecutive iterations, the search diameter will become larger, if the swarm always fails to find a
better position than the current global best position in consecutive iterations, the search diameter
will become smaller
• p(t) is adapted as
• (s) = 15, (f) = 5

25
Social-Based Particle Swarm Optimization
• Social-based PSO implementations introduce a new social topology, or
change the way in which personal best and neighborhood best
positions are calculated
• Neighborhoods be formed on the basis of the Euclidean distance
between particles
• For neighborhoods of size N, the neighborhood of particle i is defined
to consist of the N particles closest to particle i

26
Hybrid Algorithms
• PSO algorithms that use one or more concepts from Evolutionary
Computation
• Selection Based PSO
• GA + PSO
• Performance can be improved for certain classes of problems by adding a
selection process similar to that which occurs in evolutionary algorithms

27
Sub-Swarm Based PSO
• Multi-phase PSO approaches divide the main swarm of particles into subgroups, where
each subgroup performs a different task
• The behavior of a group or task performed by a group usually changes over time in
response to the group’s interaction with the environment
• It can also happen that individuals may migrate between groups
• Al-Kazemi and Mohan explicitly divide the main swarm into two sub swarms, of equal
size
• Particles are randomly assigned to one of the sub-swarms
• Each sub-swarm can be in one of two phases
1. Attraction phase, where the particles of the corresponding sub-swarm are allowed to move
towards the global best position.
2. Repulsion phase, where the particles of the corresponding sub-swarm move away from the
global best position
28
Sub-Swarm Based PSO…
• The velocity is updated as
• The personal best position is excluded from the velocity equation, since a
hill-climbing procedure is followed where a particle’s position is only
updated if the new position results in improved performance
• Let the tuple (w, c1, c2) represent the values of the inertia weight, w, and
acceleration coefficients c1 and c2
• Particles that find themselves in phase 1 exhibit an attraction towards the
global best position, which is achieved by setting (w, c1, c2) = (1,−1, 1)
• Particles in phase 2 have (w, c1, c2) = (1, 1,−1), forcing them to move
away from the global best position
29
Multi-Start PSO Algorithms
• One of the major problems with the basic PSO is lack of diversity
when particles start to converge to the same point
• Multi-start methods have as their main objective to increase diversity,
whereby larger parts of the search space are explored
• Injection of chaos into the swarm introduces a negative entropy
• It is important to remember that continual injection of random
positions will cause the swarm never to reach an equilibrium state

30
Repelling Methods
• Repelling methods have been used to improve the exploration
abilities of PSO
• Charged PSO
• The idea is to introduce two opposing forces within the dynamics of the PSO:
an attraction to the center of mass of the swarm and inter-particle repulsion
• The attraction force facilitates convergence to a single solution, while the
repulsion force preserves diversity
• The charged PSO changes the velocity equation by adding a particle
acceleration, a , to the standard equation
i

31
Repelling Methods…
• Particles with Spatial Extention
• Particles with spatial extension were developed to prevent the swarm from
prematurely converging
• If one particle locates an optimum, then all particles will be attracted to the
optimum – causing all particles to cluster closely
• The spatial extension of particles allows some particles to explore other areas of
the search space, while others converge to the optimum to further refine it
• The exploring particles may locate a different, more optimal solution
• The objective of spatial extension is to dynamically increase diversity when
particles start to cluster
• This is achieved by adding a radius to each particle
• If two particles collide, i.e. their radii intersect, then the two particles bounce off
32
Binary PSO
• For the binary PSO, particles represent positions in binary space, i.e. each element of a particle’s position vector can
take on the binary value 0 or 1
• In PSO, the solution space is continuous and real valued vectors are used to represent each particle’s position
• But in Binary PSO, the solution space is discrete, and a binary vector is used to represent each particle’s position
• Changes in a particle’s position then basically implies a mutation of bits, by flipping a bit from one value to the other
• A particle may then be seen to move to near and far corners of a hypercube by flipping bits
• In the binary PSO, velocities and particle trajectories are rather defined in terms of probabilities that a bit will be in
one state or the other
• Based on this probabilistic view, a velocity vij(t) = 0.3 implies a 30% chance to be bit 1, and a 70% chance to be bit 0
• This means that velocities are restricted to be in the range [0, 1] to be interpreted as a probability
• Different methods can be employed to normalize velocities such that vij ∈ [0, 1]
 One approach is to simply divide each vij by the maximum velocity, Vijmax,j
 A more natural normalization of velocities is obtained by using the sigmoid function

33
Binary PSO…
• Example
• Population size (N) = 5
• Dimension (D) = 4
• Inertia Weight (w) = 0.5
• c1 = 1.5, c2 = 1.5, r1 = 0.6, r2 = 0.4
• Initialization
• 1010, 1110, 1000, 0101
• Fitness Function

34
Multi-Objective PSO
• Neighborhoods are determined on the basis of the simplest objective
• Let f1(x) be the simplest objective function, and let f2(x) be the
second objective
• The neighbors of a particle are determined as those particles closest
to the particle with respect to the fitness values for objective f1(x)
• The neighborhood best particle is selected as the particle in the
neighborhood with the best fitness according to the second objective,
f2(x)
• Personal best positions are replaced only if a particle’s new position
dominates its current personal best solution
35
End of Unit 5

36

You might also like