0% found this document useful (0 votes)
98 views

Bacterial Foraging Optimization Algorithm

The document describes the bacterial foraging optimization algorithm. It is inspired by the foraging behavior of E. coli bacteria and aims to solve complex engineering optimization problems. The algorithm involves chemotaxis, swarming, reproduction, and elimination/dispersal steps to mimic bacterial movement and population dynamics. Pseudocode and MATLAB code are provided to implement the algorithm and test it on sample optimization problems.

Uploaded by

Hassan Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views

Bacterial Foraging Optimization Algorithm

The document describes the bacterial foraging optimization algorithm. It is inspired by the foraging behavior of E. coli bacteria and aims to solve complex engineering optimization problems. The algorithm involves chemotaxis, swarming, reproduction, and elimination/dispersal steps to mimic bacterial movement and population dynamics. Pseudocode and MATLAB code are provided to implement the algorithm and test it on sample optimization problems.

Uploaded by

Hassan Shahid
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

COMPLEX

ENGINEERING
PROBLEM

Submitted By:
-

5/20/2019
Table of Contents
Bacterial foraging optimization ...................................................................................................... 3
Abstract ................................................................................................................................................... 3
Introduction ............................................................................................................................................ 3
Literature Review: ................................................................................................................................... 3
Different Types of Derivative Free Optimization ........................................................................ 4
Bacterial Foraging Optimization ............................................................................................................. 4
algorithm ................................................................................................................................................. 6
Flowchart ................................................................................................................................................ 8
Code: ....................................................................................................................................................... 9
Results; .................................................................................................................................................. 13
Comparison: .......................................................................................................................................... 15
Advantages:........................................................................................................................................... 15
Conclusion ............................................................................................................................................. 15
References ............................................................................................................................................ 16

2
Bacterial foraging optimization

Abstract

Bacterial foraging optimization algorithm (BFOA) has been widely accepted as a


global optimization algorithm of current interest for optimization and control. BFOA is
inspired by the social foraging behaviour of Escherichia coli. BFOA has already
drawn the attention of researchers because of its efficiency in solving real-world
optimization problems arising in several application domains.The underlying biology
behind the foraging strategy of E.coli is emulated in an extraordinary manner and
used as a simple optimization algorithm.

Introduction
Optimization problems defined by functions for which derivatives are unavailable or
available at a prohibitive cost are appearing more and more frequently in
computational science and engineering. Increasing complexity in mathematical
modelling, higher sophistication of scientific computing, and abundance of legacy
codes are some of the reasons why derivative-free optimization is currently an area
of great demand.

In many physical applications, the true models or functions being optimized are
extremely expensive to evaluate but, based e.g. on simplified physics or mesh
coarsening, there are often surrogate models available, less accurate but cheaper to
evaluate. In these circumstances, one would expect to design an optimization
framework capable of extracting as much information as possible from the surrogate
model while parsimoniously using the fine, true model to accurately guide the course
of the optimization process

Literature Review:

Many researchers study the biological evolution and animal behavior, thereby they
put forward many bionic algorithms based on these. Those algorithms include
Genetic Algorithm(GA), Particle Swarm Optimizer(PSO), Ant Colony Optimization
(ACO), Glowworm Swarm Optimization(GSO) and Bee Colony Algorithm(BCA), and
so on. All of them have been developed and used to solve complex optimization
problems.

Kevin M. Passino proposed the bacterial foraging optimization(BFO) algorithm while


studying the distributed optimization and control problem in 2002. This bacterial
foraging algorithm learn from the foraging strategy of E. Coli bacteria. Many
researchers have focused on the algorithm from the day it is put forward because of
its effectiveness in many optimization problems.

BFO has has been successfully applied to a variety of problems, such as electrical
engineering and control [2], artificial neural network training [3, 4], pattern
recognition[5], PID controller design[6], portfolio optimization [7] etc. However, as

3
other intelligent algorithm, BFO algorithm also could trapped in local minima and its
convergence speed is slow. For improving the BFO’s searching performance, some
mutation algorithms base on BFO were presented, most of them belong to
parameters modification or hybrid algorithms.

In the first case, for example, S. Dasgupta et al. [8] analysis the effect of the adaptive
chemotaxis step size on the convergence and stability of the algorithm. Shao Y. et
al. [9] proposed a cooperative bacterial foraging algorithm base on adaptive
chemotaxis step size. And recently, Tan L, J. et al. [10] present a adaptive bacterial
foraging algorithm with nonlinearly decreasing modulation. In the other case, Kim et
al. proposed a BFOA-Genetic algorithm hybridization for better performance [11].

After that, the other researchers proposed BFOA based on PSO (BSO [12],
BFPSO[13]), BFOA based on Differential Evolution(DE)[14], and BFOA-Estimation of
Distribution Algorithms [15], Bacterial Foraging-Tabu Algorithms [16], BFA Based on
Quantum-behaved Particle Swarm Optimization (OQ-BFA) [17] etc. But, as well as
the literatures[8–10], the previous works in adaptive mechanism focus on the
adaptive chemotaxis step size, while few works pay attention to the elimination-
dispersal probability. In this project, we using an adaptive elimination-dispersal
probability and add

particle swarm optimization operator to BFO to create an Enhanced BFO algorithm


(EBFO)

Different Types of Derivative Free Optimization


1. Genetic Algorithm

2. Simulated Analysis

3. Random Search Method

4. Swarm Optimization

5. Ant Colony Algorithm

6. Bacterial Foraging

Bacterial Foraging Optimization


This method consists of three steps:

Chemotaxis
The movement of E. coli bacteria in the human intestine in search of nutrient-rich
location away from noxious environment is accomplished with the help of the

4
locomotory organelles known as flagella by chemotactic movement in either of the
ways, that is, swimming (in the same direction as the previous step) or tumbling (in
an absolutely different direction from the previous one).

Swarming
This group behavior is seen in several motile species of bacteria, where the cells,
when stimulated by a high level of succinate, release an attractant aspertate. This
helps them propagate collectively as concentric patterns of swarms with high
bacterial density while moving up in the nutrient gradient.

Reproduction
The least healthy bacteria constituting half of the bacterial population are eventually
eliminated while each of the healthier bacteria asexually split into two, which are then
placed in the same location. Hence, ultimately the population remains constant.

Elimination and Dispersal


The BFO algorithm makes some bacteria to get eliminated and dispersed
after N number of reproductive events to ensure that the bacteria do not get trapped
into a local optimum instead of the global optima.

5
algorithm

6
7
Flowchart

8
Code:

clear all;
close all;
clc;
tic
%diary prav;
% Bacteria Foraging Optimization %

% ------- initialisation ----------%


Pd=850;
Ne=100;%no of iteration
Nr=20;
Nc=20;
Np=30;%population size
Ns=10;
D=3;% no of generator units
C=0.001;
Ped=0.9; % elimination dispersion probability
cost=[561 7.92 0.001562 100 600 0 0
310 7.85 0.00194 100 400 0 0
78 7.97 0.00482 50 200 0 0];
a=cost(:,1);
b=cost(:,2);
c=cost(:,3);
Pmin=cost(:,4);
Pmax=cost(:,5);
ee=cost(:,6);
ff=cost(:,7);

for k=1:Np
for i=1:D
x(k,i)=Pmin(i)+rand*(Pmax(i)-Pmin(i));
end
end
%x
% x=(rand(Np,D)-0.5)*60 % x lies in [-30 30]

J=zeros(Np,1);

for k=1:Np
temp1=0;
temp5=0;
for i=1:D

9
temp1=temp1+x(k,i);
temp5=temp5+a(i)+b(i)*x(k,i)+c(i)*x(k,i)*x(k,i)+abs(ee(i)*sin(ff(i)*(Pmin(i)-x(k,i))));
% J(k)=sum(100*(x(k,i+1)-x(k,i)^2)^2+(x(k,i)-1)^2); % initial fitness calculation

end

temp2=Pd-temp1;
temp3=0;
if(temp2>0)
temp3=200.0*temp2;
end
J(k)=temp5+temp3;

end
J;

Jlast=J;

for l=1:Ne
for k=1:Nr
Jchem=J;
for j=1:Nc
% Chemotaxis Loop %

for i=1:Np
del=(rand(1,D)-0.5)*2;
x(i,:)=x(i,:)+(C/sqrt(del*del'))*del;
temp1=0;
temp5=0;
for d=1:D
if(x(i,d)<Pmin(d))
x(i,d)=Pmin(d);
end
if(x(i,d)>Pmax(d))
x(i,d)=Pmax(d);
end

temp1=temp1+x(i,d);

temp5=temp5+a(d)+b(d)*x(i,d)+c(d)*x(i,d)*x(i,d)+abs(ee(d)*sin(ff(d)*(Pmin(d)-
x(i,d))));
%J(i)=sum(100*(x(i,d+1)-x(i,d)^2)^2+(x(i,d)-1)^2);
end
temp2=Pd-temp1;
temp3=0;
if(temp2>0)

10
temp3=200.0*temp2;
end
J(i)=temp5+temp3;
for m=1:Ns
if J(i)<Jlast(i)
Jlast(i)=J(i);
x(i,:)=x(i,:)+C*(del/sqrt(del*del'));
temp1=0;
temp5=0;
for d=1:D
if(x(i,d)<Pmin(d))
x(i,d)=Pmin(d);
end
if(x(i,d)>Pmax(d))
x(i,d)=Pmax(d);
end

temp1=temp1+x(i,d);

temp5=temp5+a(d)+b(d)*x(i,d)+c(d)*x(i,d)*x(i,d)+abs(ee(d)*sin(ff(d)*(Pmin(d)-
x(i,d))));
% J(i)=sum(100*(x(i,d+1)-x(i,d)^2)^2+(x(i,d)-1)^2);
end
temp2=Pd-temp1;
temp3=0;
if(temp2>0)
temp3=200.0*temp2;
end
J(i)=temp5+temp3;

else
del=(rand(1,D)-0.5)*2;
x(i,:)=x(i,:)+C*(del/sqrt(del*del'));
temp1=0;
temp5=0;
for d=1:D
if(x(i,d)<Pmin(d))
x(i,d)=Pmin(d);
end
if(x(i,d)>Pmax(d))
x(i,d)=Pmax(d);
end

temp1=temp1+x(i,d);

11
temp5=temp5+a(d)+b(d)*x(i,d)+c(d)*x(i,d)*x(i,d)+abs(ee(d)*sin(ff(d)*(Pmin(d)-
x(i,d))));
% J(i)=sum(100*(x(i,d+1)-x(i,d)^2)^2+(x(i,d)-1)^2);
end
temp2=Pd-temp1;
temp3=0;
if(temp2>0)
temp3=200.0*temp2;
end
J(i)=temp5+temp3;

end
end

end

Jchem=[Jchem J];
end % End of Chemotaxis %

for i=1:Np
Jhealth(i)=sum(Jchem(i,:)); % sum of cost function of all chemotactic loops
for a given k & l
end
[Jhealth1,I]=sort(Jhealth,'ascend');
x=[x(I(1:Np/2),:);x(I(1:Np/2),:)];
J=[J(I(1:Np/2),:);J(I(1:Np/2),:)];
xmin=x(I(1),:);
end
Jmin(l)=min(J);
% random elimination dispersion

for i=1:Np
r=rand;
if r>=Ped
x(i,:)=(rand(1,D)-0.5);
temp1=0;
temp5=0;
for d=1:D
if(x(i,d)<Pmin(d))
x(i,d)=Pmin(d);
end
if(x(i,d)>Pmax(d))
x(i,d)=Pmax(d);
end

12
temp1=temp1+x(i,d);

temp5=temp5+a(d)+b(d)*x(i,d)+c(d)*x(i,d)*x(i,d)+abs(ee(d)*sin(ff(d)*(Pmin(d)-
x(i,d))));

% J(i)=sum(100*(x(i,d+1)-x(i,d)^2)^2+(x(i,d)-1)^2);
end
temp2=Pd-temp1;
temp3=0;
if(temp2>0)
temp3=200.0*temp2;
end
J(i)=temp5+temp3;

end
end
l
Jmin
end

Jmin
plot(Jmin);
xmin
Pg= sum(xmin)
toc

Results;
Non-Convex:

13
Convex:

14
Comparison:
Technique Cost

BFO 8230.3

ACO 8232

GA 8234.07

PSO 8569.2

Advantages:

1) Less affected by size and non linearity


2) More probability of convergence
3) Less computational burden
4) Global Convergence
5) Less computational time
6) Ability to handle greater number of objective functions compared to other
techniques

Conclusion:

15
Bacterial foraging optimization is one of the best optimization techniques for economic dispatch.
The results obtained through our research show us that BFO gives minimum cost for our dispatch.
Bacterial foraging technique has the advantage of having less computational time, less
computational time, global convergence and more probability of convergence.

References
https://www.researchgate.net/publication/226084136_Bacterial_Foraging_Optimizati
on_Algorithm_Theoretical_Foundations_Analysis_and_Applications
https://ieeexplore.ieee.org/document/6153240/references#references
https://www.hindawi.com/journals/acisc/2012/897127/
[1] K. M. Passino, "Biomimicry of bacterial foraging for distributed optimization and
control, "IEEE Control Systems Magazine, vol. 22, no. 3, 2002 ,pp. 52-67.
[2] Tripathy M, Mishra S. Bacteria foraging-based to optimize both real power loss
and voltage stability limit. IEEE Transactions on Power Systems, 2007, 22(1):240-
248.
[3] Ulagammai L, Vankatesh P, Kannan P S, et al. Application of bacteria foraging
technique trained and artificial and wavelet neural networks in load forecasting.
Neurocomputing, 2007, 70(16/18):2659-2667.
[4] Yudong ZHANG, Lenan WU, Shuihua WANG. Bacterial Foraging Optimization
Based Neural Network for Short-term Load Forecasting. Journal of Computational
Information Systems, 2010, 6(7):2099–2105.
[5] Chen H, Zhu Y, Hu K. Multi-colony bacteria foraging optimization with cell-to-cell
communication for RFID network planning. Applied Soft Computing, 2010, 10:539-
547.
[6] P. G. Kou, J. Z. Zhou, Y. Y. He, X. Q. Xiang, C. S. Li, Optimal PID governor
tuning of hydraulic turbine generators with bacterial foraging particle swarm
optimization algorithm, Proc. Chin. Soc. Electr. Eng. 2009, 29(26):101–106.
[7] B. Niu, Y. Fan, H. Xiao, B. Xue, Bacterial foraging based approaches to portfolio
optimization with liquidity risk, Neurocomputing, 2012, 98:90 –100.
[8] S. Dasgupta, S. Das, A. Abraham, A. Biswas, Adaptive computational chemotaxis
in bacterial foraging optimization: an analysis. IEEE Trans. Evol. Comput, 2009,
13(3):919-941.
[9] Shao Y. , Chen H. The optimization of cooperative bacterial foraging. World
Congress on Software Engineering, 2009, 2:519-523.
[10] Tan, L. J. , Lin F. Y. , Wang H. Adaptive comprehensive learning bacterial
foraging optimization and its application on vehicle routing problem with time
windows. Neurocomputing, 2015, 151:1208-1215.
[11] Kim D. H. , Abraham. A. , Cho. J. H. , "A hybrid genetic algorithm and bacterial
foraging approach for global optimization, "Information Sciences, 2007, Vol. 177, no.
18, pp. 3918-3937.
[12] A. Biswas, S. Dasgupta, S. Das, and A. Abraham, "Synergy of PSO and
Bacterial Foraging Optimization: Comparative Study on Numerical Benchmarks,
"Second International Symposium on Hybrid Artificial Intelligent Systems(HAIS

16
2007), Advances in Soft computing Series, Springer Verlag, Germany, E. Corchado
et al. (Eds. ):Innovations in Hybrid Intelligent Systems, ASC 44, 2007, pp. 255-263.
[13] Wael Mansour Korani, "Bacterial foraging oriented by particle swarm
optimization strategy for PID tuning, "Proceedings of the 2008 GECCO conference
companion on Genetic and evolutionary computation, Atlanta, GA, USA, 2008, pp.
12-16.
[14] Arijit Biswas, Sambarta Dasgupta, Swagatam Das, and Ajith Abraham, "A
Synergy of Differential Evolution and Bacterial Foraging Algorithm for Global
Optimization, "International Journal on Neuraland MassParallel Computing and
Information Systems, Neural Network World, 2007, Vol. 17, no. 6, pp. 607-626.
[15] Wang Xuesong, Cheng Yuhu, Hao Minglin, "Estimation of Distribution Algorithm
based on bacterial foraging and its application in predictive control, "acta electronica
sinica, 2010. 2, vol. 38, no. 2, pp. 333-339.
[16] N. Sarasiri, K. Suthamno, S. Sujitjorn, Bacterial foraging-Tabu search
metaheuristics for identification of nonlinear friction model, J. Appl. Math,
2012(Article ID 238563, 23 pages).
[17] MAI Xiongfa, LI Ling. Bacterial Foraging Algorithm Based on Quantum-behaved
Particle Swarm Optimization and Opposition-based Learning. Journal of
Computational Information Systems, 2013, 9(3):1157-1165.

17

You might also like