Rashedi et al. proposed an optimization algorithm called ‘GSA: A Gravitational Search Algorithm’ (Rashedi et al. 2009). The paper has received numerous citations since its publication in 2009 and a follow-up study was published in Rashedi et al. (2010).

GSA simulates a set of agents that behave as point masses in an N-dimensional search space. The position of agent i, denoted by x i , represents a candidate solution for the optimization problem at hand. The mass of agent i, denoted by m i , is correlated with the quality of the candidate solution it represents: the higher the quality, the larger the mass. The agents are said to “interact with each other based on the Newtonian gravity and the laws of motion” (Rashedi et al. 2009).

The physical law of gravity is an inverse square law, such that the magnitude of the force of attraction exerted by two masses on each other is “proportional to the mass of each and varies inversely as the square of the distance between them” (Feynman et al. 2005). If one wishes to generalize this to an inverse nth power law, the magnitude of the force of attraction between agents i and j should be calculated as

$$ ||{\bf f}_{ij}{||}=\frac{G m_i m_j}{R_{ij}^n}, $$
(1)

where G is a proportionality constant analogous to the universal gravitational constant, R ij  = ||x j  − x i || is the Euclidean distance between agents i and j, and \(n\in \left\{1,2,\ldots\right\}\), to be consistent with gravity being inversely dependent on R ij .

In order to express the force exerted on agent i by agent j as a vector in the search space, the magnitude of Eq. 1 must be multiplied by a unit vector pointing from i to j. This vector can be obtained by dividing the vector (x j  − x i ) by its length, R ij . Therefore,

$${\bf f}_{ij}=\frac{G m_i m_j}{R_{ij}^{n+1}}\left({\bf x}_{j}-{\bf x}_{i}\right).$$
(2)

Rashedi et al. (2009) claim to have implemented a law of attraction with n = 1. They claim to have used “R instead of R 2, because according to [their] experiment results, R provides better results than R 2 in all experimental cases” (Rashedi et al. 2009).

However, in Eq. 7 in Rashedi et al. (2009), the force exerted on agent i by agent j along dimension \(d\in\{1, 2, \ldots, N\}\) of the search space is calculated as

$$ f_{ij}^{d}=\frac{G m_{i} m_{j}}{R_{ij}+\epsilon}\left(x_{j}^{d}-x_{i}^{d}\right), $$
(3)

where \(\epsilon\) is a small positive constant used to avoid division by zero.

Equation 3 is inconsistent with its description, because it sets n to 0, not 1, as Rashedi et al. (2009) intended (compare to Eq. 2). The single R ij in the denominator of Eq. 3 serves to normalize (x d j  − x d i ), making the magnitude of f ij independent of R ij . To make it explicit, in GSA as implemented in Rashedi et al. (2009), assuming \(\epsilon = 0,\)

$$ ||{\bf f}_{ij}||= Gm_im_j, $$
(4)

which is independent of R ij , a crucial part of the law of gravity. In fact, this implies that the finding in Rashedi et al. (2009) that using “R instead of R 2” gives better experimental results actually means that not using R at all (n = 0) gives better results than using R (n = 1). This leads us to hypothesize that making the attraction between agents inversely proportional to the distance between them degrades the performance of the search algorithm.

We do not intend to undermine the capabilities of GSA (with n = 0) as an optimization algorithm; rather, our observation is that, as it turns out, it is not truly based on the law of gravity (compare Eqs. 1 and 4). Mass and distance are both integral parts of the law of gravity; in contrast, the force model used in GSA is independent of the distances between agents and is based solely on their ‘masses’ (qualities of candidate solutions).