Reading an article (arXiv) about the Firefly optimization algorithm, it is stated that the objective function is called only once per firefly per iteration, but following both the pseudo-code in the article and some implementations I found online I do not understand why this is the case..
As I understand the following holds:
- The objective function is called whenever we want to update the light intensity $I_i$ of firefly $i$
- In a given iteration and firefly $i$, for every firefly $j$, if $I_j>I_i$ we move firefly $i$ and immediately re-calculate the intensity.
From this, if the fireflies' intensities are ordered as $1,2,3,\dots,n$, and the updated intensity increases by each movement are small (i.e. each movement will increase the intensity by at most 1), in one iteration the first firefly will move $n-1$ times, the second $n-2$ times,... each movement calling the objective function for a total of $n(n-1)/2$ calls. Where does the figure of $n$ objective calls per iteration comes form?