A list,

Multi-verse Optimizer (MVO) is a new intelligent optimization algorithm proposed by Seyedali Mirjalili et al in 2016 [1]. It is based on the transfer of matter in the universe from a white hole to a black hole through a wormhole. In MVO algorithm, the main performance parameters are wormhole existence probability and wormhole travel distance rate, and the parameters are relatively few. Low-dimensional numerical experiments show relatively excellent performance.

1 Algorithm Principle

The algorithm mainly relies on the fact that objects with high expansion rate tend to objects with low expansion rate in the random creation process of the universe. This kind of gravitational effect can make objects transfer. With the help of relevant cosmological rules, objects can gradually tend to the optimal position in the search space. The traversal process is mainly divided into exploration and mining. Wormholes can be used as a medium to transfer objects, and search space exploration can be carried out through the interaction between white holes and black holes. The detailed operation of the algorithm in this paper is as follows:









2 Algorithm Flow Chart

Ii. Source code

%_______________________________________________________________________________________%
%  Multi-Verse Optimizer (MVO)Source Codes Demo Version 1.0 % % % % Developed in MATLABR2011b(7.13)                                                     %
%                                                                                       %
%  Author and programmer: Seyedali Mirjalili                                            %
%                                                                                       %
%         e-Mail: [email protected]                                               %
%                 [email protected]                                 %
%                                                                                       %
%       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 lband 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 
clc

Universes_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'[290   206   648   287])

%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 MATLABR2011b(7.13)                                                     %
%                                                                                       %
%  Author and programmer: Seyedali Mirjalili                                            %
%                                                                                       %
%         e-Mail: [email protected]                                               %
%                 [email protected]                                 %
%                                                                                       %
%       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 lband 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 Time<Max_time+1
    
    %Eq. (3.3) in the paper
    WEP=WEP_Min+Time*((WEP_Max-WEP_Min)/Max_time);
    
    %Travelling Distance Rate (Formula): Eq. (3.4) in the paper
    TDR=1-((Time)^(1/6)/(Max_time)^(1/6));
    
    %Inflation rates (I) (fitness values)
    Inflation_rates=zeros(1,size(Universes,1));
    
    for i=1:size(Universes,1)
        
        %Boundary checking (to bring back the universes inside search
        % space if they go beyoud the boundaries
        Flag4ub=Universes(i,:)>ub;
        Flag4lb=Universes(i,:)<lb;
        Universes(i,:)=(Universes(i,:).*(~(Flag4ub+Flag4lb)))+ub.*Flag4ub+lb.*Flag4lb;
        
        %Calculate the inflation rate (fitness) of universes
        Inflation_rates(1,i)=fobj(Universes(i,:));
        
        %Elitism
        if Inflation_rates(1,i)<Best_universe_Inflation_rate
            Best_universe_Inflation_rate=Inflation_rates(1,i);
            Best_universe=Universes(i,:);
        end
        
    end
    
    [sorted_Inflation_rates,sorted_indexes]=sort(Inflation_rates);
    
    for newindex=1:N
        Sorted_universes(newindex,:)=Universes(sorted_indexes(newindex),:);
    end
    
    %Normaized inflation rates (NI in Eq. (3.1) in the paper)
    normalized_sorted_Inflation_rates=normr(sorted_Inflation_rates);
    
    Universes(1,:)= Sorted_universes(1, :); %Update the Position of universesfor i=2:size(Universes,1)%Starting from 2 since the firt one is the elite
        Back_hole_index=i;
        for j=1:size(Universes,2)
            r1=rand();
            ifr1<normalized_sorted_Inflation_rates(i) White_hole_index=RouletteWheelSelection(-sorted_Inflation_rates); %for maximization problem -sorted_Inflation_rates should be written as sorted_Inflation_rates
                if White_hole_index==- 1
                    White_hole_index=1;
                end
                %Eq. (3.1) in the paper
                Universes(Back_hole_index,j)=Sorted_universes(White_hole_index,j);
            end
Copy the code

3. Operation results

Fourth, note

Version: 2014 a