You are on page 1of 6

APPENDIX A

TEST PROBLEMS IN OPTIMIZATION

In order to validate any new optimization algorithm, we have to validate it


against standard test functions so as to compare its performance with well-
established or existing algorithms. There are many test functions, so there is
no standard list or set of test functions one has to follow. However, various
test functions do exist, so new algorithms should be tested using at least a
subset of functions with diverse properties so as to make sure whether or not
the tested algorithm can solve certain type of optimization efficiently.
In this appendix, we will provide a subset of commonly used test functions
with simple bounds as constraints, though they are often listed as uncon­
strained problems in literature. We will list the function form f(x), its search
domain, optimal solutions tc* and/or optimal objective value /*. Here, we use
x = (xi, ...,xn)T where n is the dimension.

Ackley's function:

1 1 ™ 1 _"
f(x) = -20exp\--, -V^l-exp[-Vcos(2rai) + 20 + e, (A.l)
L 5 \ n *—^ J In ■'—f J
\ i=l i=l

Engineering Optimization: An Introduction with Metaheuristic Applications. 261


By Xin-She Yang
Copyright © 2010 John Wiley & Sons, Inc.
262 TEST PROBLEMS IN OPTIMIZATION

where n = 1,2,..., and -32.768 < x» < 32.768 for i = 1,2,...,n. This function
has the global minimum /* = 0 at x* = (0,0,..., 0).

De Jong's functions: The simplest of De Jong's functions is the so-called


sphere function
n

f(x) = J2x2i> ~5·12 - Xi


~ 5·12' (A·2)
i=\

whose global minimum is obviously /» = 0 at (0,0, ...,0). This function is


unimodal and convex. A related function is the so-called weighted sphere
function or hyper-ellipsoid function
n
/(;Β) = ] Γ Ζ Χ ? , -5.12 < Xi < 5.12, (A.3)

which is also convex and unimodal with a global minimum /* = 0 at x , =


(0,0,..., 0). Another related test function is the sum of different power function
n
f(x) = Yi\xi\i+1, -l<Xi<l, (A.4)
i=l

which has a global minimum /» = 0 at (0,0,..., 0).

Easom's function:

f{x) = — cos(x) cos(j/) exp — (x — π) 2 + (y — π)2 , (Α·5)

whose global minimum is /» = — 1 at xt = (π, π) within —100 < x, y < 100.


It has many local minima. Xin-She Yang extended in 2008 this function to n
dimensions, and we have
n n
f{x) = - ( - l r d J c o s 2 ^ ) ) exp [ - £ > i - π ) 2 ] , (Α.6)

whose global minimum /* = —1 occurs at x* = (π, π,..., π). Here the domain
is —2π < Xi < 2π where i = 1,2,..., n.

Equality-Constrained Function:
n
f(x) =-(y/n)nl[xi, (A.7)
i=l

subject to an equality constraint (a hyper-sphere)

Σ * 2 = ι· (Α·8)
TEST PROBLEMS IN OPTIMIZATION 263

The global minimum /* = —1 of f(x) occurs at x*(l/y/n,...,l/y/n) within


the domain 0 < Xi < 1 for i = 1,2, ...,n.

Griewank's function:
1 n n
/(x) = x cos
J^) Σ i - Π (W
^ ) + !> -600 ^x*^600' (A·9)

whose global minimum is /* = 0 at a:* = (0,0, ...,0). This function is highly


multimodal.

Michaelwicz's function:
n
· 2 . 2m
f(x) = - Σ s i n ( x i ) · sin
(—L) (A.10)
i=l

where m = 10, and 0 < χ^ < π for i — 1,2,..., n. In 2D case, we have

f(x,y) = -sm(x)sm20(-)-Sm(y)sm20(^), (A.ll)

where (x, y) £ [0,5] x [0,5]. This function has a global minimum /» « —1.8013
at x* = (x*,j/*) = (2.20319,1.57049).

Perm Functions:
n n

/(*) = Σ {Σ^'+ß) [ φ ' -*]}> w > °)» (A·12)


j=l i=l
which has the global minimum /* = 0 at x* = (1, 2,..., n) in the search domain
—n < Xi <n for i = 1,..., n. A related function

κχ) = Σ { ί > + 0 ) N - φ'] }2' (Α·13)


j=l i=l
has the global minimum /* = 0 at (1,1/2,1/3,..., 1/n) within the bounds
— 1 < Xi < 1 for all i = 1,2, ...,n. As /? > 0 becomes smaller, the global
minimum becomes almost indistinguishable from their local minima. In fact,
in the extreme case β = 0, every solution is also a global minimum.

Rastrigin's function:
n
f(x) = 10n+ } ^ \xf - 10α>8(2πχί -5.12 < Xi < 5.12, (A.14)
=1

whose global minimum is /* = 0 at (0,0, ...,0). This function is highly multi-


modal.
264 TEST PROBLEMS IN OPTIMIZATION

Rosenbrock's function:
n-l
f{x) = Σ \(xi - !) 2 + 100(zi+i - x 2 ) 2 , (A.15)

whose global minimum /* = 0 occurs at x* = (1,1,..., 1) in the domain


—5 < Xi < 5 where i = 1,2, ...,n. In the 2D case, it is often written as

/(x,y) = ( x - l ) 2 + 100(y-x2)2, (A.16)

which is often referred to as the banana function.

Schwefel's function:
n
f(x) = -Y^Xism(^y/\xi\\, -500 < Xi < 500, (A.17)
i=\

whose global minimum /* « —418.9829η occurs at Xj = 420.9687 where


% = 1,2, ...,n.

Six-hump camel back function:

fix, y) = (4 - 2.1x2 + l-xA)x2 + xy + 4(y 2 - l)y 2 , (A.18)

where — 3 < x < 3 and — 2 < y < 2. This function has two global minima
/* « -1.0316 at (x*,y*) = (0.0898,-0.7126) and (-0.0898,0.7126).

Shubert's function:
n n
/ ( » ) = [ 5 ^ t c o s ( t + (i + l)a:)] · [ 5 ^ i c o s ( i + ( i + l ) y ) , (A.19)
i=l i=l

which has 18 global minima /„ w —186.7309 for n = 5 in the search domain


- 1 0 < x , y < 10.

Xin-She Yang's functions:


n n
fix)= (^Ixiljexpf-^sinix2)], (A.20)

which has the global minimum /» = 0 at x* = (0,0,...,0) in the domain


—2π < Xi < 2π where i = 1,2, ...,n. This function is not smooth, and its
derivatives are not well defined at the optimum (0,0,..., 0).
A related function is
n n
/(a;) = - ( ^ | x i | ) e x p ( - ^ x 2 ) , -10<x8<10, (A.21)
i=l i=l
TEST PROBLEMS IN OPTIMIZATION 265

which has multiple global minima. For example, for n = 2, we have 4 equal
minima /* = - l / \ / e « -0.6065 at (1/2,1/2), ( 1 / 2 , - 1 / 2 ) , ( - 1 / 2 , 1 / 2 ) and
(-1/2,-1/2).
Yang also designed a standing-wave function with a defect
n
f(x)= re-Er=i(x<//3)2m-2e-Sr=1^l . JJcos2^, m = 5, (A.22)
*=i

which has many local minima and the unique global minimum /* = — 1 at
x* = (0,0,..., 0) for ß = 15 within the domain —20 < Xi < 20 for i = 1,2,..., n.
He also proposed another multimodal function

fix) = { [ £ sin 2 (x,)] - e x p ( - £ *?)} " <*P [ - X > i n 2 ^ / ^ ] , (Α.23)


i=l i=l i—\

whose global minimum /* = —1 occurs at x* = (0,0, ...,0) in the domain


— 10 < Xi < 10 where i — 1,2,..., n. In the 2D case, its landscape looks like a
wonderful candlestick.
Most test functions are deterministic. Yang designed a test function with
stochastic components

f{x, y) = - δ β - ^ - ^ + ί * - * ) ' ] - Σ Σ ^β-«[(*-*) 2 +(^) 2 ], (Α.24)


3=1 i=l

where a, β > 0 are scaling parameters, which can often be taken as α = β = 1.


Here ey are random variables and can be drawn from a uniform distribution
€ij ~ Unif[0,l]. The domain is 0 < x, y < K and K = 10. This function has
K2 local valleys at grid locations and the fixed global minimum at x* = (π, π).
It is worth pointing that the minimum / m ; n is random, rather than a fixed
value; it may vary from — (K2 + 5) to —5, depending a and β as well as the
random numbers drawn.
Furthermore, he also designed a stochastic function
71
I 1
f{x) = V €i \Xi - - , -5 < Xi < 5, (A.25)
i=l

where ti (z = 1,2,..., n) are random variables which are uniformly distributed


in [0,1]. That is, e^ ~Unif[0,1]. This function has the unique minimum /* = 0
at x* — (1,1/2,..., 1/n) which is also singular.

Zakharov's functions:

z=l i=l i=l


266 TEST PROBLEMS IN OPTIMIZATION

whose global minimum /» = 0 occurs at a;» = (0,0, ...,0). Obviously, we can


generalize this function as

/(*)=5>? + E./f, (A.27)


i=l fc=l

where K = 1,2, ...,20 and

ΐΣίΧί. (Α.28)
1
i=\

REFERENCES

1. D. H. Ackley, A Connectionist Machine for Genetic Hillclimbing, Kluwer Aca­


demic Publishers, 1987.
2. C. A. Floudas, P. M., Pardalos, C. S. Adjiman, W. R. Esposito, Z. H. Gumus,
S. T. Harding, J. L. Kiepeis, C. A., Meyer, C. A. Scheiger, Handbook of Test
Problems in Local and Global Optimization, Springer, 1999.
3. A. Hedar, Test function web pages, http://www-optima.amp.i.kyoto-u.ac.jp
/member /student/hedar/Hedar _nles/TestGO_files/Page364. htm
4. M. Molga, C. Smutnicki, "Test functions for optimization needs",
http://www.zsd.ict.pwr.wroc.pl/files/docs/functions.pdf
5. X. S. Yang, "Firefly algorithm, Levy flights and global optimization", in: Re-
search and Development in Intelligent Systems XXVI, (Eds M. Bramer et al. ),
Springer, London, pp. 209-218 (2010).
6. X. S. Yang and S. Deb, "Engineering optimization by cuckoo search", Int. J.
Math. Modeling and Numerical Optimization, 1, No. 4, (in press) (2010).
7. X. S. Yang, "Firefly algorithm, stochastic test functions and design optimiza­
tion", Int. J. Bio-inspired Computation, 2, No. 2, 78-84 (2010).

You might also like