1. Initialization: Initialize parameters (, K and so on; |
2. Initial solutions: Randomly generated food sources , K}; |
3. Loop: |
For to do: |
{ |
(1) For to K do: (local searches performed by employed bees) |
{Associate each employed bee with a food source and compute its nectar amount; |
Find a new in the neighborhood of and compute its nectar amount; |
Take the better one in , as a new location of the employed bee;} |
(2) For to K do: (further local searches performed by onlooker bees) |
{Select a food source from for every onlooker bee; |
Find a new in the neighborhood of and compute its nectar amount; |
Take the better one in , as a new location of the corresponding bees;} |
( ) Exploiting new food sources (global searches with a guidance performed by scout bees) |
For to K do: (food sources) |
{If then ; |
If then |
{Abandon food source and the associated employed bee becomes a scout; |
=, ; |
Repeat (constructing a new solution) |
Select an object with given by (2); |
Add the object into the current solution: ; |
; |
Until is empty |
The scout bee becomes again an employed bee; |
;}} |
( ) Generating, diffusing and updating the pheromone |
For each object in |
Calculate the according to (7) and (8). |
Select the Top- solutions from this iteration, and obtain ; |
For each solution |
{For each pair of objects in |
.count++; |
Calculate the associated distance |
Calculate according to (9);} |
For each object in |
Update the trail level on all objects according to (6) and (10); |
(5) Perform the local optimization in 1-1 or 2-1 exchange ways; |
(6) Memorize the best food source found so far; |
; |
} |
4. Output: Return while the predefined end condition is met. |