Discova
Back to cards
Programming1 min readWikipedia, updated 20 April 2025

Rastrigin function

Function used as a performance test problem for optimization algorithms

In mathematical optimization, the Rastrigin function is a non-convex function used as a performance test problem for optimization algorithms. It is a typical example of non-linear multimodal function. It was first proposed in 1974 by Rastrigin as a 2-dimensional function and has been generalized by Rudolph. The generalized version was popularized by Hoffmeister & Bäck and Mühlenbein et al. Finding the minimum of this function is a fairly difficult problem due to its large search space and its large number of local minima.

On an -dimensional domain it is defined by:

where and . There are many extrema:

  • The global minimum is at where .
  • The maximum function value for is located at :

Here are all the values at 0.5 interval listed for the 2D Rastrigin function with :

The abundance of local minima underlines the necessity of a global optimization algorithm when needing to find the global minimum. Local optimization algorithms are likely to get stuck in a local minimum.

Adapted from the Wikipedia article, CC BY-SA 4.0. Continue on Wikipedia

Go deeper

Ideas this article links to.