You are on page 1of 6

3.

Swarm Intelligence
3.1. Swarm Intelligence:
Swarm intelligence (SI) is the collective behavior of decentralized, self-organized systems,
natural or artificial. The concept is employed in work on artificial intelligence. SI systems consist
typically of a population of simple agents or boids interacting locally with one another and with
their environment. The inspiration often comes from nature, especially biological systems. The
agents follow very simple rules, and although there is no centralized control structure dictating
how individual agents should behave, local, and to a certain degree random, interactions between
such agents lead to the emergence of "intelligent" global behavior, unknown to the individual
agents. Examples in natural systems of SI include ant colonies, bird flocking,
animal herding, bacterial growth, fish schooling and microbial intelligence.

SI provides a basis with which it is possible to explore collective (or distributed) problem solving
without centralized control or the provision of a global model. Leverage the power of complex
adaptive systems to solve difficult non-linear stochastic problems.
Features of a swarm:
– Distributed, no central control or data source;
– Limited communication
– No (explicit) model of the environment;
– Perception of environment (sensing)
– Ability to react to environment changes.
3.1.1 Robust exemplars of problem-solving in Nature
– Survival in stochastic hostile environment
– Social interaction creates complex behaviors
– Behaviors modified by dynamic environment.

3.1.2 Emergent behavior observed in:


– Bacteria, immune system, ants, birds
– And other social animals

3.1.3 Two main Swarm Intelligence based methods:-


– Particle Swarm Optimization (PSO)
– Ant Colony Optimization (ACO)
3.2 Particle Swarm Optimization(PSO):
Particle swarm optimization (PSO) is a global optimization algorithm for dealing with problems
in which a best solution can be represented as a point or surface in an n-dimensional space.
Hypotheses are plotted in this space and seeded with an initial velocity, as well as a
communication channel between the particles. Particles then move through the solution space,
and are evaluated according to some fitness criterion after each time step. Over time, particles
are accelerated towards those particles within their communication grouping which have better
fitness values. The main advantage of such an approach over other global minimization strategies
such as simulated annealing is that the large numbers of members that make up the particle
swarm make the technique impressively resilient to the problem of local minima. Particle swarm
optimization (PSO) is a population based stochastic optimization technique developed by Dr.
Eberhart and Dr. Kennedy in 1995, inspired by social behavior of bird flocking or fish
schooling.

Fig.2. Swarm of a school of fish

Here we will discuss another type of biological system - social system, more specifically, the
collective behaviors of simple individuals interacting with their environment and each other.
Someone called it as swarm intelligence. All of the simulations utilized local processes, such as
those modeled by cellular automata, and might underlie the unpredictable group dynamics of
social behavior. There are two popular swarm inspired methods in computational intelligence
areas: Ant colony optimization (ACO) and particle swarm optimization (PSO). PSO is easy to
implement and there are few parameters to adjust. PSO has been successfully applied in many
areas: function optimization, artificial neural network training, fuzzy system control etc.
Suppose take an example, a group of birds are randomly searching food in an area. There is only
one piece of food in the area being searched. All the birds do not know where the food is. But
they know how far the food is, in each iteration. So what's the best strategy to find the food? The
effective one is to follow the bird which is nearest to the food.
 In PSO each single solution is a “bird” in the search space
 Call it “Particle”.
 All of particles have fitness values which are evaluated by the fitness function to
be optimized, and have velocities which direct the flying of the particle.
 The particles fly through the problem space by following the current optimum
particles.
3.2.1 Fitness function:
A fitness function is a particular type of objective function that is used to summaries, as a
single figure of merit, how close a given design solution is to achieving the set aims. Fitness is
used as the performance evaluation of particles in the swarm. Fitness is usually represented with
a function f(S/R C) (S is the set of candidate schedules, and R C is the set of positive real
values). Mapping an original objective function value to a fitness value that represents relative
superiority of particles is a feature of fitness function. The objective function (F(c)) can be
represented as follows

F ( C ) = W 1 * F1 (C ) + W 2 * F2 (C ) + W 3 * F3 (C )

We define the fitness function (fit(c)) is equal to the objective function, i.e.
Fit ( C ) = F ( C )
The objective is to minimize F(c), i.e. fit(c). So particle with the lowest fitness will be superior to
other particles and should be reserved in search process.

3.2.2 PSO Algorithm:


PSO is initialized with a group of random particles (solutions) and then searches for optima by
updating generations. In all iteration, each particle is updated by following two "best" values.
The first one is the best solution (fitness) it has achieved so far. The fitness value is also stored.
This value is called ‘pbest’. Another "best" value that is tracked by the particle swarm optimizer
is the best value, obtained so far by any particle in the population. This best value is a global best
and called ‘gbest’. When a particle takes part of the population as its topological neighbors, the
best value is a local best and is called ‘lbest’.
PSO algorithm is not only a tool for optimization, but also a tool for representing socio cognition
of human and artificial agents, based on principles of social psychology. A PSO system combines
local search methods with global search methods, attempting to balance exploration and
exploitation. Population-based search procedure in which individuals called particles change
their position (state) with time.

Position of the particle is influenced by velocity. Let x i denote the position of particle i in the
search space at time step t; unless otherwise stated, t denotes discrete time steps. The position of
the particle is changed by adding a velocity, v i (t ) to the current position.
After finding the two best values lbest & gbest, the particle updates its velocity & position with
following equation (i) & (ii)
Position of individual particle is updated as follows:

x i( t+1) = x i( t) + v i (t +1) (i)

And velocity is calculated as follows:

Vi [t] = Vi [t-1] + C1 * r 1 (pbest[t] - x i [t−1] ) + C2 * r 2 (gbest[t] -


x i [t-1]) (ii)

Here r 1 & r 2 {can also be written as rand ()} are random numbers between (0, 1) and
C1 & C2 are cognitive and social parameters.

3.2.3 PSO Process:


The pseudo code of the procedure is as follows:
For each particle
Initialize particle
END

Do
For each particle
Calculate fitness value
If the fitness value is better than the best fitness value (pBest) in history
set current value as the new pBest
End

Choose the particle with the best fitness value of all the particles as the gBest
For each particle
Calculate particle velocity according equation (ii)
Update particle position according equation (i)
End
While maximum iterations or minimum error criteria is not attained
Fig.3. PSO Process
4. Matlab Programming for Problem Solving:
4.1 What is Matlab?
MATLAB is a high-performance language for technical computing. It integrates computation,
visualization, and programming in an easy-to-use environment where problems and solutions
are expressed in familiar mathematical notation. Typical uses include:
 Math and computation
 Algorithm development
 Modeling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 Application development, including Graphical User Interface building
MATLAB is an interactive system whose basic data element is an array that does not require
dimensioning. This allows you to solve many technical computing problems, especially those
with matrix and vector formulations, in a fraction of the time it would take to write a program in
a scalar non interactive language such as C or FORTRAN.

Fig. 4

You might also like