Test Functions for Optimization

TEST_OPTIMIZATION is a C++ library which defines test problems for the scalar function optimization problem.

The scalar function optimization problem is to find a value for the M-dimensional vector X which minimizes the value of the given scalar function F(X).

A special feature of this library is that all the functions can be defined for any dimension 1 <= M.

The functions defined include:

  1. The sphere model;
  2. The axis-parallel hyper-ellipsoid function;
  3. The rotated hyper-ellipsoid function;
  4. Rosenbrock's valley;
  5. Rastrigin's function;
  6. Schwefel's function;
  7. Griewank's function;
  8. The power sum function;
  9. Ackley's function;
  10. Michalewicz's function;
  11. The drop wave function;
  12. The deceptive function;


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


TEST_OPTIMIZATION is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs:

ASA047, a C++ library which minimizes a scalar function of several variables using the Nelder-Mead algorithm.

BRENT, a C++ library which contains Richard Brent's routines for finding the zero, local minimizer, or global minimizer of a scalar function of a scalar argument, without the use of derivative information.

COMPASS_SEARCH, a C++ library which seeks the minimizer of a scalar function of several variables using compass search, a direct search algorithm that does not use derivatives.

PRAXIS, a C++ library which minimizes a scalar function of several variables.

TEST_OPT_CON, a C++ library which defines test problems for the minimization of a scalar function of several variables, with the search constrained to lie within a specified hyper-rectangle.


  1. Marcin Molga, Czeslaw Smutnicki,
    Test functions for optimization needs.
  2. David Ackley,
    A connectionist machine for genetic hillclimbing,
    Springer, 1987,
    ISBN13: 978-0898382365,
    LC: Q336.A25.
  3. Hugues Bersini, Marco Dorigo, Stefan Langerman, Gregory Seront, Luca Gambardella,
    Results of the first international contest on evolutionary optimisation,
    In Proceedings of 1996 IEEE International Conference on Evolutionary Computation,
    IEEE Press, pages 611-615, 1996.
  4. Laurence Dixon, Gabor Szego,
    The optimization problem: An introduction,
    in Towards Global Optimisation,
    edited by Laurence Dixon, Gabor Szego,
    North-Holland, 1975,
    ISBN: 0444109552,
    LC: QA402.5.T7.
  5. Zbigniew Michalewicz,
    Genetic Algorithms + Data Structures = Evolution Programs,
    Third Edition,
    Springer, 1996,
    ISBN: 3-540-60676-9,
    LC: QA76.618.M53.
  6. Leonard Rastrigin,
    Extremal control systems,
    in Theoretical Foundations of Engineering Cybernetics Series,
    Moscow: Nauka, Russian, 1974.
  7. Howard Rosenbrock,
    An Automatic Method for Finding the Greatest or Least Value of a Function,
    Computer Journal,
    Volume 3, 1960, pages 175-184.
  8. Hans-Paul Schwefel,
    Numerical optimization of computer models,
    Wiley, 1981,
    ISBN13: 978-0471099888,
    LC: QA402.5.S3813.
  9. Bruno Shubert,
    A sequential method seeking the global maximum of a function,
    SIAM Journal on Numerical Analysis,
    Volume 9, pages 379-388, 1972.
  10. Aimo Toern, Antanas Zilinskas,
    Global Optimization,
    Lecture Notes in Computer Science, Number 350,
    Springer, 1989,
    ISBN13: 978-0387508719,
    LC: QA402.T685

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the C++ source codes.

Last revised on 20 February 2012.