# Cyber Firefly Algorithm Based on Adaptive Memory Programming for Global Optimization
## 2 Related Work Materials and Methods  
### Glowworm Swarm Optimization (GSO)  
[PERSON] and [PERSON] [7] developed the GSO algorithm. It is assumed that each glowworm has a luciferin level and a local visibility range. The luciferin level of a glowworm determines its light intensity, and the local visibility range identifies the neighboring glowworms which are visible to it. The glowworm probabilistically chooses a neighbor which has a higher luciferin level than itself and is flying towards this neighbor due to light attraction. The local visibility range is dynamic for maintaining an ideal number of neighbors. The GSO simulates the glowworm behaviors and consists of three phases as depicted as follows.  
The luciferin update phase evaluates the luciferin level of every glowworm according to the decay of its luminescence and the merit of its new position after performing the movement within the evolution cycle \(t\). The luciferin level of glowworm \(i\) is updated by the following equation.  
\[l_{i}^{t+1}\leftarrow(1-\rho)l_{i}^{t}+\tau f_{i}^{t+1} \tag{1}\]  
where \(\rho\) is the decay ratio of the glowworm's luminescence and \(\tau\) is an enhancement constant. The first term is the persistence substance of luminescence due to decay with time, and the second term is the additive luminescence as a function of \(f_{i}^{t+1}\) which indicates the objective value measured at the glowworm's new position (here, without loss of generality, we assume the objective function is to be maximized).  
In the movement phase of each evolution cycle, every glowworm in the swarm must perform a movement by flying towards a neighbor which has a higher luciferin level than the incumbent glowworm and is located within the local visibility neighborhood defined by a radius \(r_{i}^{t}\). The probability with which glowworm \(i\) is attracted to a brighter glowworm \(j\) at evolution cycle \(t\) is given by:  
\[p_{ij}=\frac{l_{j}^{t}-l_{i}^{t}}{\sum_{k\in N_{i}^{t}}l_{k}^{t}-l_{i}^{t}} \tag{2}\]  
where \(N_{i}^{t}\) is the set of glowworms within the visibility neighborhood of glowworm \(i\) at evolution cycle \(t\). Once selecting a neighbor, say glowworm \(j\), the current glowworm \(i\) performs a movement to update its position as follows.  
\[x_{i}^{t+1}\gets x_{i}^{t}+\left(\frac{x_{j}^{t}-x_{i}^{t}}{\|x_{j}^{t}-x_ {i}^{t}\|}\right) \tag{3}\]  
where \(s\) is the movement distance and \(\|\bullet\|\) indicates the length of the referred vector. Precisely speaking, glowworm \(i\) moves in \(s\) units of distance towards glowworm \(j\).  
The visibility range update phase dynamically tunes the visibility radius of each glowworm to maintain an ideal number of neighbors, \(N^{*}\). So, the current number of neighbors, \(\left|N^{t}_{i}\right|\), is compared to \(N^{*}\) and the visibility radius \(r^{t}_{i}\) is tuned by the following equation.  
\[r^{t+1}_{i}\leftarrow\min\left\{r_{\max},\ \max\left\{0,\,r^{t}_{i}+\eta\left(N^{* }-N^{t}_{i}\right)\right\}\right\} \tag{4}\]  
where \(r_{\max}\) is the maximum visibility radius and \(\eta\) is a scaling parameter for tuning \(N^{t}_{i}\). Therefore, the value of \(r^{t}_{i}\) is increased if \(N^{t}_{i}<N^{*}\), and it is decreased if \(N^{t}_{i}>N^{*}\). The feasible range of \(r^{t}_{i}\) is bounded between \([0,r_{\max}]\). The phenomenon of \(r^{t}_{i}=0\) indicates many glowworms are resorting to the position of the current glowworm, while \(r^{t}_{i}=r_{max}\) discloses the situation that the current glowworm is in a large distance to most of the other glowworms.