griewank


The Griewank function has many widespread local minima, which are regularly distributed [1].

of = griewank(x)

Input variables

Name Description Type
x Current design variables of the i agent. List

Output variables

Name Description Type
of Objective function value of the i agent. Float

Problem

\[ f(\mathbf{x}) = \sum_{i=1}^{d} \frac{x^2_{i}}{4000} - \prod^d_{i=1} \cos \left ( \frac{x_{i}}{\sqrt{i}} +1 \right ) \]

(1)

\[ x_{i} \in [-600, 600], i=1, ... , d; \;...\; f(\mathbf{x}^*) = 0, \; \mathbf{x}^* = (0,...,0) \]

(2)

Example 1

Considering the design variable \(\mathbf{x} = [0,0]\), what value does the objective function expect?

# Data
x = [0, 0]

# Call function
of = griewank(x)

# Output details
print("of_best griewank: of = {:.4f}".format(of))
of_best griewank: of = 0.0000

Reference list