Revision as of 23:48, 3 July 2016 editMarco castellani 1965 (talk | contribs)76 editsNo edit summary← Previous edit | Latest revision as of 02:20, 12 January 2025 edit undoGreenC bot (talk | contribs)Bots2,590,068 edits Rescued 1 archive link; reformat 1 link. Wayback Medic 2.5 per Category:All articles with dead external links | ||
(69 intermediate revisions by 33 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Population-based search algorithm}} | |||
In ] and ], the '''Bees Algorithm''' is a population-based ] which was developed in 2005.<ref name="Pham & al, 2005">Pham DT, Ghanbarzadeh A, Koc E, Otri S, Rahim S and Zaidi M. The Bees Algorithm. Technical Note, Manufacturing Engineering Centre, Cardiff University, UK, 2005.</ref> It mimics the food foraging behaviour of honey bee colonies. In its basic version the algorithm performs a kind of neighbourhood search combined with global search, and can be used for both ] and ]. The only condition for the application of the Bees Algorithm is that some measure of topological distance between the solutions is defined. The effectiveness and specific abilities of the Bees Algorithm have been proven in a number of studies.<ref name="Pham & Castellani, 2009">Pham, D.T., Castellani, M. (2009), . Proc. ImechE, Part C, 223(12), 2919-2938.</ref><ref>Pham, D.T. and Castellani, M. (2013), , Soft Computing, 1-33.</ref><ref>Pham, D.T. and Castellani, M. (2015), , Cogent Engineering 2(1), 1091540.</ref> | |||
{{distinguish|Artificial bee colony algorithm}} | |||
In ] and ], the '''bees algorithm''' is a population-based ] which was developed by Pham, Ghanbarzadeh et al. in 2005.<ref name="Pham & al, 2005">Pham DT, Ghanbarzadeh A, Koc E, Otri S, Rahim S and Zaidi M. The Bees Algorithm. Technical Note, Manufacturing Engineering Centre, Cardiff University, UK, 2005.</ref> It mimics the food foraging behaviour of honey bee colonies. In its basic version the algorithm performs a kind of neighbourhood search combined with global search, and can be used for both ] and ]. The only condition for the application of the bees algorithm is that some measure of distance between the solutions is defined. The effectiveness and specific abilities of the bees algorithm have been proven in a number of studies.<ref name="Pham & Castellani, 2009">Pham, D.T., Castellani, M. (2009), . Proc. ImechE, Part C, 223(12), 2919-2938.</ref><ref>Pham, D.T. and Castellani, M. (2013), , Soft Computing, 1-33.</ref><ref>Pham, D.T. and Castellani, M. (2015), , Cogent Engineering 2(1), 1091540.</ref><ref name="Nasrinpour & Massah & Teshnehlab 2017">Nasrinpour, H. R., Massah Bavani, A., Teshnehlab, M., (2017), , Computers 2017, 6(1), 5; ({{doi|10.3390/computers6010005}})</ref><ref>Baronti, Luca & Castellani, Marco & Pham, D.. (2020),, Swarm and Evolutionary Computation. 59. 100746. 10.1016/j.swevo.2020.100746</ref> | |||
== Metaphor == | |||
] | |||
A colony of ] can extend itself over long distances (over 14 km)<ref name="Tereshko & Loengarov, 2005">Tereshko V., Loengarov A., (2005) {{Webarchive|url=https://web.archive.org/web/20140201175130/http://cis.uws.ac.uk/research/journal/V9/V9N3/bees.pdf |date=2014-02-01 }}. Journal of Computing and Information Systems, 9(3), 1-7.</ref> and in multiple directions simultaneously to harvest nectar or pollen from multiple food sources (flower patches). | |||
A small fraction of the colony constantly searches the environment looking for new flower patches. These scout bees move randomly in the area surrounding the hive, evaluating the profitability (net energy yield) of the food sources encountered.<ref name="Tereshko & Loengarov, 2005"/> When they return to the hive, the scouts deposit the food harvested. Those individuals that found a highly profitable food source go to an area in the hive called the “dance floor”, and perform a ritual known as the ].<ref>Von Frisch, K. (1967) The Dance Language and Orientation of Bees. Harvard University Press, Cambridge, Massachusetts.</ref> | |||
== Honey bees foraging strategy in nature == | |||
A colony of ] can extend itself over long distances (over 14 km) <ref name="Tereshko & Loengarov, 2005">Tereshko V., Loengarov A., (2005) . Journal of Computing and Information Systems, 9(3), 1-7.</ref> and in multiple directions simultaneously to harvest nectar or pollen from multiple food sources (flower patches). | |||
A small fraction of the colony constantly searches the environment looking for new flower patches. These scout bees move randomly in the area surrounding the hive, evaluating the profitability (net energy yield) of the food sources encountered.<ref name="Tereshko & Loengarov, 2005"/> When they return to the hive, the scouts deposit the food harvested. Those individuals that found a highly profitable food source go to an area in the hive called the “dance floor”, and perform a ritual known as the ].<ref>Von Frisch, K. (1967) The Dance Language and Orientation of Bees. Harvard University Press, Cambridge, MA.</ref> | |||
Through the waggle dance a scout bee communicates the location of its discovery to idle onlookers, which join in the exploitation of the flower patch. Since the length of the dance is proportional to the scout’s rating of the food source, more foragers get recruited to harvest the best rated flower patches. After dancing, the scout returns to the food source it discovered to collect more food. | Through the waggle dance a scout bee communicates the location of its discovery to idle onlookers, which join in the exploitation of the flower patch. Since the length of the dance is proportional to the scout’s rating of the food source, more foragers get recruited to harvest the best rated flower patches. After dancing, the scout returns to the food source it discovered to collect more food. | ||
As long as they are evaluated as profitable, rich food sources will be advertised by the scouts when they return to the hive. Recruited foragers may waggle dance as well, increasing the recruitment for highly rewarding flower patches. Thanks to this autocatalytic process, the bee colony is able to quickly switch the focus of the foraging effort on the most profitable flower patches.<ref name="Tereshko & Loengarov, 2005"/> | As long as they are evaluated as profitable, rich food sources will be advertised by the scouts when they return to the hive. Recruited foragers may waggle dance as well, increasing the recruitment for highly rewarding flower patches. Thanks to this autocatalytic process, the bee colony is able to quickly switch the focus of the foraging effort on the most profitable flower patches.<ref name="Tereshko & Loengarov, 2005"/> | ||
== |
== Algorithm == | ||
The |
The bees algorithm<ref name="Pham & Castellani, 2009"/><ref name="Pham & Ghanbarzadeh et. a. 2006">Pham D.T., Ghanbarzadeh A., Koc E., Otri S., Rahim S., Zaidi M., , Proc 2nd Int Virtual Conf on Intelligent Production Machines and Systems (IPROMS 2006), Oxford: Elsevier, pp. 454-459, 2006.</ref> mimics the foraging strategy of honey bees to look for the best solution to an optimisation problem. Each candidate solution is thought of as a food source (flower), and a population (colony) of ''n'' agents (bees) is used to search the solution space. Each time an artificial bee visits a flower (lands on a solution), it evaluates its profitability (fitness). | ||
The Bees Algorithm consists of an initialisation procedure and a main search cycle which is iterated for a given number ''T'' of times, or until a solution of acceptable fitness is found. Each search cycle is composed of five procedures: recruitment, local search, neighbourhood shrinking, site abandonment, and global search.<br /> | |||
The bees algorithm consists of an initialisation procedure and a main search cycle which is iterated for a given number ''T'' of times, or until a solution of acceptable fitness is found. Each search cycle is composed of five procedures: recruitment, local search, neighbourhood shrinking, site abandonment, and global search. | |||
'''The pseudocode for the standard Bees Algorithm'''<ref name="Pham & Castellani, 2009"/> | |||
'''Pseudocode for the standard bees algorithm'''<ref name="Pham & Castellani, 2009"/> | |||
1 for i=1,…,ns | 1 for i=1,…,ns | ||
i scout=Initialise_scout() | i scout=Initialise_scout() | ||
Line 18: | Line 20: | ||
2 do until stopping_condition=TRUE | 2 do until stopping_condition=TRUE | ||
i Recruitment() | i Recruitment() | ||
ii for i =1, |
ii for i =1,...,na | ||
1 flower_patch=Local_search(flower_patch) | 1 flower_patch=Local_search(flower_patch) | ||
2 flower_patch=Site_abandonment(flower_patch) | 2 flower_patch=Site_abandonment(flower_patch) | ||
3 flower_patch=Neighbourhood_shrinking(flower_patch) | 3 flower_patch=Neighbourhood_shrinking(flower_patch) | ||
iii for i = nb, |
iii for i = nb,...,ns | ||
1 flower_patch=Global_search(flower_patch)} | 1 flower_patch=Global_search(flower_patch)} | ||
In the initialisation routine ''ns'' scout bees are randomly placed in the search space, and evaluate the fitness of the solutions where they land. For each solution, a neighbourhood (called flower patch) is delimited. |
In the initialisation routine ''ns'' scout bees are randomly placed in the search space, and evaluate the fitness of the solutions where they land. For each solution, a neighbourhood (called flower patch) is delimited. | ||
In the recruitment procedure, the scouts that visited the ''nb''≤''ns'' fittest solutions (best sites) perform the waggle dance. That is, they recruit foragers to search further the neighbourhoods of the most promising solutions. The scouts that located the very best ''ne''≤''nb'' solutions (elite sites) recruit ''nre'' foragers each, whilst the remaining ''nb''-''ne'' scouts recruit ''nrb''≤''nre'' foragers each. Thus, the number of foragers recruited depends on the profitability of the food source. <br /> | |||
In the local search procedure, the recruited foragers are randomly scattered within the flower patches enclosing the solutions visited by the scouts (local exploitation). If any of the foragers in a flower patch lands on a solution of higher fitness than the solution visited by the scout, that forager becomes the new scout. If no forager finds a solution of higher fitness, the size of the flower patch is shrunk (neighbourhood shrinking procedure). Usually, flower patches are initially defined over a large area, and their size is gradually shrunk by the neighbourhood shrinking procedure. As a result, the scope of the local exploration is progressively focused on the area immediately close to the local fitness best. If no improvement in fitness is recorded in a given flower patch for a pre-set number of search cycles, the local maximum of fitness is considered found, the patch is abandoned (site abandonment), and a new scout is randomly generated. |
In the recruitment procedure, the scouts that visited the ''nb''≤''ns'' fittest solutions (best sites) perform the waggle dance. That is, they recruit foragers to search further the neighbourhoods of the most promising solutions. The scouts that located the very best ''ne''≤''nb'' solutions (elite sites) recruit ''nre'' foragers each, whilst the remaining ''nb''-''ne'' scouts recruit ''nrb''≤''nre'' foragers each. Thus, the number of foragers recruited depends on the profitability of the food source. | ||
In the local search procedure, the recruited foragers are randomly scattered within the flower patches enclosing the solutions visited by the scouts (local exploitation). If any of the foragers in a flower patch lands on a solution of higher fitness than the solution visited by the scout, that forager becomes the new scout. If no forager finds a solution of higher fitness, the size of the flower patch is shrunk (neighbourhood shrinking procedure). Usually, flower patches are initially defined over a large area, and their size is gradually shrunk by the neighbourhood shrinking procedure. As a result, the scope of the local exploration is progressively focused on the area immediately close to the local fitness best. If no improvement in fitness is recorded in a given flower patch for a pre-set number of search cycles, the local maximum of fitness is considered found, the patch is abandoned (site abandonment), and a new scout is randomly generated. | |||
As in biological bee colonies,<ref name="Tereshko & Loengarov, 2005"/> a small number of scouts keeps exploring the solution space looking for new regions of high fitness (global search). The global search procedure re-initialises the last ''ns''-''nb'' flower patches with randomly generated solutions.<br /> | |||
As in biological bee colonies,<ref name="Tereshko & Loengarov, 2005"/> a small number of scouts keeps exploring the solution space looking for new regions of high fitness (global search). The global search procedure re-initialises the last ''ns''-''nb'' flower patches with randomly generated solutions. | |||
At the end of one search cycle, the scout population is again composed of ''ns'' scouts: ''nr'' scouts produced by the local search procedure (some of which may have been re-initialised by the site abandonment procedure), and ''ns''-''nb'' scouts generated by the global search procedure. The total artificial bee colony size is ''n''=''ne''•''nre''+(''nb''-''ne'')•''nrb''+''ns'' (elite sites foragers + remaining best sites foragers + scouts) bees. | At the end of one search cycle, the scout population is again composed of ''ns'' scouts: ''nr'' scouts produced by the local search procedure (some of which may have been re-initialised by the site abandonment procedure), and ''ns''-''nb'' scouts generated by the global search procedure. The total artificial bee colony size is ''n''=''ne''•''nre''+(''nb''-''ne'')•''nrb''+''ns'' (elite sites foragers + remaining best sites foragers + scouts) bees. | ||
== |
== Variants == | ||
In addition to the basic bees algorithm,<ref name="Pham & Ghanbarzadeh et. a. 2006"/> there are a number of improved or hybrid versions of the BA, each of which focuses on some shortcomings of the basic BA. These variants include (but are not limited to) fuzzy or enhanced BA (EBA),<ref name="Pham & Darwish 008">Pham D. T., Haj Darwish A., (2008), A. . Proceedings of Innovative Production Machines and Systems (IPROMS 2008)</ref> grouped BA (GBA),<ref name="Nasrinpour & Massah & Teshnehlab 2017"/> hybrid modified BA (MBA)<ref name="Pham & Pham & Castellani 2011">Pham Q. T., Pham D. T., Castellani M., A modified Bees Algorithm and a statistics-based method for tuning its parameters. Proceedings of the Institution of Mechanical Engineers (ImechE), Part I: Journal of Systems and Control Eng., 2011 ({{doi|10.1177/0959651811422759}})</ref> and so on. | |||
{{Dynamic list}} | |||
The pseudo-code for the '''grouped BA (GBA)''' <ref name="Nasrinpour & Massah & Teshnehlab 2017"/> is as follows. | |||
The Bees Algorithm has found many applications in engineering, such as: | |||
<syntaxhighlight lang="matlab"> | |||
Optimisation of classifiers / clustering systems <ref>Pham D.T., Zaidi M., Mahmuddin M., Ghanbarzadeh A., Koç E., Otri S. (2007), , IPROMS 2007 Innovative Production Machines and Systems Virtual Conference.</ref><ref>Pham D.T., Darwish A.H. (2010), , Journal of Systems and Control Engineering 224(7), 885-892.</ref><ref>Pham D.T., Suarez-Alvarez M.M., Prostov Y.I. (2011), , Proceedings Royal Society, 467, 2387-2403.</ref> | |||
function GBA | |||
%% Set the problem parameters | |||
maxIteration = ..; % number of iterations (e.g. 1000-5000) | |||
maxParameters = ..; % number of input variables | |||
min = ; % an array of the size maxParameters to indicate the minimum value of each input parameter | |||
max = ; % an array of the size maxParameters to indicate the maximum value of each input parameter | |||
%% Set the grouped bees algorithm (GBA) parameters | |||
Manufacturing<ref>Pham D.T., Castellani M., Ghanbarzadeh A. (2007), Preliminary design using the Bees Algorithm, Proceedings Eighth LAMDAMAP International Conference on Laser Metrology, CMM and Machine Tool Performance. Cardiff - UK, 420-429.</ref><ref>Pham, D.T., Otri S., Darwish A.H. (2007), Application of the Bees Algorithm to PCB assembly optimisation, Proceedings 3rd International Virtual Conference on Intelligent Production Machines and Systems (IPROMS 2007), Whittles, Dunbeath, Scotland, 511-516.</ref><ref>Pham D.T., Koç E., Lee J.Y., Phrueksanant J. (2007), Using the Bees Algorithm to Schedule Jobs for a Machine, Proceedings 8th international Conference on Laser Metrology, CMM and Machine Tool Performance (LAMDAMAP). Cardiff, UK, Euspen, 430-439.</ref><ref>Baykasoğlu A., Özbakır L., Tapkan P. (2009), , European Journal Industrial Engineering 3(4) 424-435.</ref><ref>Özbakır L., Tapkan P. (2011), , Expert Systems with Applications 38, 11947-11957.</ref><ref>Xu W., Zhou Z., Pham D.T., Liu Q., Ji C., Meng W. (2012), , International Journal Advanced Manufacturing Technology, 63(9-12), 1227-1237.</ref> | |||
R_ngh = ..; % patch radius of the neighborhood search for bees in the first group (e.g. 0.001 - 1) | |||
n = ..; % number of scout bees (e.g. 4-30) | |||
nGroups = ..; % number of groups, excluding the random group | |||
%% GBA's automatic parameter settings | |||
Control<ref>Pham D.T., Darwish A.H., Eldukhri E.E. (2009), , International Journal of Computer Aided Engineering and Technology, 1, 250-264.</ref><ref>Alfi A., Khosravi A., Razavi S.E. (2011), Bee Algoritm–Based Nolinear Optimal Control Applied To A Continuous Stirred-Tank Chemical Reactor, Global Journal of Pure & Applied Science and Technology - GJPAST 1(2), 73-79.</ref><ref>Fahmy A.A., Kalyoncu M., Castellani M. (2012), , Proceedings of the Institution of Mechanical Engineers, Part I: Journal of Systems and Control Engineering, 226(4), 497-508.</ref><ref>Castellani M., Pham Q.T., Pham D.T. (2012), , Proceedings of the Institution of Mechanical Engineers, Part I: Journal of Systems and Control Engineering, 226(7), 956–971.</ref> | |||
k = 3 * n / ((nGroups+1)^3 - 1); % GBA's parameter to set the number of scout bees in each group | |||
groups = zeros(1,nGroups); % An array to keep the number of scout bees for each group | |||
recruited_bees = zeros(1,nGroups); % An array to keep the number of recruited bees for each group | |||
a = (((max - min) ./ 2) - R_ngh) ./ (nGroups^2 - 1); % GBA's parameter for setting neighborhood radiuses | |||
b = R_ngh - a; % GBA's parameter for setting neighborhood radiuses | |||
for i=1:nGroups % For each group | |||
groups(i) = floor(k*i^2); % determine the number of scout bees in each group | |||
if groups(i) == 0 | |||
groups(i) = 1; % there has to be at least one scout bee per each group | |||
end | |||
recruited_bees = (nGroups+1-i)^2; % set the number of recruited bees for each group | |||
ngh(i) = a * i*i + b; % set the radius patch for each group | |||
end | |||
group_random = n - sum(groups); % assign the remainder bees (if any) to random search | |||
group_random = max(group_random,0); % make sure it is not a negative number | |||
%% initialize the population matrix | |||
Bioengineering<ref>Bahamish H.A.A., Abdullah R., Salam R.A. (2008), , Second Asia International Conference on Modeling & Simulation (AICMS 08), Kuala Lumpur, Malaysia, IEEE Press, 911-916.</ref><ref>Ruz G.A., Goles E. (2013), , Neural Computing and Applications, 22(1), 63-70.</ref> | |||
population = zeros(n,maxParameters+1); % A population of n bees including all input variables and their fitness | |||
for i=1:n | |||
population(i,1:maxParameters)= generate_random_solution(maxParameters,min, max); % random initialization of maxParameters variables between max and min | |||
population(i,maxParameters+1) = evalulate_fitness(population(i,:)); % fitness evaluation of each solution and saving it at the last index of the population matrix | |||
end | |||
sorted_population = sortrows(population); % sort the population based on their fitnesses | |||
Other optimisation problems<ref>Guney K., Onay M. (2010), , Expert Systems with Applications 37, 3129–3135.</ref><ref>Xu S., Yu F., Luo Z., Ji Z., Pham D.T., Qiu R. (2011), , The Computer Journal 54(9), 1416-1426.</ref><ref>Pham D.T., Koç E. (2011), , International Journal Automation and Computing 7(3) 399-402.</ref><ref>Kavousi A., Vahidi B., Salehi R., Bakhshizadeh M.K., Farokhnia N., Fathi S.H. (2012), , IEEE Transactions on Power Electronics 27(4) 1689-1696.</ref><ref>Jevtic A., Gutierrez-Martin A., Andina D.A., Jamshidi M. (2012), , IEEE Systems Journal 6(2) 296-304.</ref> | |||
%% Iterations of the grouped bees algorithm | |||
Multi-objective optimisation<ref>{{cite journal|last1=Morsali|first1=Roozbeh|last2=Mohammadi|first2=Mohsen|last3=Maleksaeedi|first3=Iman|last4=Ghadimi|first4=Noradin|title=A new multiobjective procedure for solving nonconvex environmental/economic power dispatch|journal=Complexity|volume=20|issue=2|pages=47-62|doi=10.1002/cplx.21505|url=http://onlinelibrary.wiley.com/doi/10.1002/cplx.21505/full}}</ref><ref>Lee J.Y., Darwish A.H. (2008), , Proceedings of the EU-Korea Conference on Science and Technology (EKC2008), Ed. S.D. Yoo, Heidelberg, D, Springer Berlin Heidelberg, 267-274.</ref><ref>Sayadi F., Ismail M., Misran N., Jumari K. (2009), Multi-Objective Optimization Using the Bees Algorithm in Time-Varying Channel for MIMO MC-CDMA Systems, European Journal of Scientific Research 33(3), 411-428.</ref><ref>Mansouri Poor M., Shisheh Saz M. (2012), Multi-Objective Optimization of Laminates with Straight Free Edges and Curved Free Edges by Using Bees Algorithm, American Journal of Advanced Scientific Research 1(4), 130-136.</ref> | |||
for i=1:maxIteration % GBA's main loop | |||
beeIndex = 0; % keep track of all bees (i.e, patches) | |||
for g=1:nGroups % for each group of scout bees | |||
for j = 1 : groups(g) % exploit each patch within each group | |||
beeIndex = beeIndex + 1; % increase the counter per each patch | |||
for i = 1 : recruited_bees(g) % for each recruited bees of the group | |||
solution = bee_waggle_dance(sorted_population(beeIndex,1:maxParameters),ngh(g)); % search the neighborhood around selected patch/solution within the radius of ngh | |||
fit = evaluate_fitness(solution); % evaluate the fitness of recently found solution | |||
if fit < sorted_population(beeIndex,maxParameters+1) % A minimization problem: if a better location/patch/solution is found by the recuiter bee | |||
sorted_population(beeIndex,1 : maxParameters+1) = ; % copy new solution and its fitness to the sorted population matrix | |||
end | |||
end | |||
end | |||
end | |||
for i= 1 : group_random % For the remaining random bees | |||
beeIndex = beeIndex + 1; | |||
solution(beeIndex,1:maxParameters)= generate_random_solution(maxParameters,min, max); % generate a new random solution at the index beeIndex | |||
solution(beeIndex,maxParameters+1)= evaluate_fitness(solution); % evaluate its fitness | |||
sorted_population(beeIndex,:) = ; % copy the new random solution and its fitness to the sorted population matrix | |||
end | |||
sorted_population=sortrows(sorted_population); % sort the population based on their fitnesses | |||
Best_solution_sofar=sorted_population(1,:); | |||
disp('Best:');disp(Best_solution_sofar); % Display the best solution of current iteration | |||
end % end of GBA's main loop | |||
end % end of main function | |||
%% Function Bee Waggle Dance | |||
function new_solution=bee_waggle_dance(solution, ngh, maxParameters) | |||
new_solution(1:maxParameters) = (solution-ngh)+(2*ngh.*rand(1, maxParameters)); | |||
end | |||
</syntaxhighlight> | |||
==See also== | ==See also== | ||
*] | |||
*] | |||
*] | |||
*] | |||
*] | |||
*] | *] | ||
*] | *] | ||
*] | *] | ||
*] | *] | ||
*] | *] | ||
*] | |||
*] | |||
*] | |||
*] | |||
==References== | ==References== | ||
Line 63: | Line 131: | ||
==External links== | ==External links== | ||
* | * | ||
* | * | ||
* | |||
* | |||
{{collective animal behaviour}} | {{collective animal behaviour}} | ||
{{Optimization algorithms}} | {{Optimization algorithms}} | ||
{{DEFAULTSORT:Bees |
{{DEFAULTSORT:Bees algorithm}} | ||
] | ] | ||
] | |||
] | |||
] | |||
] |
Latest revision as of 02:20, 12 January 2025
Population-based search algorithm Not to be confused with Artificial bee colony algorithm.In computer science and operations research, the bees algorithm is a population-based search algorithm which was developed by Pham, Ghanbarzadeh et al. in 2005. It mimics the food foraging behaviour of honey bee colonies. In its basic version the algorithm performs a kind of neighbourhood search combined with global search, and can be used for both combinatorial optimization and continuous optimization. The only condition for the application of the bees algorithm is that some measure of distance between the solutions is defined. The effectiveness and specific abilities of the bees algorithm have been proven in a number of studies.
Metaphor
A colony of honey bees can extend itself over long distances (over 14 km) and in multiple directions simultaneously to harvest nectar or pollen from multiple food sources (flower patches). A small fraction of the colony constantly searches the environment looking for new flower patches. These scout bees move randomly in the area surrounding the hive, evaluating the profitability (net energy yield) of the food sources encountered. When they return to the hive, the scouts deposit the food harvested. Those individuals that found a highly profitable food source go to an area in the hive called the “dance floor”, and perform a ritual known as the waggle dance. Through the waggle dance a scout bee communicates the location of its discovery to idle onlookers, which join in the exploitation of the flower patch. Since the length of the dance is proportional to the scout’s rating of the food source, more foragers get recruited to harvest the best rated flower patches. After dancing, the scout returns to the food source it discovered to collect more food. As long as they are evaluated as profitable, rich food sources will be advertised by the scouts when they return to the hive. Recruited foragers may waggle dance as well, increasing the recruitment for highly rewarding flower patches. Thanks to this autocatalytic process, the bee colony is able to quickly switch the focus of the foraging effort on the most profitable flower patches.
Algorithm
The bees algorithm mimics the foraging strategy of honey bees to look for the best solution to an optimisation problem. Each candidate solution is thought of as a food source (flower), and a population (colony) of n agents (bees) is used to search the solution space. Each time an artificial bee visits a flower (lands on a solution), it evaluates its profitability (fitness).
The bees algorithm consists of an initialisation procedure and a main search cycle which is iterated for a given number T of times, or until a solution of acceptable fitness is found. Each search cycle is composed of five procedures: recruitment, local search, neighbourhood shrinking, site abandonment, and global search.
Pseudocode for the standard bees algorithm 1 for i=1,…,ns i scout=Initialise_scout() ii flower_patch=Initialise_flower_patch(scout) 2 do until stopping_condition=TRUE i Recruitment() ii for i =1,...,na 1 flower_patch=Local_search(flower_patch) 2 flower_patch=Site_abandonment(flower_patch) 3 flower_patch=Neighbourhood_shrinking(flower_patch) iii for i = nb,...,ns 1 flower_patch=Global_search(flower_patch)}
In the initialisation routine ns scout bees are randomly placed in the search space, and evaluate the fitness of the solutions where they land. For each solution, a neighbourhood (called flower patch) is delimited.
In the recruitment procedure, the scouts that visited the nb≤ns fittest solutions (best sites) perform the waggle dance. That is, they recruit foragers to search further the neighbourhoods of the most promising solutions. The scouts that located the very best ne≤nb solutions (elite sites) recruit nre foragers each, whilst the remaining nb-ne scouts recruit nrb≤nre foragers each. Thus, the number of foragers recruited depends on the profitability of the food source.
In the local search procedure, the recruited foragers are randomly scattered within the flower patches enclosing the solutions visited by the scouts (local exploitation). If any of the foragers in a flower patch lands on a solution of higher fitness than the solution visited by the scout, that forager becomes the new scout. If no forager finds a solution of higher fitness, the size of the flower patch is shrunk (neighbourhood shrinking procedure). Usually, flower patches are initially defined over a large area, and their size is gradually shrunk by the neighbourhood shrinking procedure. As a result, the scope of the local exploration is progressively focused on the area immediately close to the local fitness best. If no improvement in fitness is recorded in a given flower patch for a pre-set number of search cycles, the local maximum of fitness is considered found, the patch is abandoned (site abandonment), and a new scout is randomly generated.
As in biological bee colonies, a small number of scouts keeps exploring the solution space looking for new regions of high fitness (global search). The global search procedure re-initialises the last ns-nb flower patches with randomly generated solutions.
At the end of one search cycle, the scout population is again composed of ns scouts: nr scouts produced by the local search procedure (some of which may have been re-initialised by the site abandonment procedure), and ns-nb scouts generated by the global search procedure. The total artificial bee colony size is n=ne•nre+(nb-ne)•nrb+ns (elite sites foragers + remaining best sites foragers + scouts) bees.
Variants
In addition to the basic bees algorithm, there are a number of improved or hybrid versions of the BA, each of which focuses on some shortcomings of the basic BA. These variants include (but are not limited to) fuzzy or enhanced BA (EBA), grouped BA (GBA), hybrid modified BA (MBA) and so on. The pseudo-code for the grouped BA (GBA) is as follows.
function GBA %% Set the problem parameters maxIteration = ..; % number of iterations (e.g. 1000-5000) maxParameters = ..; % number of input variables min = ; % an array of the size maxParameters to indicate the minimum value of each input parameter max = ; % an array of the size maxParameters to indicate the maximum value of each input parameter %% Set the grouped bees algorithm (GBA) parameters R_ngh = ..; % patch radius of the neighborhood search for bees in the first group (e.g. 0.001 - 1) n = ..; % number of scout bees (e.g. 4-30) nGroups = ..; % number of groups, excluding the random group %% GBA's automatic parameter settings k = 3 * n / ((nGroups+1)^3 - 1); % GBA's parameter to set the number of scout bees in each group groups = zeros(1,nGroups); % An array to keep the number of scout bees for each group recruited_bees = zeros(1,nGroups); % An array to keep the number of recruited bees for each group a = (((max - min) ./ 2) - R_ngh) ./ (nGroups^2 - 1); % GBA's parameter for setting neighborhood radiuses b = R_ngh - a; % GBA's parameter for setting neighborhood radiuses for i=1:nGroups % For each group groups(i) = floor(k*i^2); % determine the number of scout bees in each group if groups(i) == 0 groups(i) = 1; % there has to be at least one scout bee per each group end recruited_bees = (nGroups+1-i)^2; % set the number of recruited bees for each group ngh(i) = a * i*i + b; % set the radius patch for each group end group_random = n - sum(groups); % assign the remainder bees (if any) to random search group_random = max(group_random,0); % make sure it is not a negative number %% initialize the population matrix population = zeros(n,maxParameters+1); % A population of n bees including all input variables and their fitness for i=1:n population(i,1:maxParameters)= generate_random_solution(maxParameters,min, max); % random initialization of maxParameters variables between max and min population(i,maxParameters+1) = evalulate_fitness(population(i,:)); % fitness evaluation of each solution and saving it at the last index of the population matrix end sorted_population = sortrows(population); % sort the population based on their fitnesses %% Iterations of the grouped bees algorithm for i=1:maxIteration % GBA's main loop beeIndex = 0; % keep track of all bees (i.e, patches) for g=1:nGroups % for each group of scout bees for j = 1 : groups(g) % exploit each patch within each group beeIndex = beeIndex + 1; % increase the counter per each patch for i = 1 : recruited_bees(g) % for each recruited bees of the group solution = bee_waggle_dance(sorted_population(beeIndex,1:maxParameters),ngh(g)); % search the neighborhood around selected patch/solution within the radius of ngh fit = evaluate_fitness(solution); % evaluate the fitness of recently found solution if fit < sorted_population(beeIndex,maxParameters+1) % A minimization problem: if a better location/patch/solution is found by the recuiter bee sorted_population(beeIndex,1 : maxParameters+1) = ; % copy new solution and its fitness to the sorted population matrix end end end end for i= 1 : group_random % For the remaining random bees beeIndex = beeIndex + 1; solution(beeIndex,1:maxParameters)= generate_random_solution(maxParameters,min, max); % generate a new random solution at the index beeIndex solution(beeIndex,maxParameters+1)= evaluate_fitness(solution); % evaluate its fitness sorted_population(beeIndex,:) = ; % copy the new random solution and its fitness to the sorted population matrix end sorted_population=sortrows(sorted_population); % sort the population based on their fitnesses Best_solution_sofar=sorted_population(1,:); disp('Best:');disp(Best_solution_sofar); % Display the best solution of current iteration end % end of GBA's main loop end % end of main function %% Function Bee Waggle Dance function new_solution=bee_waggle_dance(solution, ngh, maxParameters) new_solution(1:maxParameters) = (solution-ngh)+(2*ngh.*rand(1, maxParameters)); end
See also
- Ant colony optimization algorithms
- Artificial bee colony algorithm
- Evolutionary computation
- Lévy flight foraging hypothesis
- Manufacturing Engineering Centre
- Mathematical optimization
- Metaheuristic
- Particle swarm optimization
- Swarm intelligence
References
- Pham DT, Ghanbarzadeh A, Koc E, Otri S, Rahim S and Zaidi M. The Bees Algorithm. Technical Note, Manufacturing Engineering Centre, Cardiff University, UK, 2005.
- ^ Pham, D.T., Castellani, M. (2009), The Bees Algorithm – Modelling Foraging Behaviour to Solve Continuous Optimisation Problems. Proc. ImechE, Part C, 223(12), 2919-2938.
- Pham, D.T. and Castellani, M. (2013), Benchmarking and Comparison of Nature-Inspired Population-Based Continuous Optimisation Algorithms, Soft Computing, 1-33.
- Pham, D.T. and Castellani, M. (2015), A comparative study of the bees algorithm as a tool for function optimisation, Cogent Engineering 2(1), 1091540.
- ^ Nasrinpour, H. R., Massah Bavani, A., Teshnehlab, M., (2017), Grouped Bees Algorithm: A Grouped Version of the Bees Algorithm, Computers 2017, 6(1), 5; (doi:10.3390/computers6010005)
- Baronti, Luca & Castellani, Marco & Pham, D.. (2020),An Analysis of the Search Mechanisms of the Bees Algorithm., Swarm and Evolutionary Computation. 59. 100746. 10.1016/j.swevo.2020.100746
- ^ Tereshko V., Loengarov A., (2005) Collective Decision-Making in Honey Bee Foraging Dynamics Archived 2014-02-01 at the Wayback Machine. Journal of Computing and Information Systems, 9(3), 1-7.
- Von Frisch, K. (1967) The Dance Language and Orientation of Bees. Harvard University Press, Cambridge, Massachusetts.
- ^ Pham D.T., Ghanbarzadeh A., Koc E., Otri S., Rahim S., Zaidi M., The Bees Algorithm, A Novel Tool for Complex Optimisation Problems, Proc 2nd Int Virtual Conf on Intelligent Production Machines and Systems (IPROMS 2006), Oxford: Elsevier, pp. 454-459, 2006.
- Pham D. T., Haj Darwish A., (2008), A. Fuzzy Selection of Local Search Sites in the Bees Algorithm. Proceedings of Innovative Production Machines and Systems (IPROMS 2008)
- Pham Q. T., Pham D. T., Castellani M., A modified Bees Algorithm and a statistics-based method for tuning its parameters. Proceedings of the Institution of Mechanical Engineers (ImechE), Part I: Journal of Systems and Control Eng., 2011 (doi:10.1177/0959651811422759)
External links
Swarming | ||
---|---|---|
Biological swarming | ||
Animal migration | ||
Swarm algorithms | ||
Collective motion | ||
Swarm robotics | ||
Related topics |