You are on page 1of 17

Planning & Scheduling in

Manufacturing
Lecture # 14 Artificial Bee Colony Algorithm
Artificial Bee Colony Algor
The artificial bee colony algorithm is a population base optimization
algorithm inspired by the foraging behavior of honeybees. It is commonly
used to solve optimization problems.
The ABC algorithm consists of three main components
• Employee Bees
• Onlooker Bees
• Scout bees
The process begins with an initial population of employee bees which are
responsible for exploring the search space and finding potential
solutions.
Steps of ABC Algorithm
Step 1: Initialization
Define the number of employee bees, onlooker bees and scout bees.
Generate the initial population of employee bees randomly.
Steps of ABC Algorithm
Step 2: Employee Bees Phase
• For each employed bee, calculate the fitness value of its corresponding
solution.
• Employed bees explore the search space around their current solutions
by generating new solutions through local search operators, such as
mutation or crossover.
• Evaluate the fitness value of the new solutions.
• Compare the fitness values of the old and new solutions.
• If the fitness value of the new solution is better, replace the old solution
with the new one. Otherwise, keep the old solution.
Steps of ABC Algorithm
Step 3: Onlooker Bee Phase
• Calculate the probability values (fitness proportional) for the
employed bees based on their fitness values.
• Onlooker bees select employed bees based on the probability values.
• Selected employed bees perform the same exploration process as in
the employed bee phase.
• Update the solutions of the selected employed bees.
Steps of ABC Algorithm
Step 4: Scout Bee Phase
• Determine the employed bee with the poorest fitness value (i.e., the
solution that has not improved for a certain number of iterations).
• Replace the solution of the employed bee with a new randomly
generated solution.
• This step helps to overcome stagnation and explore new areas of the
search space.
Steps of ABC Algorithm
• Step 5: Repeat Steps 2-4 until a termination condition is met (e.g., a
maximum number of iterations or a satisfactory solution is found).
• Step 6: Output the best solution found.
Parameters of ABC Algorithm
• Population size (no. of employee, onlooker and scout bees)
• No. of cycles (iterations)
• Limit Cycles
Example
Find the minimum value of the function
Objective Function: f(x) = x^2
Search Space: -10 <= x <= 10
Example
Step 1: Initialization
• Suppose we have 10 employed bees, 5 onlooker bees, and 2 scout
bees.
• Randomly generate initial solutions for the employed bees within the
search space.
• Randomly generate initial solutions for the employed bees within the
search space, let's say: [-5, 7, 3, -1, 0, 2, -4, 9, -2, 6].
Example
Step 2: Employed Bee Phase (continued)
• Each employed bee calculates the fitness value of its solution based on the
objective function.
• For example, the fitness values for the employed bee solutions are: [25, 49, 9, 1, 0,
4, 16, 81, 4, 36].
• Bees generate new solutions by adding a small random value to their
current solutions.
• Let's assume the bees generate new solutions by adding a random value between -1
and 1 to their current solutions.
• For instance, the new solutions generated by adding a random value between -1 and
1 to the current solutions could be: [-5.3, 7.9, 3.1, -0.8, -0.1, 1.7, -4.5, 8.6, -2.4,
6.3].
Example
• The fitness values of the new solutions are calculated based on the
objective function.
• The fitness values for the new solutions would be: [28.09, 62.41, 9.61, 0.64,
0.01, 2.89, 20.25, 74.19, 6.76, 39.69].
• Compare the fitness values of the old and new solutions.
• The new solutions that have lower fitness values replace the old solutions,
leading to the updated employed bee solutions: [-5.3, 7, 3, -0.8, 0, 2, -4.5, 8.6,
-2, 6].
Example
Step 3: Onlooker Bee Phase
• Calculate the probabilities of the employed bees based on their fitness
values. The probability of each employed bee is proportional to its
fitness value compared to the total fitness of all employed bees.
• For example, assuming the fitness values of the employed bees are [28.09,
62.41, 9.61, 0.64, 0.01, 2.89, 20.25, 74.19, 6.76, 39.69], the probabilities
would be [0.1148, 0.2550, 0.0393, 0.0026, 0.000, 0.0118, 0.0823, 0.3030,
0.0276, 0.1622] (normalized values).
Example
• Onlooker bees select employed bees based on their probabilities.
• Let's say the onlooker bees selected the employed bees with the following
indices: [1, 3, 5, 6, 8].
• The selected employed bees perform the same exploration process as
employed bees.
• They generate new solutions by adding a random value between -1
and 1 to their current solutions.
• For example, the new solutions generated by the selected employed bees
could be: [6.9, -0.3, 1.9, -4.4, 9.6].
Example
• The fitness values of the new solutions are calculated based on the
objective function.
• The fitness values for the new solutions would be: [47.61, 0.09, 3.61, 19.36,
92.16].
• Compare the fitness values of the old and new solutions.
• The new solutions that have lower fitness values replace the old solutions,
leading to the updated solutions of the selected employed bees: [6.9, -0.3, 2, -
4.4, 9.6].
• Repeat this process for all onlooker bees, selecting employed bees
based on their probabilities, generating new solutions, and updating
the solutions if necessary.
Example
Step 4: Scout Bee Phase
• Check if any employed bee has not improved its solution for a certain
number of iterations (e.g., 5 iterations).
• If an employed bee does not improve, replace its solution with a new
randomly generated solution.
• Let's say employed bee 4 has not improved its solution for 5 iterations.
• We replace its solution with a new randomly generated solution, for example:
-3.2.
Step 5: Repeat Steps 2-4 for a specified number of iterations or until a
satisfactory solution is found.

You might also like