一、简介
多元宇宙优化算法(Multi-Verse Optimizer,MVO)是Seyedali Mirjalili等于2016年提出的一种新型智能优化算法[1]。它基于宇宙中的物质通过虫洞由白洞向黑洞进行转移的原理进行模拟。在MVO算法中,主要的性能参数是虫洞存在概率和虫洞旅行距离率,参数相对较少,低维度数值实验表现出了相对较优异的性能。
1 算法原理
该算法主要借助宇宙在随机创建过程中高膨胀率物体总是趋于低膨胀率的物体,这种万有引力作用可以使物体转移,借助相关宇宙学规则,可以在搜索空间逐渐趋于最优位置.遍历过程主要分为探索和开采过程,虫洞可以作为转移物体的媒介,通过白洞和黑洞交互作用进行搜索空间探测,本文算法具体操作如下:
文章图片
文章图片
文章图片
文章图片
2 算法流程图
文章图片
二、源代码
%_______________________________________________________________________________________%
%Multi-Verse Optimizer (MVO) source codes demo version 1.0%
%%
%Developed in MATLAB R2011b(7.13)%
%%
%Author and programmer: Seyedali Mirjalili%
%%
%e-Mail: ali.mirjalili@gmail.com%
%seyedali.mirjalili@griffithuni.edu.au%
%%
%Homepage: http://www.alimirjalili.com%
%%
%Main paper:%
%%
%S. Mirjalili, S. M. Mirjalili, A. Hatamlou%
%Multi-Verse Optimizer: a nature-inspired algorithm for global optimization%
%Neural Computing and Applications, in press,2015,%
%DOI: http://dx.doi.org/10.1007/s00521-015-1870-7%
%%
%_______________________________________________________________________________________%% You can simply define your cost in a seperate file and load its handle to fobj
% The initial parameters that you need are:
%__________________________________________
% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of generations
% SearchAgents_no = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers% To run MVO: [Best_score,Best_pos,cg_curve]=MVO(Universes_no,Max_iteration,lb,ub,dim,fobj)
%__________________________________________clear all
clcUniverses_no=60;
%Number of search agents (universes)Function_name='F17';
%Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)Max_iteration=500;
%Maximum numbef of iterations%Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
[Best_score,Best_pos,cg_curve]=MVO(Universes_no,Max_iteration,lb,ub,dim,fobj);
figure('Position',[290206648287])%Draw the search space
subplot(1,2,1);
func_plot(Function_name);
title('Test function')
xlabel('x_1');
ylabel('x_2');
zlabel([Function_name,'( x_1 , x_2 )'])
grid off
shading interp;
light;
lighting phong;
shading interp;
%Draw the convergence curve
subplot(1,2,2);
semilogy(cg_curve,'Color','r')
title('Convergence curve')
xlabel('Iteration');
ylabel('Best score obtained so far');
axis tight
grid off
box on
legend('MVO')
%_______________________________________________________________________________________%
%Multi-Verse Optimizer (MVO) source codes demo version 1.0%
%%
%Developed in MATLAB R2011b(7.13)%
%%
%Author and programmer: Seyedali Mirjalili%
%%
%e-Mail: ali.mirjalili@gmail.com%
%seyedali.mirjalili@griffithuni.edu.au%
%%
%Homepage: http://www.alimirjalili.com%
%%
%Main paper:%
%%
%S. Mirjalili, S. M. Mirjalili, A. Hatamlou%
%Multi-Verse Optimizer: a nature-inspired algorithm for global optimization%
%Neural Computing and Applications, in press,2015,%
%DOI: http://dx.doi.org/10.1007/s00521-015-1870-7%
%%
%_______________________________________________________________________________________%% You can simply define your cost in a seperate file and load its handle to fobj
% The initial parameters that you need are:
%__________________________________________
% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of generations
% SearchAgents_no = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers% To run MVO: [Best_score,Best_pos,cg_curve]=MVO(Universes_no,Max_iteration,lb,ub,dim,fobj)
%__________________________________________function [Best_universe_Inflation_rate,Best_universe,Convergence_curve]=MVO(N,Max_time,lb,ub,dim,fobj)%Two variables for saving the position and inflation rate (fitness) of the best universe
Best_universe=zeros(1,dim);
Best_universe_Inflation_rate=inf;
%Initialize the positions of universes
Universes=initialization(N,dim,ub,lb);
%Minimum and maximum of Wormhole Existence Probability (min and max in
% Eq.(3.3) in the paper
WEP_Max=1;
WEP_Min=0.2;
Convergence_curve=zeros(1,Max_time);
%Iteration(time) counter
Time=1;
%Main loop
while Timeub;
Flag4lb=Universes(i,:)
三、运行结果
文章图片
文章图片
【优化求解|【优化算法】黑洞模拟算法(MVO)matlab源码】
推荐阅读
- 算法|基于MATLAB的腐蚀膨胀算法实现
- #|黑洞优化算法(Matlab实现)
- 算法每日一练|牛客刷题---简单
- 神经网络|大盘点 | 2020年21篇医学影像算法最佳综述
- python算法设计|基于CQT和PCP的和弦识别算法
- 算法题每日一练---第32天(奇怪的分式)
- 学习|20220609学习记录(st表、动态规划、数学)
- Matlab使用|Matlab中的元胞数组(cell)
- 机器学习吴恩达|coursera机器学习吴恩达-学习笔记-第三周