5.2. pyopus.problems.glbc — Global optimization test functions

Inheritance diagram of pyopus.problems.glbc

Global optimization bound constrained test problems (PyOPUS subsystem name: GLBC)

Implemented by Árpád Bűrmen and Jernej Olenšek.

All test functions in this module are maps from R to R^n.

Gradient is not implemented and is in some cases even impossible to implement (e.g. Quartic noisy function).

The functions can be wrapped into RandomDelay objects to introduce a random delay in function evaluation.

The Yao et. al. set and the Hedar set have some functions in common. The “Hump” function from the Hedar set is named “SixHump” here. Hedar’s version of the Rosenbrock problem is obtained by setting hedar to True.

The Yang set of test functions extends the Easom’s function to n dimensions. The Zakharov test function is extended beyond K=2. Yang’s version of problems is obtained by setting yang to True. Equality constrained function is omitted (nonlinear equality constraint). Both stochastic functions are also omitted.

The functions were taken from [yao], [hedar], and [yang].

This module is independent of PyOPUS, meaning that it can be taken as is and used as a module in some other package. It depends only on the cpi module.

[yao]Yao X., Liu Y., Lin G.: Evolutionary programming made faster. IEEE Transactions on Evolutionary Computation, vol. 3, pp. 82-102, 1999.
[hedar]Hedar A.: Global optimization test problems. http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO.htm
[yang]Yang X.-S.: Test Problems in Optimization. arXiv preprint at http://arxiv.org/abs/1008.0549, 2010.
class pyopus.problems.glbc.GlobalProblem(n)

Base class for global optimization test functions

The full name of the problem is in the name member. The lower and the upper bounds are in the xl and xh member.

The position and the function value for the best known solution are given by xmin and fmin.

Objects of this class are callable. The calling convention is

object(x)

where x is the input values vector. The function value at x is returned.

Most functions are variably dimensional (n can be specified as an argument to the constructor).

Example: create an instance of the Schwefel C function with n=40 and evaluate it at the origin:

from pyopus.optimizer.glbc import SchwefelC
from numpy import zeros

sc=SchwefelC(n=40)

# Evaluate the function at the origin
f=sc(zeros(40))
cpi()

Returns the common problem interface.

Initial point and gradient function are not available.

See the CPI class for more information.

pyopus.problems.glbc.GlobalBCsuite = [<class 'pyopus.problems.glbc.Quadratic'>, <class 'pyopus.problems.glbc.SchwefelA'>, <class 'pyopus.problems.glbc.SchwefelB'>, <class 'pyopus.problems.glbc.SchwefelC'>, <class 'pyopus.problems.glbc.Rosenbrock'>, <class 'pyopus.problems.glbc.Step'>, <class 'pyopus.problems.glbc.QuarticNoisy'>, <class 'pyopus.problems.glbc.SchwefelD'>, <class 'pyopus.problems.glbc.Rastrigin'>, <class 'pyopus.problems.glbc.Ackley'>, <class 'pyopus.problems.glbc.Griewank'>, <class 'pyopus.problems.glbc.Penalty1'>, <class 'pyopus.problems.glbc.Penalty2'>, <class 'pyopus.problems.glbc.ShekelFoxholes'>, <class 'pyopus.problems.glbc.Kowalik'>, <class 'pyopus.problems.glbc.SixHump'>, <class 'pyopus.problems.glbc.Branin'>, <class 'pyopus.problems.glbc.GoldsteinPrice'>, <class 'pyopus.problems.glbc.Hartman'>, <class 'pyopus.problems.glbc.Shekel'>, <class 'pyopus.problems.glbc.Beale'>, <class 'pyopus.problems.glbc.Bohachevsky'>, <class 'pyopus.problems.glbc.Booth'>, <class 'pyopus.problems.glbc.Colville'>, <class 'pyopus.problems.glbc.DixonPrice'>, <class 'pyopus.problems.glbc.Easom'>, <class 'pyopus.problems.glbc.Levy'>, <class 'pyopus.problems.glbc.Matyas'>, <class 'pyopus.problems.glbc.Michalewicz'>, <class 'pyopus.problems.glbc.Perm'>, <class 'pyopus.problems.glbc.Perm0'>, <class 'pyopus.problems.glbc.Powell'>, <class 'pyopus.problems.glbc.PowerSum'>, <class 'pyopus.problems.glbc.Schwefel'>, <class 'pyopus.problems.glbc.Shubert'>, <class 'pyopus.problems.glbc.Sphere'>, <class 'pyopus.problems.glbc.SumSquares'>, <class 'pyopus.problems.glbc.Trid'>, <class 'pyopus.problems.glbc.Zakharov'>, <class 'pyopus.problems.glbc.DifferentPowerSum'>, <class 'pyopus.problems.glbc.Yang1'>, <class 'pyopus.problems.glbc.Yang2'>, <class 'pyopus.problems.glbc.Yang3'>]

A list holding references to all function classes in this module.

class pyopus.problems.glbc.Quadratic(n=30)

Quadratic function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.SchwefelA(n=30)

Schwefel 2.22 function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.SchwefelB(n=30)

Schwefel 1.2 function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.SchwefelC(n=30)

Schwefel 2.21 function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Rosenbrock(n=30, yang=False, hedar=False)

Generalized Rosenbrock function (n>=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Step(n=30)

Step function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.QuarticNoisy(n=30)

Quartic noisy function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.SchwefelD(n=30)

Schwefel 2.26 function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Rastrigin(n=30)

Generalized Rastrigin function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Ackley(n=30, yang=False)

Ackley function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Griewank(n=30)

Generalized Griewank function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Penalty1(n=30)

Generalized penalty function 1 (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Penalty2(n=30)

Generalized penalty function 2 (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.ShekelFoxholes(n=2)

Shekel foxholes function (n=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Kowalik(n=4)

Kowalik function (n=4).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.SixHump(n=2, yang=False)

Six-hump camel-back function (n=2).

This function is named “Hump” in Hedar’s set of test problems.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Branin(n=2)

Branin function (n=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.GoldsteinPrice(n=2)

Goldstein-Price function (n=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Hartman(n=3)

Hartman function (n=3 or n=6).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Shekel(n=4, m=5)

Shekel function (n=4, m=5, 7, or 10).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Beale

Beale function (n=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Bohachevsky(j=1)

Bohachevsky functions (n=2, j=1,2,3).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Booth

Booth function (n=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Colville

Colville function (n=4).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.DixonPrice(n=30)

Dixon and Price function (n>=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Easom(n=2, yang=False)

Easom function (n=2). The generalization for n>2 was given by Yang. n>2 assumes Yang’s version is requested.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Levy(n=30)

Levy function (n>=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Matyas
  • Matyas function (n=2).

    See the GlobalProblem class for more information.

class pyopus.problems.glbc.Michalewicz(n=10)

Michalewicz function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Perm(n=20, beta=0.5)

Perm function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Perm0(n=30, beta=10, yang=False)

Perm function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Powell(n=32, beta=0.5)

Powell function (n=4k, k>0).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.PowerSum(n=4, b=None)

Power sum function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Schwefel(n=30, yang=False)

Schwefel function (n>=1), slightly modified SchwefelD with a general global minimum valid for arbitrary n.

Yang’s version is obtained with yang set to True.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Shubert(m=5)

Shubert function (n=2).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Sphere(n=30)

Sphere function (n>=1). Also known as DeJong’s sphere function.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.SumSquares(n=30, yang=False)

Sphere function (n>=1). Also known as DeJong’s weighted sphere function.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Trid(n=10)

Trid function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Zakharov(n=10, K=2)

Zakharov function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.DifferentPowerSum(n=30)

Sum of different powers function (n>=1).

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Yang1(n=10)

Yang2 function (n>=1). See (21) in the corresponding paper.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Yang2(n=10)

Yang2 function (n>=1). See (21) in the corresponding paper.

See the GlobalProblem class for more information.

class pyopus.problems.glbc.Yang3(n=10)

Yang2 function (n>=1). See (24) in the corresponding paper.

See the GlobalProblem class for more information.

Example file glbc.py in folder demo/problems/

# Global optimization problems

from pyopus.problems.glbc import GlobalBCsuite

if __name__=='__main__':
	print("Global optimization problems (bound constrained, initial point at 1/4 range)")
	for ii in range(len(GlobalBCsuite)):
		prob=GlobalBCsuite[ii]()
		x0=prob.xl*0.25+prob.xh*0.75
		print("%2d: %40s n=%2d: f0=%e" % (ii, prob.name, prob.n, prob(x0)))
	print()