pymoo
Latest Version: pymoo==0.4.1

GriewankΒΆ

The Griewank function has many widespread local minima, which are regularly distributed. The complexity is shown in the zoomed-in plots.

Definition

\begin{align} \begin{split} f(x) & = & \; \sum_{n=1}^n \; \frac{x_i^2}{4000} - \prod_{n=1}^n \cos \Bigg( \frac{x_i}{\sqrt{i}} \Bigg) + 1 \\[4mm] &&-600 \leq x_i \leq 600 \quad i=1 \ldots,n \\[4mm] \end{split} \end{align}

Optimum

\[f(x^*) = 0 \; \text{at} \; x^* = (0,\ldots,0)\]

Contour

[1]:
import numpy as np
from pymoo.factory import get_problem, get_visualization

problem = get_problem("griewank", n_var=1)
plot = get_visualization("fitness-landscape", problem, _type="surface", n_samples=1000)
plot.do()
plot.apply(lambda ax: ax.set_xlim(-200,200))
plot.apply(lambda ax: ax.set_ylim(-1,13))
plot.show()
../../_images/problems_single_griewank_7_0.png
[ ]: