The Bees Algorithm is a population-based search algorithm first developed by Prof. Duc Truong Pham and his research team at Cardiff University in 2005. It mimics the food foraging behaviour of swarms of honey bees. In its basic version, the algorithm performs a kind of neighbourhood search combined with random search and can be used for both combinatorial optimization and functional optimisation.

The algorithm requires a number of parameters to be set:

- number of scout bees (
*n*) - number of sites selected out of n visited sites (
*m*) - number of best sites out of m selected sites (
*e*) - number of bees recruited for best e sites (
*nep*) - number of bees recruited for the other (
*m-e*) selected sites (*nsp*) - initial size of patches (
*ngh*) which includes site and its neighbourhood - stopping criterion

1. Initialise population with random solutions.

2. Evaluate fitness of the population.

3. While (stopping criterion not met) //Forming new population.

4. Select sites for neighbourhood search.

5. Recruit bees for selected sites (more bees for best e sites) and evaluate fitness.

6. Select the fittest bee from each patch.

7. Assign remaining bees to search randomly and evaluate their fitness.

8. End While.

In the first step, the Bees Algorithm starts with the scout bees (n) being placed randomly in the search space. In step 2, the fitness of the sites visited by the scout bees are evaluated. In step 4, bees that have the highest fitness are chosen as “selected bees” and sites visited by them are chosen for neighbourhood search. Then, in steps 5 and 6, the algorithm conducts searches in the neighbourhood of the selected sites, assigning more bees to search near to the best e sites. The bees can be chosen directly according to the fitness associated with the sites they are visiting. Alternatively, the fitness values are used to determine the probability of the bees being selected. Searches in the neighbourhood of the best e sites which represent more promising solutions are made more detailed by recruiting more bees to follow them than the other selected bees. Together with scouting, this differential recruitment is a key operation of the Bees Algorithm. However, in step 6, for each patch only the bee with the highest fitness will be selected to form the next bee population. In nature, there is no such a restriction. This restriction is introduced here to reduce the number of points to be explored. In step 7, the remaining bees in the population are assigned randomly around the search space scouting for new potential solutions. These steps are repeated until a stopping criterion is met. At the end of each iteration, the colony will have two parts to its new population – those that were the fittest representatives from a patch and those that have been sent out randomly.