Employed bees
Each employed bee is assigned to one food source (candidate solution). It produces a neighbouring candidate and replaces the current one if it is better (greedy selection).
Algorithm
ABC is a loop of three repeating phases. Employed and onlooker bees improve existing solutions (exploitation), while scout bees jump to new regions of the search space (exploration).
ABC repeats three phases. Employed and onlooker bees exploit current solutions; scout bees provide exploration to escape local optima.
Each employed bee is assigned to one food source (candidate solution). It produces a neighbouring candidate and replaces the current one if it is better (greedy selection).
Onlookers choose sources based on the information shared by employed bees. Selection probability is proportional to source quality, so better sources are exploited more.
A source that cannot be improved within limit trials is abandoned; its bee becomes a scout and generates a new random source. This is what lets the search escape local optima.
1: Generate and evaluate the initial food sources 2: repeat 3: EMPLOYED BEE PHASE 4: for each source produce a neighbour candidate, evaluate, select greedily 5: ONLOOKER BEE PHASE 6: choose a source with probability proportional to its fitness 7: produce a neighbour candidate, evaluate, select greedily 8: SCOUT BEE PHASE 9: abandon a source not improved for 'limit' trials, produce a random new one 10: memorize the best solution found so far 11: until (the maximum cycle number is reached)
| Parameter | Description |
|---|---|
| SN | Number of food sources |
| limit | Trials before a source is abandoned |
| MCN | Maximum cycle number |
To follow one cycle step by step see the worked example, and for benchmark results see the data.