人工蜂群算法
Artificial bee colony algorithm
| Dervis Karaboga (2010), Scholarpedia, 5(3):6915. | doi:10.4249/scholarpedia.6915 | revision #91003 [link to/cite this article] |
The Artificial Bee Colony (ABC) algorithm is a swarm based meta-heuristic algorithm that was introduced by Karaboga in 2005 (Karaboga, 2005) for optimizing numerical problems. It was inspired by the intelligent foraging behavior of honey bees. The algorithm is specifically based on the model proposed by Tereshko and Loengarov (2005) for the foraging behaviour of honey bee colonies. The model consists of three essential components: employed and unemployed foraging bees, and food sources. The first two components, employed and unemployed foraging bees, search for rich food sources, which is the third component, close to their hive. The model also defines two leading modes of behaviour which are necessary for self-organizing and collective intelligence: recruitment of foragers to rich food sources resulting in positive feedback and abandonment of poor sources by foragers causing negative feedback.
In ABC, a colony of artificial forager bees (agents) search for rich artificial food sources (good solutions for a given problem). To apply ABC, the consideredoptimization problem is first converted to the problem of finding the best parameter vector which minimizes an objective function. Then, the artificial bees randomly discover a population of initial solution vectors and then iteratively improve them by employing the strategies: moving towards better solutions by means of a neighbour search mechanism while abandoning poor solutions.
Contents |
Global Optimization Problem
A global optimization problem can be defined as finding the parameter vector x⃗ that minimizes an objective function f(x⃗ ) :
which is constrained by the following inequalities and/or equalities:
f(x⃗ ) is defined on a search space, S , which is a n−dimensional rectangle in Rn (S⊆Rn). The variable domains are limited by their lower and upper bounds (2).
This problem is also known as a constrained optimization problem. If it is an unconstrained optimization problem, then both p=0 and q=0 .
The Artificial Bee Colony Meta-heuristic
In ABC, the colony of artificial bees contains three groups of bees: employed bees associated with specific food sources, onlooker bees watching the dance of employed bees within the hive to choose a food source, and scout bees searching for food sources randomly. Both onlookers and scouts are also called unemployed bees. Initially, all food source positions are discovered by scout bees. Thereafter, the nectar of food sources are exploited by employed bees and onlooker bees, and this continual exploitation will ultimately cause them to become exhausted. Then, the employed bee which was exploiting the exhausted food source becomes a scout bee in search of further food sources once again. In other words, the employed bee whose food source has been exhausted becomes a scout bee. In ABC, the position of a food source represents a possible solution to the problem and the nectar amount of a food source corresponds to the quality (fitness) of the associated solution. The number of employed bees is equal to the number of food sources (solutions) since each employed bee is associated with one and only one food source.
The general scheme of the ABC algorithm is as follows:
Initialization Phase
REPEAT
Employed Bees Phase
Onlooker Bees Phase
Scout Bees Phase
Memorize the best solution achieved so far
UNTIL(Cycle=Maximum Cycle Number or a Maximum CPU time)
Initialization Phase
All the vectors of the population of food sources, xm→’s, are initialized (m=1...SN , SN: population size) by scout bees and control parameters are set. Since each food source, xm→ , is a solution vector to the optimization problem, each xm→ vector holds n variables, (xmi,i=1...n), which are to be optimized so as to minimize the objective function.
The following definition might be used for initialization purposes (5):
where li and ui are the lower and upper bound of the parameter xmi , respectively.
Employed Bees Phase
Employed bees search for new food sources (υm→) having more nectar within the neighbourhood of the food source (xm→) in their memory. They find a neighbour food source and then evaluate its profitability (fitness). For example, they can determine a neighbour food source υm→ using the formula given by equation (6):
where xk→ is a randomly selected food source, i is a randomly chosen parameter index and ϕmi is a random number within the range [−a,a] . After producing the new food source υm→ , its fitness is calculated and a greedy selection is applied between υm→ and xm→ .
The fitness value of the solution, fitm(xm→) , might be calculated for minimization problems using the following formula (7)
where fm(xm→) is the objective function value of solution xm→ .
Onlooker Bees Phase
Unemployed bees consist of two groups of bees: onlooker bees and scouts. Employed bees share their food source information with onlooker bees waiting in the hive and then onlooker bees probabilistically choose their food sources depending on this information. In ABC, an onlooker bee chooses a food source depending on the probability values calculated using the fitness values provided by employed bees. For this purpose, a fitness based selection technique can be used, such as the roulette wheel selection method (Goldberg, 1989).
The probability value pm with which xm→ is chosen by an onlooker bee can be calculated by using the expression given in equation (8) :
After a food source xm→ for an onlooker bee is probabilistically chosen, a neighbourhood source υm→ is determined by using equation (6), and its fitness value is computed. As in the employed bees phase, a greedy selection is applied between υm→ and xm→ . Hence, more onlookers are recruited to richer sources and positive feedback behaviour appears.
Scout Bees Phase
The unemployed bees who choose their food sources randomly are called scouts. Employed bees whose solutions cannot be improved through a predetermined number of trials, specified by the user of the ABC algorithm and called “limit” or “abandonment criteria” herein, become scouts and their solutions are abandoned. Then, the converted scouts start to search for new solutions, randomly. For instance, if solution xm→ has been abandoned, the new solution discovered by the scout who was the employed bee of xm→ can be defined by (5). Hence those sources which are initially poor or have been made poor by exploitation are abandoned and negative feedback behaviour arises to balance the positive feedback.
In summary, the ABC algorithm,
1) is inspired by the foraging behaviour of honeybees,
2) is a global optimization algorithm,
3) has been initially proposed for numerical optimization (e.g.: Karaboga, 2005),
4) can be also used for combinatorial optimization problems (eg: Pan et al, 2010),
5) can be used for unconstrained and constrained optimization problems (eg: Karaboga and Akay, 2009; Karaboga and Basturk 2007b; Domínguez 2009),
6) employs only three control parameters (population size, maximum cycle number and limit) that are to be predetermined by the user,
7) is quite simple, flexible and robust (some of the relevant publications expressing these merits of the ABC algorithm are Rao et al, 2008; Kang et al, 2009;Singh, 2009; Karaboga, 2009, included in the References list).
前言
人工蜂群算法(Artifical Bee Colony)是一种元启发式智能算法,由Karaboga in 2005在2005年引入,用来求解数值优化问题。它受启发于蜜蜂的觅食行为。这种算法主要基于 Tereshko 和Loengarov (2005) 提出的蜂群觅食行为模型。这个模型包含了三种核心元素:雇佣蜂(employed bees),非雇佣蜂(unemployed bees)和食物源(food sources)。前两者负责搜寻蜂巢附近的富源(rich food sources)。这种模型也定义了两种指引模式:富源会反馈会积极信号,从而引导更多的蜜蜂来采蜜;贫源(poor food sources)会反馈消极信号,会导致放弃这个食物源。这两种行为是自组织的和群智能的。
在ABC中,把待求解的问题的解看做是人工食物,食物越充足(rich),表示解的质量越好,然后一群人工蜜蜂会去搜寻富源,从而找到一个相关问题的比较好的解。为了应用ABC,待求解的问题首先要转化为最优化问题,也就是找到一组参数向量,使得目标函数最小化。人工蜂群就会随机初始化一些解,然后通过迭代,使用邻居搜索的策略来向更好的解靠近,并放弃差的解,逐步提高解的质量。
全局优化问题
一个全局优化问题可以定义为寻找参数向量
,使得目标函数
最小化,如下式所示:
(1)
这个函数会带有如下的等式和/或不等式约束:
(2)
subject to:
for
(3)
for
(4)
定义了一个
上的n维的搜索空间S。变量取值范围被限定在起上下限中,如式(2)所示。这也是一个带约束的优化问题。如果
且
,则变为一个无约束优化问题。
人工蜂群元启发式算法
在ABC中,人工蜂群由三种蜜蜂组成:雇佣蜂(employed bees)同特定的食物源相关联;观察蜂(onlooker bees)观察蜂巢内雇佣蜂的舞蹈以决定选择某个食物源;侦察蜂(scout bees)会随机的搜索食物。侦察蜂和观察蜂又叫做未雇佣蜂。算法初始的时候,所有的食物源会被侦察蜂搜索到,然后,食物源会被雇佣蜂和观察蜂所开发利用。持续性的开发利用会使得食物源很快被消耗尽,于是消耗尽食物源的雇佣蜂会转变成为侦察蜂。在ABC中,食物源的位置代表了问题的一个可行解,食物源处的蜂蜜的数量代表了相关问题解的质量。雇佣蜂的数量等于食物源的数量,因为每只雇佣蜂会关联到一个且仅一个食物源。
通用ABC算法框架如下所示:
|
初始化时期; Repeat 雇佣蜂时期; 观察蜂时期; 侦察蜂时期; 记录找到的最好解; Util (达到最大循环次数或者达到cpu时间) |
初始化时期
利用侦察蜂初始化所有代表食物源的向量
,
,SN是种群的大小,设定控制参数。由于每个食物源
都是待优化问题的解向量,因此每个
都含有n个变量
。这些向量将要被优化,从而使得目标函数最小化。可以利用下式进行初始化:
(5)
其中
和
是参数
取值的上下限。
雇佣蜂时期
雇佣蜂会依据其记忆中的食物源的位置进行邻居搜索,找食物源附近的更好的食物源。当雇佣蜂找到一个食物源之后,会评估其适应值。此处,它们可以采用下述公式来确定邻居食物源:
(6)
其中
是一个随机选择的食物源,i是随机选择的一个位置索引,
是一个[-a,a]之间的一个随机数。当产生新的食物源之后,会计算出它的适应值,并且在
和
之间应用贪心法做出选择。
解的适应值,可以通过下式转化为最小化问题来求解:
(7)
其中
是待解问题的目标函数值。
观察蜂时期
非雇佣蜂由两部分群体组成:观察蜂和侦察蜂。雇佣蜂会向在蜂巢中等待的观察蜂来分享它们获得的食物源信息。观察蜂会根据这些信息进行一种随机的选择。为此,需要一种基于适应值的选择方法,比如轮盘赌。
被选中的概率
可以用下述表达式计算:
(8)
当食物源
被一只观察蜂选中后,利用(6)式产生邻居食物源
,再计算其适应值。在雇佣蜂时期,在
和
之间用贪心法来做出选择。因此,更多的观察蜂会选择富源并反馈回积极信号。
侦察蜂时期
未雇佣蜂随机搜索食物源,称为侦察蜂。如果雇佣蜂通过实现给定的尝试次数之后,仍然未能提高解的质量,则雇佣蜂就变成为侦察蜂,其拥有的解就会被放弃。(尝试次数是由ABC使用者事先给定的,称为“limit”或者“放弃阈值”(abandonment criteria))转换后的侦察蜂开始随机搜索新的解,比如,如果
被放弃了,那么原来拥有
的雇佣蜂就会利用(5)式来产生新的解。因此那些随机产生的贫源或者近期形成的贫源就会被放弃,产生消极的信号,以来平衡积极的信号。
ABC算法总结起来,有以下几点:
1) 根据蜜蜂的觅食行为而得到;
2) 是全局优化算法;
3) 为了数值优化而设计;
4) 也可以用来求解组合优化问题;
5) 可以用于有约束的和无约束的优化问题;
6) 只使用了三个参数(种群数量,最大循环次数以及阈值),这些参数是用户事先确定的;
7) 非常的简单,具有柔性和鲁棒性。


浙公网安备 33010602011771号