1 简介

In order to solve the problem that the butterflfly optimization algorithm (BOA) is prone to lowaccuracy and slow convergence, the trend of study is to hybridize two or more algorithms to obtain asuperior solution in the fifield of optimization problems. A novel hybrid algorithm is proposed, namelyHPSOBOA, and three methods are introduced to improve the basic BOA. Therefore, the initializationof BOA using a cubic one-dimensional map is introduced, and a nonlinear parameter control strategyis also performed. In addition, the particle swarm optimization (PSO) algorithm is hybridized withBOA in order to improve the basic BOA for global optimization. There are two experiments (including26 well-known benchmark functions) that were conducted to verify the effffectiveness of the proposedalgorithm. The comparison results of experiments show that the hybrid HPSOBOA converges quicklyand has better stability in numerical optimization problems with a high dimension compared withthe PSO, BOA, and other kinds of well-known swarm optimization algorithms.

【优化求解】基于粒子群的混沌混合蝴蝶优化算法求解单目标优化问题Matlab代码_参考文献

2 部分代码


function [fmin,best_pos,Convergence_curve] = BOA(n,N_iter,Lb,Ub,dim,fobj)


% n is the population size

% N_iter represnets total number of iterations

p=0.6;                    % probabibility switch

power_exponent=0.1;       %initial value of a

sensory_modality=0.01;    %initial value of c


%Initialize the positions of search agents

Sol=initialization(n,dim,Ub,Lb);


for i=1:n

    Fitness(i)=fobj(Sol(i,:));

end


% Find the current best_pos

[fmin,I]=min(Fitness);

best_pos=Sol(I,:);

S=Sol; 


% Start the iterations -- Butterfly Optimization Algorithm 

for t=1:N_iter


        for i=1:n % Loop over all butterflies/solutions


          %Calculate fragrance of each butterfly which is correlated with objective function

          Fnew=fobj(S(i,:));

          FP=(sensory_modality*(Fnew^power_exponent));   


          %Global or local search

          if rand<p   

              dis = rand * rand * best_pos - Sol(i,:);         %Eq. (2) in paper

              S(i,:)=Sol(i,:)+dis*FP;

          else

              % Find random butterflies in the neighbourhood

              epsilon=rand;

              JK=randperm(n);

              dis=epsilon*epsilon*Sol(JK(1),:)-Sol(JK(2),:);

              S(i,:)=Sol(i,:)+dis*FP;                        %Eq. (3) in paper

          end


         % Check if the simple limits/bounds are OK

%            S(i,:)=simplebounds(S(i,:),Lb,Ub);


            Flag4Ub=S(i,:)>Ub;  

            Flag4Lb=S(i,:)<Lb;  

            S(i,:)=(S(i,:).*(~(Flag4Ub+Flag4Lb)))+Ub.*Flag4Ub+Lb.*Flag4Lb; 


            % Evaluate new solutions

            Fnew=fobj(S(i,:));  %Fnew represents new fitness values


            % If fitness improves (better solutions found), update then

            if (Fnew<=Fitness(i))

                Sol(i,:)=S(i,:);

                Fitness(i)=Fnew;

            end


           % Update the current global best_pos

           if Fnew<=fmin

                best_pos=S(i,:);

                fmin=Fnew;

           end

         end


         Convergence_curve(t,1)=fmin;


         %Update sensory_modality

         sensory_modality=sensory_modality_NEW(sensory_modality, N_iter);

end

end


% % Boundary constraints

% function s=simplebounds(s,Lb,Ub)

%   % Apply the lower bound

%   ns_tmp=s;

%   I=ns_tmp<Lb;

%   ns_tmp(I)=Lb;

%   

%   % Apply the upper bounds 

%   J=ns_tmp>Ub;

%   ns_tmp(J)=Ub;

%   % Update this new move 

%   s=ns_tmp;


function y=sensory_modality_NEW(x,Ngen)

y=x+(0.025/(x*Ngen));

end

3 仿真结果

【优化求解】基于粒子群的混沌混合蝴蝶优化算法求解单目标优化问题Matlab代码_参考文献_02

【优化求解】基于粒子群的混沌混合蝴蝶优化算法求解单目标优化问题Matlab代码_参考文献_03

4 参考文献

[1]刘景森, 马义想, 李煜. 改进蝴蝶算法求解多维复杂函数优化问题[J]. 电子学报, 2021, 49(6):9.

[2] Zhang, M. , et al. "A Chaotic Hybrid Butterfly Optimization Algorithm with Particle Swarm Optimization for High-Dimensional Optimization Problems." Symmetry 12.11(2020):1800.​

### 博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,有科研问题可私信交流。


**部分理论引用网络文献,若有侵权联系博主删除。**

【优化求解】基于粒子群的混沌混合蝴蝶优化算法求解单目标优化问题Matlab代码_参考文献_04