Classic Problems Module#

Built-in test problems for optimization:

  • Rosenbrock: Banana-shaped valley function

  • Sphere: Simple quadratic function

  • Rastrigin: Multimodal function with many local minima

  • Ackley: Function with wide valley

  • Branin: Two-dimensional function with multiple minima

Classic Problems#

This file contains the basic objects to build a problem and to do a single evaluation.

Known optima#

A problem whose global minimum is known declares it as x_opt (a point in the default box, or None when the minimisers are not isolated — then x_opt_example is one of them) and f_opt (the value there) — class attributes for fixed-dimension problems, properties where they depend on dim. A problem constructed with a non-default box or parameters may not keep them; they describe the defaults. tests/test_classic_optima.py checks f(x_opt) == f_opt for every declaration and runs a DE search that must not beat f_opt.

References

[JY13] (1,2)

M. Jamil, X.-S. Yang, A literature survey of benchmark functions for global optimization problems, Int. J. Mathematical Modelling and Numerical Optimisation 4(2), 150-194 (2013). DOI: 10.1504/IJMMNO.2013.055204

class panobbgo.lib.classic.Ackley(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Ackley function.

\[f(\mathbf{x}) = -20 \exp\left(-0.2 \sqrt{\frac{1}{n} \sum_{i=1}^{n} x_i^2}\right) - \exp\left(\frac{1}{n} \sum_{i=1}^{n} \cos(2\pi x_i)\right) + 20 + e\]

The Ackley function is a multimodal test function for optimization algorithms. It has a nearly flat outer region and a large hole at the center. The function is continuous, convex and unimodal in a narrow valley.

Global minimum: \(f(0,\dots,0) = 0\)

References

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.Arwhead(dim: int | None = None, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

ARWHEAD test problem [Conn]

\[F(x) = \sum_{i=1}^{n-1} \left( (x_i^2 + x_n^2)^2 - 4 x_i + 3 \right)\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.Beale(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Beale function [UncTest]

\[F(x) = \sum_{i=1}^3 \left( y_i - x_1 ( 1-x_2^i) \right) ^2\]

where

\[y_1 = 1.5, \, y_2 = 2.25, \, y_3 = 2.625\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
x_opt = (3.0, 0.5)#
class panobbgo.lib.classic.Box(m: int = 10, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Box three-dimensional function, Moré-Garbow-Hillstrom [UncTest] no. 12

\[F(x) = \sum_{i=1}^m \left(e^{-t_i x_1} - e^{-t_i x_2} - x_3(e^{-t_i} - e^{-10 t_i})\right)^2, \quad t_i = i / 10\]

Global minimum 0 at \((1, 10, 1)\), \((10, 1, -1)\) and on the line \(x_1 = x_2, x_3 = 0\). (The first exponent had the wrong sign, and m = 1 left the problem under-determined.)

Parameters:

m (int) – number of residuals, m >= 3 (default 10, as in [UncTest])

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

x_opt = None#

the minimisers include a whole line, so no distance-to-optimum is meaningful. x_opt_example is one of them inside the default box ((1, 10, 1) is outside it).

Type:

Not a single point

x_opt_example = (1.0, 1.0, 0.0)#
class panobbgo.lib.classic.Branin(a: float = 1, b: float = 0.12918450914398066, c: float = 1.5915494309189535, r: float = 6, s: float = 10, t: float = 0.039788735772973836, **kwargs: Any)[source]#

Bases: Problem

BRANIN test problem [branin]

\[ \begin{align}\begin{aligned}F(X) = a(x_2 - b x_1^2 + c x_1 - r)^2 + s(1-t) \cos(x_1) + s\\a = 1,\,b = 5.1 ⁄ (4 π^2),\, c = 5 ⁄ π,\, r = 6,\, s = 10 and t = 1 ⁄ (8π)\end{aligned}\end{align} \]

Global minimum \(5/(4\pi) \approx 0.397887\) at \((-\pi, 12.275)\), \((\pi, 2.275)\) and \((3\pi, 2.475)\). (The default t was 1, which cancels the cosine term.)

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.3978873577297384#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

x_opt = (3.141592653589793, 2.275)#
class panobbgo.lib.classic.DeJong(dims: int, c: float = 1, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

De Jong function:

\[\operatorname{DJ}(x) = c \, \sum_{i=1}^n (x - dx)_i^2\]

with defaults \(c = 1\) and \(dx = \vec{0}\).

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.DixonPrice(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Dixon & Price function.

The Dixon & Price function is a unimodal test function for optimization algorithms. It has a long, narrow valley that makes it challenging for algorithms to converge to the global minimum along the valley floor.

\[f(\mathbf{x}) = (x_1 - 1)^2 + \sum_{i=2}^{D} i (2x_i^2 - x_{i-1})^2\]

The function creates a valley that becomes increasingly narrow as the dimension increases, making it difficult for optimization algorithms to follow the valley to the minimum.

Global minimum: \(f(x^*) = 0\) at \(x^*_i = 2^{-\frac{2^i-2}{2^i}}\), \(i = 1, \dots, D\)

References

[DixonPrice]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.GoldsteinPrice(**kwargs: Any)[source]#

Bases: Problem

Goldstein-Price test function [branin]

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 3.0#
x_opt = (0.0, -1.0)#
class panobbgo.lib.classic.Griewank(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Griewank function.

The Griewank function is a multimodal test function for optimization algorithms. It combines a quadratic term with a product of cosine terms, creating many local minima that make it challenging for optimization algorithms.

\[f(\mathbf{x}) = 1 + \frac{1}{4000} \sum_{i=1}^{n} x_i^2 - \prod_{i=1}^{n} \cos\left(\frac{x_i}{\sqrt{i}}\right)\]

The function has a global minimum at the origin and many local minima due to the cosine product term. The division by \(\sqrt{i}\) in the cosine arguments creates different scales for different dimensions.

Global minimum: \(f(0,\dots,0) = 0\)

References

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.HelicalValley(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Helical valley function [UncTest]

\[F(x) = \left(10(x_3 - 10 \, \Theta (x_1, x_2) \right)^2 + \left(10 \sqrt{ x_1^2 + x_2^2 } - 1\right)^2 + x_3^2\]

where

\[\begin{split}\Theta(x_1, x_2) = \begin{cases} \frac{1}{2 \pi} \arctan (\frac{x_2}{x_1}), & \text{if} & x_1 > 0 \\ \frac{1}{2 \pi} \arctan (\frac{x_2}{x_1}) + .5, & \text{if} & x_1 < 0 \end{cases}\end{split}\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
x_opt = (1.0, 0.0, 0.0)#
class panobbgo.lib.classic.Himmelblau(**kwargs: Any)[source]#

Bases: Problem

Himmelblau [HB] testproblem.

\[f(x,y) = (x^2+y-11)^2 + (x+y^2-7)^2\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
x_opt = (3.0, 2.0)#

One of the four global minima (all have f = 0).

class panobbgo.lib.classic.MishraBird(**kwargs: Any)[source]#

Bases: Problem

Mishra’s Bird function - constrained. f(x,y) = sin(y)e^((1-cos(x))^2) + cos(x)e^((1-sin(y))^2) + (x-y)^2 s.t. (x+5)^2 + (y+5)^2 < 25

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

eval_constraints(x)[source]#

This method is optionally overwritten by the problem to calculate the constraint violations. It has to return a numpy.ndarray of floats.

Return type:

numpy.ndarray

class panobbgo.lib.classic.NesterovQuadratic(dim: int | None = None, box: Sequence[Tuple[float, float]] | None = None, A: Any = None, b: Any = None, nonsmooth: bool = True, seed: int | None = None, **kwargs: Any)[source]#

Bases: Problem

Nesterov’s Quadratic Function [NQuad]

\[F(x) = \frac{1}{2} \lVert A x - b \rVert_2^2 + \lVert x \rVert_1\]
Parameters:
  • dim (int) – dimension when neither A nor b is given (default: len(box), else 2) — it used to be ignored

  • nonsmooth (boolean) – add the nonsmooth \(\lVert x\rVert_1\) part (default: True)

  • seed (int) – seed for the random A / b that are not given; None draws it from numpy’s global state, so np.random.seed before construction reproduces them

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

class panobbgo.lib.classic.Powell(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Powell singular function, Moré-Garbow-Hillstrom [UncTest] no. 13

\[P(x) = (x_1 + 10 x_2)^2 + 5 (x_3 - x_4)^2 + (x_2 - 2 x_3)^4 + 10 (x_1 - x_4)^4\]

Global minimum: \(P(0, 0, 0, 0) = 0\) (singular Hessian there).

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

x_opt = (0.0, 0.0, 0.0, 0.0)#
class panobbgo.lib.classic.PressureVessel(**kwargs: Any)[source]#

Bases: Problem

Pressure Vessel Design problem.

Minimize cost f(x) = 0.6224 x1 x3 x4 + 1.7781 x2 x3^2 + 3.1661 x1^2 x4 + 19.84 x1^2 x3 Subject to: g1(x) = -x1 + 0.0193 x3 <= 0 g2(x) = -x2 + 0.00954 x3 <= 0 g3(x) = -pi x3^2 x4 - 4/3 pi x3^3 + 1296000 <= 0 g4(x) = x4 - 240 <= 0

Variables: x1: Ts (shell thickness) [0, 99] x2: Th (head thickness) [0, 99] x3: R (inner radius) [10, 200] x4: L (length) [10, 200]

Optimum of this continuous version: f(x) approx 5885.3326 at (0.7781686, 0.3846492, 40.3196187, 200). The often-quoted 6059.7143 is the mixed-integer variant, where the thicknesses x1, x2 are multiples of 0.0625.

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

eval_constraints(x)[source]#

This method is optionally overwritten by the problem to calculate the constraint violations. It has to return a numpy.ndarray of floats.

Return type:

numpy.ndarray

class panobbgo.lib.classic.Quadruple(dims: int, c: float = 1, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Quadruple Function [QuadF]

\[Q(x) = c \, \sum_{i=1}^n \left( \frac{x_i - dx}{4} \right)^4\]

with defaults \(c = 1\) and \(dx = \vec{0}\).

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.Rastrigin[source]#

Bases: Problem

\[f(x) = \mathit{par}_1 \cdot n + \sum_i (x_i^2 - 10 \cos(2 \pi x_i) )\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.Ripple1(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Ripple 1 function.

The Ripple 1 function is a highly multimodal test function with many local minima. It creates a landscape with 25 holes in a 5x5 grid plus additional ripples.

\[f(\mathbf{x}) = \sum_{i=1}^{2} -e^{-2\ln2(\frac{x_i-0.1}{0.8})^2} (\sin^6(5\pi x_i) + 0.1\cos^2(500\pi x_i))\]

The function has one global minimum and 252,004 local minima. The landscape consists of 25 holes forming a 5×5 regular grid plus high-frequency ripples.

Global minimum: Located within bounds (complex)

References

[Ripple1]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = -2.2#
x_opt = (0.1, 0.1)#
class panobbgo.lib.classic.Ripple25(box=None, **kwargs)[source]#

Bases: Problem

Ripple 25 function.

The Ripple 25 function is a multimodal test function similar to Ripple 1 but without the high-frequency cosine ripples.

\[f(\mathbf{x}) = \sum_{i=1}^{2} -e^{-2\ln2(\frac{x_i-0.1}{0.8})^2} \sin^6(5\pi x_i)\]

The function creates 25 holes in a 5×5 grid pattern without additional ripples. It has fewer local minima compared to Ripple 1.

Global minimum: Located within bounds (complex)

References

[Ripple25]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = -2.0#
x_opt = (0.1, 0.1)#
class panobbgo.lib.classic.Rosenbrock(dims: int | None = None, par1: float = 100, optimum: Any = None, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Rosenbrock function with parameter par1 and configurable optimum location.

\[f(x) = \sum_i (\mathit{par}_1 (y_{i+1} - y_i^2)^2 + (1-y_i)^2)\]

where \(y = x - \mathit{optimum} + \mathbf{1}\) shifts the optimum from the standard location \(\mathbf{1} = (1, 1, \ldots, 1)\) to the specified optimum location.

Parameters:
  • dims (int, optional) – Number of dimensions. Can be omitted if optimum is a vector.

  • par1 (float, optional) – Coefficient for the quadratic term (default: 100). Higher values create a steeper, narrower valley.

  • optimum (float or array-like, optional) – Location of the optimum. Can be: - A scalar: applied to all dimensions (default: 1.0) - A vector: specifies each coordinate of the optimum If a vector is provided and dims is omitted, dims is inferred.

  • box (list of tuples, optional) – Custom bounding box. If not provided, defaults to [(-2, 2)] * dims with the first dimension adjusted to (0, 2).

Examples

Standard 2D Rosenbrock with optimum at [1, 1]:

>>> from panobbgo.lib.classic import Rosenbrock
>>> problem = Rosenbrock(dims=2)

2D Rosenbrock with optimum at [5, 3]:

>>> problem = Rosenbrock(dims=2, optimum=[5, 3], box=[(-10, 10), (-10, 10)])

Infer dims from optimum vector:

>>> problem = Rosenbrock(optimum=[24, -12], box=[(-100, 100), (-100, 100)])
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.RosenbrockAbs(dims: int, par1: float = 100, **kwargs: Any)[source]#

Bases: Problem

Absolute Rosenbrock function.

\[f(x) = \sum_i \mathit{par}_1 \Big\lVert x_{i+1} - \lVert x_i \rVert \Big\rVert + \lVert 1 - x_i \rVert\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.RosenbrockAbsConstraint(dims: int, par1: float = 100, par2: float = 0.1, **kwargs: Any)[source]#

Bases: Problem

Absolute Rosenbrock function.

\[\begin{split}\min f(x) & = \sum_i \mathit{par}_1 \Big\lVert x_{i+1} - \lVert x_i \rVert \Big\rVert + \lVert 1 - x_i \rVert \\ \mathit{s.t.} \;\; & \lVert x_{i+1} - x_{i}\rVert \geq \mathit{par}_2 \;\; \forall i \in \{0,\dots,\mathit{dim}-1\} \\ & x_i \geq 0 \;\; \forall i\end{split}\]
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

eval_constraints(x)[source]#

This method is optionally overwritten by the problem to calculate the constraint violations. It has to return a numpy.ndarray of floats.

Return type:

numpy.ndarray

class panobbgo.lib.classic.RosenbrockConstraint(dims: int | None = None, par1: float = 100, par2: float = 0.25, optimum: Any = None, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Constrained Rosenbrock function with configurable optimum location.

\[\begin{split}\min f(x) & = \sum_i \mathit{par}_1 (y_{i+1} - y_i^2)^2 + (1-y_i)^2 \\ \mathit{s.t.} \;\; & (y_{i+1} - y_{i})^2 \geq \mathit{par}_2 \;\; \forall i \in \{0,\dots,\mathit{dim}-1\} \\ & y_i \geq 0 \;\; \forall i\end{split}\]

where \(y = x - \mathit{optimum} + \mathbf{1}\) shifts the optimum.

Parameters:
  • dims (int, optional) – Number of dimensions. Can be omitted if optimum is a vector.

  • par1 (float, optional) – Coefficient for the quadratic term (default: 100).

  • par2 (float, optional) – Constraint parameter for minimum distance between consecutive coordinates (default: 0.25).

  • optimum (float or array-like, optional) – Location of the optimum. Can be: - A scalar: applied to all dimensions (default: 1.0) - A vector: specifies each coordinate of the optimum If a vector is provided and dims is omitted, dims is inferred.

  • box (list of tuples, optional) – Custom bounding box. If not provided, defaults to [(-2, 2)] * dims with the first dimension adjusted to (0, 2).

Note

The constraints are evaluated in the shifted coordinate system, so they apply relative to the optimum location.

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

eval_constraints(x)[source]#

This method is optionally overwritten by the problem to calculate the constraint violations. It has to return a numpy.ndarray of floats.

Return type:

numpy.ndarray

class panobbgo.lib.classic.RosenbrockModified(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Rosenbrock Modified function.

The Rosenbrock Modified function is a multimodal test function that adds a Gaussian bump to the standard Rosenbrock function, creating a local minimum that makes optimization more challenging.

\[f(\mathbf{x}) = 74 + 100(x_2 - x_1^2)^2 + (1 - x_1)^2 - 400 \exp\left(-\frac{(x_1 + 1)^2 + (x_2 + 1)^2}{0.1}\right)\]

The Gaussian bump centred at \((-1, -1)\) digs the global minimum \(f \approx 34.0402\) at \((-0.90955, -0.95057)\) (not \(f(-1,-1) = 0\): \(f(-1,-1) = 78\)); the Rosenbrock valley keeps a local minimum \(f(1,1) = 74\) with the far larger basin of attraction. Computed numerically (Nelder-Mead from Jamil & Yang’s approximate location).

Global minimum: \(f(-0.90955374, -0.95057171) \approx 34.0402431\)

References

[RosenbrockModified]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 34.04024310664056#
x_opt = (-0.90955374, -0.95057171)#
class panobbgo.lib.classic.RosenbrockStochastic(dims: int, par1: float = 100, jitter: float = 0.1, seed: int | None = None, **kwargs: Any)[source]#

Bases: Problem

Stochastic variant of Rosenbrock function.

\[f(x) = \sum_i (\mathit{par}_1 \mathit{eps}_i (x_{i+1} - x_i^2)^2 + (1-x_i)^2)\]

where \(\mathit{eps}_i\) is a uniformly random (n-1)-dimensional vector in \(\left[0, \mathit{jitter}\right)^{n-1}\), drawn from the stream that is a pure function of (seed, x, k) for the k-th evaluation of x (panobbgo.lib.noise.point_rng()), so it does not depend on thread scheduling. seed=None draws the seed from numpy’s global state at construction, so np.random.seed before creating the problem still reproduces it. Since \(\mathit{eps} \geq 0\), the minimum is 0 at \((1, \dots, 1)\) for every draw.

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

property x_opt: ndarray#
class panobbgo.lib.classic.RotatedEllipse(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Rotated Ellipse function.

The Rotated Ellipse function is a unimodal quadratic test function that represents an ellipse rotated in the coordinate system.

\[f(\mathbf{x}) = 7x_1^2 - 6\sqrt{3}x_1 x_2 + 13x_2^2\]

This is a quadratic form that creates an elliptical contour when rotated. It is unimodal with a single global minimum.

Global minimum: \(f(0,0) = 0\)

References

[RotatedEllipse]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
x_opt = (0.0, 0.0)#
class panobbgo.lib.classic.RotatedEllipse2(box=None, **kwargs)[source]#

Bases: Problem

Rotated Ellipse 2 function.

The Rotated Ellipse 2 function is another unimodal quadratic test function that represents a different elliptical form.

\[f(\mathbf{x}) = x_1^2 - x_1 x_2 + x_2^2\]

This quadratic form creates a rotated elliptical contour. It is unimodal with a single global minimum.

Global minimum: \(f(0,0) = 0\)

References

[RotatedEllipse2]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
x_opt = (0.0, 0.0)#
class panobbgo.lib.classic.Salomon(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Salomon function.

The Salomon function is a continuous, differentiable, non-separable, scalable, multimodal test function for optimization algorithms.

\[f(\mathbf{x}) = 1 - \cos\left(2\pi \sqrt{\sum_{i=1}^D x_i^2}\right) + 0.1 \sqrt{\sum_{i=1}^D x_i^2}\]

Global minimum: \(f(0, \dots, 0) = 0\)

References

[Salomon]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.Sargan(dims, box=None, **kwargs)[source]#

Bases: Problem

Sargan function.

The Sargan function is a continuous, differentiable, non-separable, scalable, multimodal test function for optimization algorithms.

\[f(\mathbf{x}) = \sum_{i=1}^D D \left(x_i^2 + 0.4 \sum_{j \neq i} x_i x_j\right)\]

(Jamil & Yang [JY13] no. 107 — the factor \(D\) was missing.)

Global minimum: \(f(0, \dots, 0) = 0\)

References

[Sargan]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

property x_opt: ndarray#
class panobbgo.lib.classic.Schwefel(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Schwefel function.

The Schwefel function is a highly multimodal test function for optimization algorithms. It has many local minima arranged in a complex pattern, making it extremely challenging for optimization algorithms to find the global minimum.

\[f(\mathbf{x}) = 418.9829 \cdot n + \sum_{i=1}^{n} \left( -x_i \sin\left(\sqrt{|x_i|}\right) \right)\]

The function has a global minimum at \(x_i \approx 420.968746\) for all dimensions. With the rounded constant 418.9829 its value there is \(\approx 1.27 \cdot 10^{-5}\,n\), not exactly 0 (f_opt). The many local minima and the narrow valley leading to the global optimum make this function particularly difficult to optimize.

Global minimum: \(f(420.968746,\dots,420.968746) \approx 1.27 \cdot 10^{-5}\,n\)

References

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

property f_opt: float#
property x_opt: ndarray#
class panobbgo.lib.classic.Shekel(dims: int, m: int = 10, a: Any = None, c: Any = None, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Shekel Function [SH].

The Shekel function is a multimodal test function for optimization algorithms. It creates \(m\) local minima in \(n\) dimensions by summing inverse quadratic terms centered at different points.

\[f(\vec{x}) = \sum_{i = 1}^{m} \frac{1}{c_{i} + \sum_{j = 1}^{n} (x_{j} - a_{ji})^2}\]

where \(a_{ji}\) are the coordinates of the \(i\)-th minimum in dimension \(j\), and \(c_i\) controls the depth/width of each minimum.

The function is highly multimodal with many local optima, making it challenging for optimization algorithms to find the global minimum.

Parameters:
  • m (int) – Number of local minima (default: 10)

  • a (array_like, shape (n, m)) – Positions of the m minima in n dimensions. If None, generated automatically.

  • c (array_like, shape (m,)) – Scaling factors for each minimum. If None, generated automatically.

  • minimum (Global)

References

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

class panobbgo.lib.classic.Simionescu(**kwargs: Any)[source]#

Bases: Problem

Simionescu function with constraints. f(x,y) = 0.1 * xy subject to: x^2 + y^2 <= (1 + 0.2 cos(8 atan(x/y)))^2

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

eval_constraints(x)[source]#

This method is optionally overwritten by the problem to calculate the constraint violations. It has to return a numpy.ndarray of floats.

Return type:

numpy.ndarray

class panobbgo.lib.classic.Step(dims, box=None, **kwargs)[source]#

Bases: Problem

Step function [CompStudy] (Step 2 in Jamil & Yang [JY13])

\[F(x) = \sum_{i=1}^n \lfloor x_i + 0.5 \rfloor^2\]

Piecewise constant (the floor was missing, which made it a smooth sphere); minimum 0 on the plateau \([-0.5, 0.5)^n\), so x_opt is None (no single minimiser) and x_opt_example is its centre.

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

x_opt = None#
property x_opt_example: ndarray#
class panobbgo.lib.classic.StyblinskiTang(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Styblinski-Tang function.

The Styblinski-Tang function is a multimodal test function for optimization algorithms. It is defined as the sum of quartic polynomials for each dimension, creating multiple local minima that challenge optimization algorithms.

\[f(\mathbf{x}) = \frac{1}{2} \sum_{i=1}^{n} (x_i^4 - 16 x_i^2 + 5 x_i)\]

Each dimension contributes a quartic term with multiple local optima. The function has a global minimum at \(x_i \approx -2.903534\) for all dimensions.

Global minimum: \(f(-2.903534,\dots,-2.903534) \approx -39.1661657 \cdot n\)

References

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

property f_opt: float#
property x_opt: ndarray#
class panobbgo.lib.classic.SumDifferentPower(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Sum of different power function [CompStudy]

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#
class panobbgo.lib.classic.Trigonometric(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Trigonometric function, Moré-Garbow-Hillstrom [UncTest] no. 26

\[ \begin{align}\begin{aligned}f_i(x) = n - \sum_{j=1}^{n} \cos x_j + i (1-\cos x_i)-\sin x_i, \quad i = 1, \dots, n\\f(x, n) = \sum_{i=1}^{n} f_i^2\end{aligned}\end{align} \]

(i is 1-based and is not multiplied by n.) Global minimum \(f(0) = 0\).

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

property x_opt: ndarray#
class panobbgo.lib.classic.Wood(box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Wood function, Moré-Garbow-Hillstrom [UncTest] no. 14

\[F(x) = 100 (x_2 - x_1^2)^2 + (1-x_1)^2 + 90 (x_4-x_3^2)^2 + (1-x_3)^2 + 10 (x_2 + x_4 - 2)^2 + 0.1 (x_2-x_4)^2\]

the sum of squares of MGH’s residuals \(10(x_2 - x_1^2)\), \(1 - x_1\), \(\sqrt{90}(x_4 - x_3^2)\), \(1 - x_3\), \(\sqrt{10}(x_2 + x_4 - 2)\), \(10^{-1/2}(x_2 - x_4)\). (The implementation had lost the squares and was unbounded below.) Global minimum \(F(1, 1, 1, 1) = 0\).

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
formula_version = 2#

Formula corrected in 2026-09 (storage fingerprints of older runs do not match).

x_opt = (1.0, 1.0, 1.0, 1.0)#
class panobbgo.lib.classic.Zakharov(dims: int, box: Sequence[Tuple[float, float]] | None = None, **kwargs: Any)[source]#

Bases: Problem

Zakharov function.

The Zakharov function is a unimodal, convex test function: a quadratic term plus the square and fourth power of a weighted sum, which makes it ill-conditioned and non-separable but leaves a single minimum.

\[f(\mathbf{x}) = \sum_{i=1}^{n} x_i^2 + \left(\frac{1}{2} \sum_{i=1}^{n} i x_i \right)^2 + \left(\frac{1}{2} \sum_{i=1}^{n} i x_i \right)^4\]

Global minimum: \(f(0,\dots,0) = 0\) (the only stationary point).

References

[Zakharov]

Momin Jamil and Xin-She Yang, A literature survey of benchmark functions for global optimization problems, {it Int. Journal of Mathematical Modelling and Numerical Optimisation}, Vol.~4, No.~2, pp. 150–194 (2013). DOI: 10.1504/IJMMNO.2013.055204

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

eval(x)[source]#

This is called to evaluate the given black-box function. The problem should be called directly (__call__ special function wraps this) and the given problem should subclass this eval method.

Return type:

numpy.float64

f_opt = 0.0#
property x_opt: ndarray#