Swarm Intelligence Series : Artificial Bee Colony Optimization Algorithm

·

10 min read

The artificial bee colony algorithm is a biological meta-heuristic algorithm that is heavily inspired by the foraging behavior displayed by a colony of bees. This algorithm operates through the process of simulating the behavior of a bee colony which consists of employed bees, onlookers, and scouts to search for optimal solutions for a problem.

Introduction

honeybee perched on purple flower in close up photography during daytime

The Artificial Bee Colony Optimization algorithm is inspired by the behavior of a bee colony where each employed bee represents a potential solution to an optimization problem. It was discovered in 2005 by Karaboga and this algorithm mimics the way honey bees search and find food resources. It falls under the category of swarm intelligence algorithms where the collective behavior of a group is harnessed to solve complicated problems. And, the goal of this algorithm is to find the most richest food source which translates to the best solution for the problem at hand.

Inspiration

Electronics | Free Full-Text | Global Maximum Power Point Tracking of  Photovoltaic Module Arrays Based on Improved Artificial Bee Colony Algorithm

This algorithm mainly operates in an iterative fashion cycling through 3 types of bees: employed bees, onlooker bees, and scout bees. Employed bees exploit food sources they discover, while onlooker bees choose food sources based on the information shared by the employed bees. Scout bees on the other hand tend to explore new areas, searching for potentially better solutions than the ones found so far. Through this collaboration, the colony continuously refines its search aiming to identify the optimal solution.

Convergence

The artificial bee colony algorithm inspired by the process of foraging carried out by honey bees theoretically possesses a guaranteed ability to converge to an optimal solution. However, practically this can be quite different and while these bees diligently search for the richest food source, the algorithm can exhibit slow convergence, meaning it takes a significant number of iterations to reach a good solution.

Furthermore, the bees can become trapped in a local optima, akin to finding a decent but not the absolute best food source within their immediate vicinity and this limitation arises as the algorithm could prioritize exploiting existing promising solutions over the process of exploring new areas of the search space.

In essence, while the algorithm theoretically converges, its practical convergence can be slow and prone to local optima. However, ongoing research and improvements aim to enhance its performance, enabling it to find the best solutions more efficiently in real-world applications.

Algorithm

Artificial Bee Colony Algorithm flow chart. | Download Scientific Diagram

This algorithm mainly has 3 classes of bees participating in the search exploration and exploitation process. It takes the following steps :

  1. Initialization: We generate an initial population of employed bees equal to the number of food sources. Each employed bee is associated with a specific food source.

  2. Employed Bee Phase: Employed bees exploit the food sources by adjusting their solutions locally. This mimics the tendency of bees to explore the vicinity of a known food source for better resources. In this step, employed bees also evaluate the quality [nectar content] of the modified food source and compare it with the original food source. Finally, if the modified food source has a higher nectar amount, we replace the original solution with the modified solution and this encourages the bees to exploit the food sources identified to be promising.

  3. Onlooker Bee Phase: In this phase, the employed bees share information about the quality of their food sources through a "waggle dance". This dance metaphorically represents the quality and the location of the food source and this dance is observed by the onlooker bees. These bees represent the unemployed bees in the colony and they tend to choose a food source using a probabilistic approach based on a combination of the food source's quality and the employed bee's dance intensity. The onlooker bees modify their chosen food and evaluate its quality and they replace the original source if the modification improves the nectar amount.

  4. Scout Bee Phase: In this phase, if the employed bee fails to improve its associated food source for a predefined number of iterations, this food source or solution is abandoned and this mimics the process of bees abandoning depleted food sources. A Scout bee is sent out to explore the search space in a random fashion, potentially discovering new food sources and promoting the exploration of uncharted territory.

  5. Iteration and Transformation: The 3 cycles of foraging carried out by the employed bee, onlooker bee, and scout bee continue for a predefined set number of iterations, mimicking the ongoing search process of a bee colony in nature in general. Finally, the best-discovered food source with the highest nectar amount is considered to be the most optimal solution to the problem.

Search Parameters used by the Artificial Bee Colony Optimization Algorithm

The artificial bee colony optimization algorithm utilizes several control parameters that heavily influence its search behavior and performance. While some are fundamental to the algorithm's structure, others can be adapted based on the specific problem being tackled. Here's a breakdown of the key search parameters :

  1. Colony Size (N): This parameter determines the total number of bees in the colony, including employed, onlooker, and scout bees. A larger colony allows for a wider exploration of the search space but also increases computational cost.

  2. Number of employed bees (EN): This parameter defines the number of employed bees, directly associated with a specific food source in the population. Typically, this value is equal to the number of food sources ensuring each solution has a dedicated bee exploring its vicinity.

  3. Number of Onlooker Bees (ON): This parameter determines the number of onlooker bees that observe the employed bees' dances and select food sources based on their quality and dance intensity. While not directly exploring, they contribute to the exploitation process.

  4. Limit on Trial Count(Limit): This parameter sets the maximum number of iterations an employed bee can attempt to improve its associated food source before it's deemed abandoned and replaced by a scout bee. It controls the balance between exploration and exploitation.

  5. Local Search Parameter: This parameter, specific to the chosen local search strategy, determines the extent to which an employed bee modifies its associated food source during the exploitation phase. It can influence the algorithm's ability to escape local optima and explore different regions of the search space.

Variations in the Artificial Bee Colony Optimization Algorithm

Some of the variations in the artificial bee colony optimization algorithm are :

  1. Global-best guided Artificial Bee Colony Optimization Algorithm: In this variation, the best solution found so far by any food source is used as a guide for producing new solutions and this helps to accelerate the convergence speed and avoid getting stuck in the locally optimal solution which is one of the biggest flaw of the artificial bee colony algorithm in general.

  2. Modified Artificial Bee Colony Optimization Algorithm: In this variant, the search or the control parameters like the limit, colony size, and the maximum number of trials are dynamically adjusted during the search process based on the current state of the population.

  3. Improved Artificial Bee Colony Optimization Algorithm: In this version, each employed bee performs a neighborhood search around its corresponding food source before applying the greedy selection mechanism on a solution it finds fruitful and this enhances the point of this algorithm not exploring a lot and sticking to a few locally optimal solutions.

  4. Adaptive Artificial Bee Colony Optimization Algorithm with the Mutation Operator: In this variant, an additional mutation operator is introduced to enhance the diversity of the population. The probability of using the mutation operator is adapted based on the fitness values of the solutions.

  5. Chaotic Artificial Bee Colony Optimization Algorithm: In this variant, chaotic maps are incorporated into the search process to generate random numbers instead of the traditional way of using pseudo-random generators and this improves the uniformity of the search space.

  6. Multi-Objective Artificial Bee Colony Optimization Algorithm: In this variant, the original single objective algorithm is extended to handle multiple objectives simultaneously. Several techniques like the Pareto dominance technique, crowding distance, and the method of non-dominated sorting are used to maintain a set of diverse and high-quality solutions.

  7. Parallel Artificial Bee Colony Optimization Algorithm: In this version, the original sequential Artificial Bee Colony Optimization Algorithm is parallelized to take advantage of modern multi-core architectures. Different colonies in this algorithm are assigned to different cores of the system available and they communicate periodically to exchange information about their best solutions found.

  8. Hybrid Artificial Bee Colony Optimization Algorithm: In this variant, the basic algorithm is hybridized with other optimization algorithms or heuristics to improve its performance. For example, this algorithm can be combined with simulated annealing, particle swarm optimization or genetic algorithms.

Applications of the Artificial Bee Colony Optimization Algorithms

  1. Image Processing: This algorithm has been applied to image processing tasks like segmentation, denoising, and feature extraction. In these tasks, the objective of the algorithm is to identify and extract useful information from the images available. This algorithm is used to optimize the parameters of image processing algorithms to improve their performance.

  2. Wireless Sensor Networks: This algorithm has been used to optimize the parameters of wireless sensor networks such as network topology, routing and energy consumption. In these tasks, the objective is to maximize the network lifetime and minimize the energy consumption of the sensors. This algorithm is used to optimize the parameters of the sensory network to achieve these objectives. It is also used for clustering in the wireless sensor networks.

  3. Financial Modelling: This algorithm has been used to optimize financial models such as portfolio optimization, option pricing, and more, and in these tasks, the objective is to maximize the return on investment and minimize the risk. This algorithm is used to optimize the parameters of the financial models to achieve these objectives.

  4. Gene Clustering: This algorithm has been used to cluster the genes based on their expression levels in different tissues and conditions. The objective of this algorithm is to identify groups of genes that are co-expressed and have similar functions to be done. This algorithm is used to optimize the parameters of the gene clustering algorithm to achieve this objective.

Limitations of the Artificial Bee Colony Optimization Algorithm

  1. Sensitivity to Control Parameters: This algorithm has several control parameters such as population size, number of iterations, and limit. These parameters can affect the performance of the algorithm, and finding the optimal values can be challenging. The incorrect parameter settings can lead to poor performance or even divergence.

  2. Computational Complexity: This algorithm requires a large number of iterations and function evaluations to converge to the optimal solution and this can make the algorithm computationally more expensive.

  3. Slow convergence: The algorithm can tend to converge slowly, especially for problems with complex landscapes or large search spaces. This can make the algorithm less suitable for problems with strict time constraints.

  4. Limited Exploration: The algorithm can be difficult to scale up to large problem sizes or large populations. This can lead to premature convergence or suboptimal solutions.

  5. Limited Scalability: This algorithm can be difficult to scale up to large problem sizes or large populations. This can make the algorithm less suitable for problems with a large number of variables or constraints.

Code Implementation with MealPy

import numpy as np
from mealpy import FloatVar, ABC

def objective_function(solution):
    return np.sum(solution**2)

problem_dict = {
    "bounds": FloatVar(lb=(-10.,) * 30, ub=(10.,) * 30, name="delta"),
    "minmax": "min",
    "obj_func": objective_function
}

model = ABC.OriginalABC(epoch=1000, pop_size=50, n_limits = 50)
g_best = model.solve(problem_dict)
print(f"Solution: {g_best.solution}, Fitness: {g_best.target.fitness}")
print(f"Solution: {model.g_best.solution}, Fitness: {model.g_best.target.fitness}")

Conclusion

In conclusion, the Artificial Bee Colony optimization algorithm is a powerful and versatile optimization technique that has been widely used in various applications. Its inspiration from the foraging behavior of honey bees and its ability to efficiently search large solution spaces make it particularly useful for solving complex optimization problems. The algorithm has several variations and applications, including image processing, customer segmentation, gene clustering, and wireless sensor networks. However, the algorithm also has several limitations, including sensitivity to control parameters, computational complexity, slow convergence, limited exploration, limited scalability, and limited adaptability. Despite these limitations, the algorithm remains a popular and effective optimization technique in many real-world applications.

Did you find this article valuable?

Support Akash Gss by becoming a sponsor. Any amount is appreciated!