【智能算法】非洲秃鹫优化算法(AVOA)原理及实现

在这里插入图片描述


1.背景

2021年,Abdollahzadeh等人受到非洲秃鹫自然捕食行为启发,提出了非洲秃鹫优化算法(African Vultures Optimization Algorithm, AVOA)。

2.算法原理

2.1算法思想

AVOA模拟了非洲秃鹫在自然界中的捕食过程,是典型的领导者-追随者模式。AVOA通过最优秃鹫和次优秃鹫对整个群体进行引导。

2.2算法过程

在这里插入图片描述

领导者-秃鹰筛选
R ( i ) = { B e s t V u l t u r e 1 i f p i = L 1 B e s t V u l t u r e 2 i f p i = L 2 \left.R(i)=\left\{\begin{array}{ll}BestVulture_1ifp_i=L_1\\BestVulture_2ifp_i=L_2\end{array}\right.\right. R(i)={BestVulture1ifpi=L1BestVulture2ifpi=L2
这里 p i p_i pi是对群体适应度归一化,通过轮盘赌策略选取最佳解策略。
p i = F i ∑ i = 1 n F i p_i=\frac{F_i}{\sum_{i=1}^nF_i} pi=i=1nFiFi
饥饿度
秃鹰的行为受到饥饿水平和能量储备的驱使,成为优化算法中探索和开发阶段转换的关键灵感。饱食时,秃鹰能够飞行更远寻找食物,而饥饿时能量减少,限制了它们的飞行能力。在饥饿时,秃鹰更积极地寻找食物,常常与更强壮的秃鹰一起觅食。
t = h × ( s i n w ( π 2 × i t e r a t i o n i m a x i t e r a t i o n s ) + c o s ( π 2 × i t e r a t i o n i m a x i t e r a t i o n s ) − 1 ) F = ( 2 × r a n d 1 + 1 ) × z × ( 1 − i t e r a t i o n i m a x i t e r a t i o n s ) + t \begin{aligned} &t=h\times\left(sin^{\mathrm{w}}\left(\frac{\pi}{2}\times\frac{iteration_{i}}{maxiterations}\right)+cos\left(\frac{\pi}{2}\times\frac{iteration_{i}}{maxiterations}\right)-1\right) \\ &F=(2\times rand_1+1)\times z\times\left(1-\frac{iteration_i}{maxiterations}\right)+t \end{aligned} t=h×(sinw(2π×maxiterationsiterationi)+cos(2π×maxiterationsiterationi)1)F=(2×rand1+1)×z×(1maxiterationsiterationi)+t
∣ F ∣ > 1 |F|>1 F>1时,全局探索;反之,局部搜索。
探索阶段
P ( i + 1 ) = { R ( i ) − D ( i ) ∗ F , i f P 1 ≥ r a n d P 1 R ( i ) − F + r a n d 2 ∗ ( ( u b − l b ) ∗ r a n d 3 + l b ) , e l s e \mathrm{P}\left(\mathrm{i}+1\right)=\begin{cases}\mathrm{R}(\mathrm{i})-\mathrm{D}(\mathrm{i})*\mathrm{F},\mathrm{if}\mathrm{P}_1\ge\mathrm{rand}_{\mathrm{P}1}\\\mathrm{R}(\mathrm{i})-\mathrm{F}+\mathrm{rand}_2*((\mathrm{u}\mathrm{b}-\mathrm{l}\mathrm{b})*\mathrm{rand}_3+\mathrm{l}\mathrm{b}),\mathrm{else}\end{cases} P(i+1)={R(i)D(i)F,ifP1randP1R(i)F+rand2((ublb)rand3+lb),else
其中, D ( i ) D(i) D(i)表述为:
D ( i ) = ∣ X ∗ R ( i ) − P ( i ) ∣ \mathrm D(\mathrm i)=|\mathrm X*\mathrm R(\mathrm i)-\mathrm P(\mathrm i)| D(i)=XR(i)P(i)
开发阶段
S 1 = R ( i ) × ( r a n d 5 × P ( i ) 2 π ) × c o s ( P ( i ) ) S 2 = R ( i ) × ( r a n d 6 × P ( i ) 2 π ) × s i n ( P ( i ) ) \begin{aligned}S_1&=R(i)\times\left(\frac{rand_5\times P(i)}{2\pi}\right)\times cos(P(i))\\S_2&=R(i)\times\left(\frac{rand_6\times P(i)}{2\pi}\right)\times sin(P(i))\end{aligned} S1S2=R(i)×(2πrand5×P(i))×cos(P(i))=R(i)×(2πrand6×P(i))×sin(P(i))

A 1 = B e s t V u l t u r e 1 ( i ) − B e s t V u l t u r e 1 ( i ) × P ( i ) B e s t V u l t u r e 1 ( i ) − P ( i ) 2 × F A_1=BestVulture_1(i)-\frac{BestVulture_1(i)\times P(i)}{BestVulture_1(i)-P(i)^2}\times F A1=BestVulture1(i)BestVulture1(i)P(i)2BestVulture1(i)×P(i)×F
A 2 = B e s t V u l t u r e 2 ( i ) − B e s t V u l t u r e 2 ( i ) × P ( i ) B e s t V u l t u r e 2 ( i ) − P ( i ) 2 × F A_2=BestVulture_2(i)-\frac{BestVulture_2(i)\times P(i)}{BestVulture_2(i)-P(i)^2}\times F A2=BestVulture2(i)BestVulture2(i)P(i)2BestVulture2(i)×P(i)×F

3.代码实现

%非洲秃鹫优化算法
function [Best_pos, Best_fitness,Iter_curve, History_pos, History_best]=AVOA(pop, dim, ub, lb, fobj,maxIter)
%input
%pop 种群数量
%dim 问题维数
%ub 变量上边界
%lb 变量下边界
%fobj 适应度函数
%maxIter 最大迭代次数
%output
%Best_pos 最优位置
%Best_fitness 最优适应度值
%Iter_curve 每代最优适应度值
%History_pos 每代种群位置
%History_best 每代最优位置
%% 全局记录
Best_pos=zeros(1,dim);
Best_fitness=inf;
Best_vulture2_X=zeros(1,dim);
Best_vulture2_F=inf;
%% 初始化种群
X=initialization(pop,dim,ub,lb);
%% 控制参数
p1=0.6;
p2=0.4;
p3=0.6;
alpha=0.8;
betha=0.2;
gamma=2.5;
%% 迭代
    current_iter=0; % Loop counter
    while current_iter < maxIter
        for i=1:size(X,1)
            % Calculate the fitness of the population
            current_vulture_X = X(i,:);
            current_vulture_F=fobj(current_vulture_X);

            % Update the first best two vultures if needed
            if current_vulture_F<Best_fitness
                Best_fitness=current_vulture_F; % Update the first best bulture
                Best_pos=current_vulture_X;
            end
            if current_vulture_F>Best_fitness && current_vulture_F<Best_vulture2_F
                Best_vulture2_F=current_vulture_F; % Update the second best bulture
                Best_vulture2_X=current_vulture_X;
            end
        end

        a=unifrnd(-2,2,1,1)*((sin((pi/2)*(current_iter/maxIter))^gamma)+cos((pi/2)*(current_iter/maxIter))-1);
        P1=(2*rand+1)*(1-(current_iter/maxIter))+a;

        % Update the location
        for i=1:size(X,1)
            current_vulture_X = X(i,:);  % pick the current vulture back to the population
            F=P1*(2*rand()-1);  

            random_vulture_X=random_select(Best_pos,Best_vulture2_X,alpha,betha);
            
            if abs(F) >= 1 % Exploration:
                current_vulture_X = exploration(current_vulture_X, random_vulture_X, F, p1, ub, lb);
            elseif abs(F) < 1 % Exploitation:
                current_vulture_X = exploitation(current_vulture_X, Best_pos, Best_vulture2_X, random_vulture_X, F, p2, p3, dim, ub, lb);
            end

            X(i,:) = current_vulture_X; % place the current vulture back into the population
        end

        current_iter=current_iter+1;
        X = boundaryCheck(X, lb, ub);
        Iter_curve(current_iter)=Best_fitness;
        History_pos{current_iter} = X;
        History_best{current_iter} = Best_pos;    

    end

end

%% 初始化函数
function [ X ]=initialization(N,dim,ub,lb)
Boundary_no= size(ub,2); 
if Boundary_no==1
    X=rand(N,dim).*(ub-lb)+lb;
end
if Boundary_no>1
    for i=1:dim
        ub_i=ub(i);
        lb_i=lb(i);
        X(:,i)=rand(N,1).*(ub_i-lb_i)+lb_i;
    end
end
end
%%
function [current_vulture_X] = exploitation(current_vulture_X, Best_vulture1_X, Best_vulture2_X, ...
                                                                      random_vulture_X, F, p2, p3, variables_no, upper_bound, lower_bound)

% phase 1
    if  abs(F)<0.5
        if rand<p2
            A=Best_vulture1_X-((Best_vulture1_X.*current_vulture_X)./(Best_vulture1_X-current_vulture_X.^2))*F;
            B=Best_vulture2_X-((Best_vulture2_X.*current_vulture_X)./(Best_vulture2_X-current_vulture_X.^2))*F;
            current_vulture_X=(A+B)/2;
        else
            current_vulture_X=random_vulture_X-abs(random_vulture_X-current_vulture_X)*F.*levyFlight(variables_no);
        end
    end
    % phase 2
    if  abs(F)>=0.5
        if rand<p3
            current_vulture_X=(abs((2*rand)*random_vulture_X-current_vulture_X))*(F+rand)-(random_vulture_X-current_vulture_X);
        else
            s1=random_vulture_X.* (rand()*current_vulture_X/(2*pi)).*cos(current_vulture_X);
            s2=random_vulture_X.* (rand()*current_vulture_X/(2*pi)).*sin(current_vulture_X);
            current_vulture_X=random_vulture_X-(s1+s2);
        end
    end
end
%% 
function [current_vulture_X] = exploration(current_vulture_X, random_vulture_X, F, p1, upper_bound, lower_bound)

    if rand<p1
        current_vulture_X=random_vulture_X-(abs((2*rand)*random_vulture_X-current_vulture_X))*F;
    else
        current_vulture_X=(random_vulture_X-(F)+rand()*((upper_bound-lower_bound)*rand+lower_bound));
    end
    
end
%% 随机选择
function [random_vulture_X]=random_select(Best_vulture1_X,Best_vulture2_X,alpha,betha)

    probabilities=[alpha, betha ];
    
    if (rouletteWheelSelection( probabilities ) == 1)
            random_vulture_X=Best_vulture1_X;
    else
            random_vulture_X=Best_vulture2_X;
    end

end
%% 飞行
function [ o ]=levyFlight(d)
  
    beta=3/2;

    sigma=(gamma(1+beta)*sin(pi*beta/2)/(gamma((1+beta)/2)*beta*2^((beta-1)/2)))^(1/beta);
    u=randn(1,d)*sigma;
    v=randn(1,d);
    step=u./abs(v).^(1/beta);

    o=step;

end
%% 边界检查
function [ X ] = boundaryCheck(X, lb, ub)

    for i=1:size(X,1)
            FU=X(i,:)>ub;
            FL=X(i,:)<lb;
            X(i,:)=(X(i,:).*(~(FU+FL)))+ub.*FU+lb.*FL;
    end
end
%% 轮盘赌策略
function [index] = rouletteWheelSelection(x)

    index=find(rand() <= cumsum(x) ,1,'first');

end

在这里插入图片描述

4.参考文献

[1] Abdollahzadeh B, Gharehchopogh F S, Mirjalili S. African vultures optimization algorithm: A new nature-inspired metaheuristic algorithm for global optimization problems[J]. Computers & Industrial Engineering, 2021, 158: 107408.

  • 27
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
非洲秃鹫优化算法(African vultures optimization algorithm, AVOA)是一种新型的群体智能算法,具有全局搜索和局部搜索能力强、收敛速度快等优点。不过,该算法在实际应用中还存在一些需要改进的地方,主要包括以下几个方面: 1. 领导者选择策略:非洲秃鹫优化算法中,领导者的选择是随机的,没有考虑个体的适应度和能力差异。因此,可以考虑引入一些选择策略,如轮盘赌选择、竞标选择等,以提高领导者的质量和效率。 2. 繁殖策略:非洲秃鹫优化算法中,个体的繁殖方式是随机的,没有考虑个体的适应度和遗传信息。因此,可以考虑引入一些遗传算子和繁殖策略,如交叉、变异、选择等,以提高种群的多样性和适应性。 3. 收敛速度:非洲秃鹫优化算法在全局搜索和局部搜索方面表现优异,但在收敛速度方面还有待提高。因此,可以考虑引入一些自适应策略和参数调整方法,如动态调整参数、自适应学习率等,以提高算法的收敛速度和性能。 4. 多目标优化:非洲秃鹫优化算法目前主要用于单目标优化问题,对于多目标优化问题的处理还不够成熟。因此,可以考虑引入一些多目标优化策略和算法,如帕累托前沿、多目标遗传算法等,以应对更加复杂的实际问题。 综上所述,非洲秃鹫优化算法还有很多可以改进的地方,需要进一步研究和探索。通过引入一些新的策略和算法,可以提高该算法的性能和实用性,从而更好地解决实际问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小O的算法实验室

谢谢大佬的肯定!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值