
26 Artificial Bee Colony Algorithm
193 fo r ( j = 0 ; j <D; j ++)
194 top = t op + s o l [ j ] ∗ s o l [ j ] ;
195 return top ;
196 }
Listing 2.2
ABC Source-code implemented using C++
2.5 Step-by-step numerical example of the ABC
algorithm
In this chapter, a numerical example of how the ABC algorithm works is given
step by step to solve the Sphere problem. Assume that the problem dimen-
sion (D) is 5 and the search space range is [−5.12, 5.12] in all dimensions. The
value of the limit parameter is 2 and the number of food sources (SN) is 6.
X
i
(i = 1, 2, . . . , SN) solutions are initialized by Eq. 2.1 and when each food
source location is evaluated in the ...