0% found this document useful (0 votes)
73 views2 pages

ABC PsuedoCode

The document provides pseudocode for the ABC (Artificial Bee Colony) algorithm in 13 steps. The ABC algorithm initializes a population of solutions and evaluates them. It then produces new candidate solutions near existing solutions and applies greedy selection. It calculates probability values for solutions based on fitness and uses these probabilities to select solutions to produce new candidates. If a solution is abandoned, it is replaced randomly. The best solution found is tracked over cycles until a maximum number of cycles is reached.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views2 pages

ABC PsuedoCode

The document provides pseudocode for the ABC (Artificial Bee Colony) algorithm in 13 steps. The ABC algorithm initializes a population of solutions and evaluates them. It then produces new candidate solutions near existing solutions and applies greedy selection. It calculates probability values for solutions based on fitness and uses these probabilities to select solutions to produce new candidates. If a solution is abandoned, it is replaced randomly. The best solution found is tracked over cycles until a maximum number of cycles is reached.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Detailed Pseudocode of the ABC Algorithm

1: Initialize the population of solutions xi,j

2: Evaluate the population

3: cycle=1

4: repeat

5: Produce new solutions (food source positions) υi,j in the neighbourhood of xi,j for the
employed bees using the formula υi,j = xi,j + Φij(xi,j - xk,j) (k is a solution in the
neighbourhood of i, Φ is a random number in the range [-1,1] )and evaluate them

6: Apply the greedy selection process between xi and υi

7: Calculate the probability values Pi for the solutions xi by means of their fitness
values using the equation (1)

fit i
Pi = SN
(1)
∑ fit
i =1
i

In order to calculate the fitness values of solutions we employed the following


equation (eq. 2):

⎧ 1 ⎫
⎪1 + f if f i ≥ 0⎪
⎪ i

fit i = ⎨ ⎬ (2)
⎪1 + abs ( f ) if f i < 0⎪
⎪ i

⎩ ⎭

Normalize Pi values into [0,1]

8: Produce the new solutions (new positions) υi for the onlookers from the solutions xi,
selected depending on Pi, and evaluate them

9: Apply the greedy selection process for the onlookers between xi and υi
10: Determine the abandoned solution (source), if exists, and replace it with a new
randomly produced solution xi for the scout using the equation (3)

xij=minj+rand(0,1)*(maxj-minj) (3)

11: Memorize the best food source position (solution) achieved so far

12: cycle=cycle+1

13: until cycle= Maximum Cycle Number (MCN)

You might also like