A+ A A-

I. Mathematical Expression:

$$f(X)=-5e^{\displaystyle -\beta\left[\left(x_1-\pi\right)^2+\left(x_2-\pi\right)^2\right]}-\sum^K_{j=1}\sum^K_{i=1}U_{ij}e^{\displaystyle -\alpha\left[\left(x_1-i\right)^2+\left(x_2-j\right)^2\right]}$$

where:

\(\bullet\) \(\alpha\) and \(\beta\) are scaling parameters and bigger than zero (i.e., \(\alpha, \beta > 0\)) \(\rightarrow\) In [1], \(\alpha=\beta=1\)

\(\bullet\) \(K\) is a controllable upper bound \(\rightarrow\) In [1], \(K=10\)

\(\bullet\) \(U_{ij} \ (i,j=1,2,\cdots,K)\) is a uniform distribution \(\rightarrow\) \(U_{ij} \sim \text{Unif}[0,1]\)

\(\bullet\) \(0\leq x_1,x_2 \leq K\)

\(\bullet\) \(f_{min}(X^*)\) is a random value rather than be a fixed \(\rightarrow\) It may vary from \(-(K^2+5)\) to \(-5\), depending on \(\alpha\), \(\beta\) and the generated \(U\)

\(\bullet\) \(x^*_i=\pi\)  \(\rightarrow\) With this global minimum there are \(K^2\) local valleys [1]

\(\bullet\) This function is shown in [1, 2], but it is mistakenly skipped in [3, 4] and other papers in the literature, which means that the sorting of the given functions in [3, 4] is not correct. Thus, this function is called Xin-She Yang's Function No.04 [5].

 

II. Citation Policy:

If you publish material based on databases obtained from this repository, then, in your acknowledgments, please note the assistance you received by using this repository. This will help others to obtain the same data sets and replicate your experiments. We suggest the following pseudo-APA reference format for referring to this repository:

Ali R. Al-Roomi (2015). Unconstrained Single-Objective Benchmark Functions Repository [https://www.al-roomi.org/benchmarks/unconstrained]. Halifax, Nova Scotia, Canada: Dalhousie University, Electrical and Computer Engineering.

Here is a BiBTeX citation as well:

@MISC{Al-Roomi2015,
author = {Ali R. Al-Roomi},
title = {{Unconstrained Single-Objective Benchmark Functions Repository}},
year = {2015},
address = {Halifax, Nova Scotia, Canada},
institution = {Dalhousie University, Electrical and Computer Engineering},
url = {https://www.al-roomi.org/benchmarks/unconstrained}
}

 

III. 2&3D-Plots:

 

IV. Controllable 3D Model:

- In case you want to adjust the rendering mode, camera position, background color or/and 3D measurement tool, please check the following link

- In case you face any problem to run this model on your internet browser (it does not work on mobile phones), please check the following link

 

V. MATLAB M-File:

% Xin-She Yang's Function # 4
% Range of initial points: 0 <= xj <= K , j=1,2
% Global minima: (x1,x2)=(pi,pi)
% f(X) is a random optima >> could be located between (-K^2+5) and -5
% Coded by: Ali R. Alroomi | Last Update: 12 August 2015 | www.al-roomi.org
   
clear
clc
warning off
 
alpha=1; % scaling parameter (>0)
beta=1; % scaling parameter (>0)
K=10; % controllable upper bound
% rng('default')  % for reproducibility
U=rand(K,K); % uniform distribution
 
x1min=0;
x1max=K;
x2min=0;
x2max=K;
R=1500; % steps resolution
x1=x1min:(x1max-x1min)/R:x1max;
x2=x2min:(x2max-x2min)/R:x2max;
   
for j=1:length(x1)
   
    for i=1:length(x2)
       
        for s=1:K
 
            for z=1:K
                In(z)=U(s,z)*exp(-alpha*((x1(j)-z)^2+(x2(i)-s)^2));  
            end
            Out(s)=sum(In);
        end
       
        f(i)=-5*exp(-beta*((x1(j)-pi)^2+(x2(i)-pi)^2))-sum(Out);
 
    end
   
    f_tot(j,:)=f;
 
end
 
figure(1)
meshc(x1,x2,f_tot);colorbar;set(gca,'FontSize',12);
xlabel('x_2','FontName','Times','FontSize',20,'FontAngle','italic');
set(get(gca,'xlabel'),'rotation',25,'VerticalAlignment','bottom');
ylabel('x_1','FontName','Times','FontSize',20,'FontAngle','italic');
set(get(gca,'ylabel'),'rotation',-25,'VerticalAlignment','bottom');
zlabel('f(X)','FontName','Times','FontSize',20,'FontAngle','italic');
title('3D View','FontName','Times','FontSize',24,'FontWeight','bold');
 
figure(2)
mesh(x1,x2,f_tot);view(0,90);colorbar;set(gca,'FontSize',12);
xlabel('x_2','FontName','Times','FontSize',20,'FontAngle','italic');
ylabel('x_1','FontName','Times','FontSize',20,'FontAngle','italic');
zlabel('f(X)','FontName','Times','FontSize',20,'FontAngle','italic');
title('X-Y Plane View','FontName','Times','FontSize',24,'FontWeight','bold');
 
figure(3)
mesh(x1,x2,f_tot);view(90,0);colorbar;set(gca,'FontSize',12);
xlabel('x_2','FontName','Times','FontSize',20,'FontAngle','italic');
ylabel('x_1','FontName','Times','FontSize',20,'FontAngle','italic');
zlabel('f(X)','FontName','Times','FontSize',20,'FontAngle','italic');
title('X-Z Plane View','FontName','Times','FontSize',24,'FontWeight','bold');
 
figure(4)
mesh(x1,x2,f_tot);view(0,0);colorbar;set(gca,'FontSize',12);
xlabel('x_2','FontName','Times','FontSize',20,'FontAngle','italic');
ylabel('x_1','FontName','Times','FontSize',20,'FontAngle','italic');
zlabel('f(X)','FontName','Times','FontSize',20,'FontAngle','italic');
title('Y-Z Plane View','FontName','Times','FontSize',24,'FontWeight','bold');

Click here to download m-file

 

VI. References:

[1] Xin-She Yang, "Firefly Algorithm, Stochastic Test Functions and Design Optimisation", International Journal of Bio-Inspired Computation, vol. 2, no. 2, pp. 78–84, March 2010.
[2] Xin-She Yang, Engineering Optimization: An Introduction with Metaheuristic Applications. Hoboken, New Jersey: John Wiley & Sons Inc, 2010.
[3] M. Jamil and X. S. Yang, "A Literature Survey of Benchmark Functions for Global Optimization Problems," International Journal of Mathematical Modelling and Numerical Optimisation, vol. 4, no. 2, pp. 150–194, Aug. 2013.
[4] A. Gavana, "Test Functions Index," Feb. 2013, [Accessed April 01, 2013]. [Online]. Available: http://infinity77.net/global_optimization/test_functions.html
[5] Ali R. Alroomi, "The Farm of Unconstrained Benchmark Functions," University of Bahrain, Electrical and Electronics Department, Bahrain, Oct. 2013. [Online]. Available: http://www.al-roomi.org/cv/publications