GEATbx: | Main page Tutorial Algorithms M-functions Parameter/Options Example functions www.geatbx.com |
2.1 De Jong's function 1 |
The simplest test function is De Jong's function 1. It is also known as sphere model. It is continuos, convex and unimodal.
function definition:
f_{1}(x)=sum(x(i)^2), i=1:n, -5.12<=x(i)<=5.12.
global minimum:
f(x)=0, x(i)=0, i=1:n.
This function is implemented in objfun1.
2.2 Axis parallel hyper-ellipsoid function |
The axis parallel hyper-ellipsoid is similar to De Jong's function 1. It is also known as the weighted sphere model. Again, it is continuos, convex and unimodal.
function definition:
f_{1a}(x)=sum(i·x(i)^2), i=1:n, -5.12<=x(i)<=5.12.
global minimum:
f(x)=0; x(i)= 0, i=1:n.
This function is implemented in objfun1a.
2.3 Rotated hyper-ellipsoid function |
An extension of the axis parallel hyper-ellipsoid is Schwefel's function1.2. With respect to the coordinate axes, this function produces rotated hyper-ellipsoids. It is continuos, convex and unimodal.
function definition:
f_{1b}(x)=sum(sum(x(j)^2), j=1:i), i=1:n, -65.536<=x(i)<=65.536.
global minimum:
f(x)=0; x(i)=0, i=1:n.
This function is implemented in objfun1b.
2.4 Moved axis parallel hyper-ellipsoid function |
This function is derived from the axis parallel hyper-ellipsoid. There is a slight difference between these two function definitions. In the end the moved axis parallel hyper-ellipsoid function is more elliptic than the original function and the minimum of the function is not at x(i) = 0.
function definition:
f_{1c}(x)=sum(5*i·x(i)^2), i=1:n, -5.12<=x(i)<=5.12.
global minimum:
f(x)=0; x(i)= 5*i, i=1:n.
This function is implemented in objfun1c.
2.5 Rosenbrock's valley (De Jong's function 2) |
Rosenbrock's valley is a classic optimization problem, also known as Banana function. The global optimum is inside a long, narrow, parabolic shaped flat valley. To find the valley is trivial, however convergence to the global optimum is difficult and hence this problem has been repeatedly used in assess the performance of optimization algorithms.
function definition:
f_{2}(x)=sum(100·(x(i+1)-x(i)^2)^2+(1-x(i))^2) i=1:n-1; -2.048<=x(i)<=2.048.
global minimum:
f(x)=0; x(i)=1, i=1:n.
This function is implemented in objfun2.
2.6 Rastrigin's function 6 |
Rastrigin's function is based on function 1 with the addition of cosine modulation to produce many local minima. Thus, the test function is highly multimodal. However, the location of the minima are regularly distributed.
function definition:
f_{6}(x)=10·n+sum(x(i)^2-10·cos(2·pi·x(i))), i=1:n; -5.12<=x(i)<=5.12.
global minimum:
f(x)=0; x(i)=0, i=1:n.
This function is implemented in objfun6.
2.7 Schwefel's function 7 |
Schwefel's function [Sch81] is deceptive in that the global minimum is geometrically distant, over the parameter space, from the next best local minima. Therefore, the search algorithms are potentially prone to convergence in the wrong direction.
function definition:
f_{7}(x)=sum(-x(i)·sin(sqrt(abs(x(i))))), i=1:n; -500<=x(i)<=500.
global minimum:
f(x)=-n·418.9829; x(i)=420.9687, i=1:n.
This function is implemented in objfun7.
2.8 Griewangk's function 8 |
Griewangk's function is similar to Rastrigin's function. It has many widespread local minima. However, the location of the minima are regularly distributed.
function definition:
f_{8}(x)=sum(x(i)^2/4000)-prod(cos(x(i)/sqrt(i)))+1, i=1:n -600<=x(i)<= 600.
global minimum:
f(x)=0; x(i)=0, i=1:n.
This function is implemented in objfun8.
The graphics in Figure 2-8 below depict Griewangk's function using three different resolutions. Each of the graphics represents different properties of the function. The graphic on the top left side shows the full definition range of the function. Here, the function looks very similar to De'Jong's function 1. When approaching the inner area, the function looks different. Many small peaks and valleys are visible in the right graphic. When zooming in on the area of the optimum, grahic on the bottom left side, the peaks and valleys look smooth.
2.9 Sum of different power function 9 |
The sum of different powers is a commonly used unimodal test function.
function definition:
f_{9}(x)=sum(abs(x(i))^(i+1)), i=1:n; -1<=x(i)<=1.
global minimum:
f(x)=0; x(i)=0, i=1:n.
This function is implemented in objfun9.
2.10 Ackley's Path function 10 |
Ackley's Path [Ack87] is a widely used multimodal test function.
function definition:
f_{10}(x)=-a·exp(-b·sqrt(1/n·sum(x(i)^2)))-exp(1/n·sum(cos(c·x(i))))+a+exp(1) a=20; b=0.2; c=2·pi; i=1:n; -32.768<=x(i)<=32.768.
global minimum:
f(x)=0; x(i)=0, i=1:n.
This function is implemented in objfun10.
Figure 2-10 shows the function at two different zoom ratios. The graphic on the left side employs the whole definition area of the function from -30 to 30. The graphic on the right side zooms into the area of the global minimum giving a better impression of the properties of the function.
2.11 Langermann's function 11 |
The Langermann function is a multimodal test function. The local minima are unevenly distributed.
function definition:
f_{11}(x)=-sum(c(i)·(exp(-1/pi·sum((x-A(i))^2))·cos(pi·sum((x-A(i))^2)))) i=1:m, 2<=m<=10; 0<=x(i)<=10.
for the value of A and c look at the mfile objfun11.
global minimum:
f(x)=-1.4 (for m=5); x(i)=???, i=1:n.
This function is implemented in objfun11.
Figure 2-11 displays Langermann's function with different variables. The graphic on the left side shows a mesh plot of the first and second variable. The graphic on the right side uses the second and third variable while the first variable is set to 0.
2.12 Michalewicz's function 12 |
The Michalewicz function [Mic92] is a multimodal test function (n! local optima). The parameter m defines the "steepness" of the valleys or edges. Larger m leads to more difficult search. For very large m the function behaves like a needle in the haystack (the function values for points in the space outside the narrow peaks give very little information on the location of the global optimum).
function definition:
f12(x)=-sum(sin(x(i))·(sin(i·x(i)^2/pi))^(2·m)), i=1:n, m=10 0<=x(i)<=pi.
global minimum:
f(x)=-4.687 (n=5); x(i)=???, i=1:n. f(x)=-9.66 (n=10); x(i)=???, i=1:n.
This function is implemented in objfun12.
The first two graphics below represent a global and a local view to Michalewicz's function, both for the first two variables. The third graphic on the right side displays the function using the third and fourth variable, the first two variables were set to 0. By comparing the left and the right graphic the increasing difficulty of the function can be seen. As higher the dimension as more valleys are introduced into the function.
2.13 Branins's rcos function |
The Branin rcos function [Bra72] is a global optimization test function. The function has 3 global optima.
function definition:
f_{Bran}(x_{1},x_{2})=a·(x_{2}-b·x_{1}^2+c·x_{1}-d)^2+e·(1-f)·cos(x_{1})+e a=1, b=5.1/(4·pi^2), c=5/pi, d=6, e=10, f=1/(8·pi) -5<=x_{1}<=10, 0<=x_{2}<=15.
global minimum:
f(x_{1},x_{2})=0.397887; (x_{1},x_{2})=(-pi,12.275), (pi,2.275), (9.42478,2.475).
This function is implemented in objbran.
2.14 Easom's function |
The Easom function [Eas90] is a unimodal test function, where the global minimum has a small area relative to the search space. The function was inverted for minimization.
function definition:
f_{Easo}(x_{1},x_{2})=-cos(x_{1})·cos(x_{2})·exp(-((x_{1}-pi)^2+(x_{2}-pi)^2)) -100<=x(i)<=100, i=1:2.
global minimum:
f(x_{1},x_{2})=-1; (x_{1},x_{2})=(pi,pi).
This function is implemented in objeaso.
2.15 Goldstein-Price's function |
The Goldstein-Price function [GP71] is a global optimization test function.
function definition:
f_{Gold}(x_{1},x_{2})=[1+(x_{1}+x_{2}+1)^2·(19-14·x_{1}+3·x_{1}^2-14·x_{2}+6·x_{1}·x_{2}+3·x_{2}^2)]· [30+(2·x_{1}-3·x_{2})^2·(18-32·x_{1}+12·x_{1}^2+48·x_{2}-36·x_{1}·x_{2}+27·x_{2}^2)] -2<=x(i)<=2, i=1:2.
global minimum:
f(x_{1},x_{2})=3; (x_{1},x_{2})=(0,-1).
This function is implemented in objgold.
2.16 Six-hump camel back function |
The 2-D Six-hump camel back function [DS78] is a global optimization test function. Within the bounded region are six local minima, two of them are global minima.
function definition:
f_{Sixh}(x_{1},x_{2})=(4-2.1·x_{1}^2+x_{1}^4/3)·x_{1}^2+x_{1}·x_{2}+(-4+4·x_{2}^2)·x_{2}^2 -3<=x_{1}<=3, -2<=x_{2}<=2.
global minimum:
f(x_{1},x_{2})=-1.0316; (x_{1},x_{2})=(-0.0898,0.7126), (0.0898,-0.7126).
This function is implemented in objsixh.
GEATbx: | Main page Tutorial Algorithms M-functions Parameter/Options Example functions www.geatbx.com |