1 | Initialize the food sources and evaluate the nectar amount (fitness) of food sources | ||
2 | Send the employed bees to the current food source | ||
3 | Iteration = 0 | ||
4 | Do while (the termination conditions are not met) | ||
5 |
| /*Employed Bees’ Phase*/ | |
6 |
| For (each employed bee) | |
7 |
|
| Generate a candidate solution in its neighborhood following Equation (4) |
8 |
|
| Evaluate the candidate solution and apply greedy selection |
9 |
| End for | |
10 |
| Calculate the probability P for each food source according to Equation (5) | |
11 |
| /*Onlooker Bees’ Phase*/ | |
12 |
| For (each onlooker bee) | |
13 |
|
| Send onlooker bees to food sources by the roulette selection depending on P |
14 |
|
| Generate a candidate solution in its neighborhood following Equation (4) |
15 |
|
| Evaluate the candidate solution and apply greedy selection |
16 |
| End for | |
17 |
| /*Scout Bees’ Phase*/ | |
18 |
| If (any employed bee becomes scout bee) | |
19 |
|
| Send the scout bee to a randomly produced food source |
20 |
| End if | |
21 |
| Memorize the best solution achieved so far | |
22 |
| Iteration = Iteration + 1 | |
23 | End while | ||
24 | Output the best solution achieved |