-
-
Notifications
You must be signed in to change notification settings - Fork 111
Artificial Bee Colony
The Artificial Bee Colony (ABC) algorithm was initially proposed 2005 by Dervis Karaboga in his paper An Idea Based on Honey Bee Swarm For Numerical Optimization. In his paper Karaboga did not specify how exactly new solutions shall be discovered.
Research has shown that the flight behavior of birds, fruit flies and other insects model properties of Levy flights (Brown, Liebovitch & Glendon, 2007; Pavlyukevich, 2007). Therefore, this library's ABC implementation leverages levy flights to generate new solutions.
Enables the ABC algorithm to one of the provided 2D functions. The algorithm tries to find the global minimum of the selected function. Any of landscapes' 2D or nD functions can be selected.
The plot shows all employee bees as red markers, the onlooker bees are visualized as blue markers. The best bees of all (previous) iterations are indicated by yellow markers. When an employee bee exceeded its maximum trials the bee is assigned a new random position. This is visualized by a dark grey transition. Since the onlooker bees pick up an employee bee's position randomly visualizing their transitions confuses rather than it helps understanding the algorithm and therefore is omitted.
To print all available options execute:
swarm bees -h
In addition to the cli you can also use the API:
from swarmlib import ABCProblem, FUNCTIONS
problem = ABCProblem(bees=10, function=FUNCTIONS['michalewicz'])
best_bee = problem.solve()
problem.replay()
Created with ❤️ by HaaLeo and contributors.