HBA-蜜獾算法(Honey Badger Algorithm,HBA)(算法源码可复制)

蜜獾算法(Honey Badger Algorithm,HBA)是于2021年提出的一种新型智能优化算法,该算法主要通过模拟蜜獾智能觅食行为来进行寻优,具有寻优能力强,收敛速度快等特点

论文题目:Honey Badger Algorithm: New Metaheuristic Algorithm for Solving Optimization Problems 

引用格式

Hashim, Fatma A., Essam H. Houssein, Kashif Hussain, Mai S. Mabrouk, Walid Al-Atabany. "Honey Badger Algorithm: New Metaheuristic Algorithm for Solving Optimization Problems." Mathematics and Computers in Simulation, 2021.

算法代码:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Honey Badger Algorithm source code 
%  paper:
%     Hashim, Fatma A., Essam H. Houssein, Kashif Hussain, Mai S. %     Mabrouk, Walid Al-Atabany. 
%     "Honey Badger Algorithm: New Metaheuristic Algorithm for %  %     Solving Optimization Problems." 
%     Mathematics and Computers in Simulation, 2021.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
function [Xprey, Food_Score,CNVG] = HBA(objfunc, dim,lb,ub,tmax,N)
beta       = 6;     % the ability of HB to get the food  Eq.(4)
C       = 2;     %constant in Eq. (3)
vec_flag=[1,-1];
%initialization
X=initialization(N,dim,ub,lb);
%Evaluation
fitness = fun_calcobjfunc(objfunc, X);
[GYbest, gbest] = min(fitness);
Xprey = X(gbest,:);
for t = 1:tmax
    alpha=C*exp(-t/tmax);   %density factor in Eq. (3)
    I=Intensity(N,Xprey,X); %intensity in Eq. (2)
    for i=1:N
        r =rand();
        F=vec_flag(floor(2*rand()+1));
        for j=1:1:dim
            di=((Xprey(j)-X(i,j)));
            if r<.5
                r3=rand;                r4=rand;                r5=rand;
                
                Xnew(i,j)=Xprey(j) +F*beta*I(i)* Xprey(j)+F*r3*alpha*(di)*abs(cos(2*pi*r4)*(1-cos(2*pi*r5)));
            else
                r7=rand;
                Xnew(i,j)=Xprey(j)+F*r7*alpha*di;
            end
        end
        FU=Xnew(i,:)>ub;FL=Xnew(i,:)<lb;Xnew(i,:)=(Xnew(i,:).*(~(FU+FL)))+ub.*FU+lb.*FL;
        
        tempFitness = fun_calcobjfunc(objfunc, Xnew(i,:));
        if tempFitness<fitness(i)
            fitness(i)=tempFitness;
            X(i,:)= Xnew(i,:);
        end
    end
    FU=X>ub;FL=X<lb;X=(X.*(~(FU+FL)))+ub.*FU+lb.*FL;
    [Ybest,index] = min(fitness);
    CNVG(t)=min(Ybest);
    if Ybest<GYbest
        GYbest=Ybest;
        Xprey = X(index,:);
    end
end
Food_Score = GYbest;
end

function Y = fun_calcobjfunc(func, X)
N = size(X,1);
for i = 1:N
    Y(i) = func(X(i,:));
end
end
function I=Intensity(N,Xprey,X)
for i=1:N-1
    di(i) =( norm((X(i,:)-Xprey+eps))).^2;
    S(i)=( norm((X(i,:)-X(i+1,:)+eps))).^2;
end
di(N)=( norm((X(N,:)-Xprey+eps))).^2;
S(N)=( norm((X(N,:)-X(1,:)+eps))).^2;
for i=1:N
    r2=rand;
    I(i)=r2*S(i)/(4*pi*di(i));
end
end
function [X]=initialization(N,dim,up,down)
if size(up,2)==1
    X=rand(N,dim).*(up-down)+down;
end
if size(up,2)>1
    for i=1:dim
        high=up(i);low=down(i);
        X(:,i)=rand(N,1).*(high-low)+low;
    end
end
end

function [y] = sumsqu(xx)
d = length(xx);
sum = 0;
for ii = 1:d
	xi = xx(ii);
	sum = sum + ii*xi^2;
end

y = sum;

end

总览:

Recently, the numerical optimization field has attracted the research community to propose and develop various metaheuristic optimization algorithms. This paper presents a new metaheuristic optimization algorithm called Honey Badger Algorithm (HBA). The proposed algorithm is inspired from the intelligent foraging behavior of honey badger, to mathematically develop an efficient search strategy for solving optimization problems. The dynamic search behavior of honey badger with digging and honey finding approaches are formulated into exploration and exploitation phases in HBA. Moreover, with controlled randomization techniques, HBA maintains ample population diversity even towards the end of the search process. To assess the efficiency of HBA, 24 standard benchmark functions, CEC'17 test-suite, and four engineering design problems are solved. The solutions obtained using the HBA have been compared with ten well-known metaheuristic algorithms including Simulated annealing (SA), Particle Swarm Optimization (PSO), Covariance Matrix Adaptation Evolution Strategy (CMA-ES), Success-History based Adaptive Differential Evolution variants with linear population size reduction (L-SHADE), Moth-flame Optimization (MFO), Elephant Herding Optimization (EHO), Whale Optimization Algorithm (WOA), Grasshopper Optimisation Algorithm (GOA), Thermal Exchange Optimization (TEO) and Harris hawks optimization (HHO). The experimental results, along with statistical analysis, reveal the effectiveness of HBA for solving optimization problems with complex search-space, as well as, its superiority in terms of convergence speed and exploration-exploitation balance, as compared to other methods used in this study. The source code is currently available for public from: https://www.mathworks.com/matlabcentral/fileexchange/98204-honey-badger-algorithm

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
优化算法Honey Bee Optimization Algorithm, HBA)是一种基于蜂觅食行为的启发式优化算法。该算法模拟了蜂在寻找源的过程中的智能行为,通过迭代搜索来寻找最优解。 优化算法的具体过程如下:首先,初始化一群,并随机分配到不同的位置上。接着,会根据目标函数的评估结果选择性地进行搜索。搜索的过程中,会根据该位置附近的信息素浓度以及该位置对应的目标函数值来进行决策。信息素浓度越高,说明该位置附近的解可能较优,因此更倾向于在该位置附近进行搜索。同时,目标函数值越小,说明该位置的解越接近最优解,因此也更倾向于在这些位置进行搜索。 在搜索过程中,会通过局部搜索和全局搜索两种方式来进行优化。局部搜索主要针对某个特定位置附近的解进行搜索,通过精细调整当前位置周围的解来寻找更优的解。全局搜索主要通过选择具有较高信息素浓度的位置进行搜索,以找到新的潜在最优解。 通过多次迭代搜索,优化算法能够逐渐靠近最优解,并且具有较好的全局搜索能力和较快的收敛速度。同时,该算法具有较好的鲁棒性和自适应性,在多种问题领域都有广泛应用。 在Python中实现优化算法,可以首先定义目标函数,并选择合适的算法参数。然后,通过编写搜索算法的迭代过程来实现的搜索行为。在搜索过程中,可以利用numpy等库来进行向量化运算,加快计算速度。最后,通过多次迭代搜索,获得最优解。 总结起来,优化算法是一种模拟蜂觅食行为的启发式优化算法,通过迭代搜索来寻找最优解。在Python中实现优化算法需要定义目标函数,并编写搜索算法的迭代过程来模拟的搜索行为。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值