Algorithm

How it works

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.

1

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).

2

Onlooker bees

Onlookers choose sources based on the information shared by employed bees. Selection probability is proportional to source quality, so better sources are exploited more.

3

Scout bees

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.

Pseudocode

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)

Control parameters

ParameterDescription
SNNumber of food sources
limitTrials before a source is abandoned
MCNMaximum cycle number

To follow one cycle step by step see the worked example, and for benchmark results see the data.

Kayseri'den Dünyaya Yayılan ABC Algoritması0:00 / 23:01 · 1/14