# A New Modified Firefly Algorithm for Optimizing a Supply Chain Network Problem
## 1 Introduction  
Firefly Algorithm (FA), initially introduced by [PERSON] [1], is a nature-inspired algorithm originated from the flashing lights of fireflies. FA is among the latest swarm intelligence techniques and it is among metaheuristic algorithms and stochastic optimization approaches which can be applied for many difficult engineering problems including NP-Hard problems [2, 3]. According to computational complexity theory, there are four types of problems based on their inherent difficulty. These problems comprise P, NP, NP-Complete and NP-Hard problem (interested may refer to [2, 3] for more information). FA searches for a set of solutions by using a kind of randomization which means that it belongs to stochastic algorithms. Flashing lights are the main characteristic of fireflies. The flashing lights have two primary functions: to attract mating partners and to warn other fireflies of probable predators. The flashing lights follow laws of physics, that is, according to the term, when the distance \(r\) increase, the intensity of flashing lights \(I\) decrease. This phenomenon inspired [PERSON] [1] to develop the FA. The classical FA was numerically formulated and implemented in MATLAB and it was explained in detail in [PERSON] (2008) and [PERSON] (2009). There are two key factors need to be well defined to design FA properly: the formulation of attractiveness and the variation of light intensity. In FA, the light intensity (\(I\)) of a firefly, that presents the solution (\(s\)), is relative to the fitness function value (\(I(s)\propto f(s)\)). However, according to the Equation (1), the light intensity \(I(r)\) can vary as follow:  
\[I(r)=I_{0}e^{-\gamma r^{2}} \tag{1}\]  
where the source's light intensity is denoted by \(I_{0}\) and the fixed light absorption coefficient \(\gamma\) is approximating the light absorption. In Equation (1), the singularity at \(r=0\) is prevented by merging the effects of an absorption estimation in Gaussian form and the inverse square law. Similarly, Equation (2) can be defined to express the attractiveness \(\beta\) where the fireflies' attractiveness \(\beta\) is proportional to intensities of their light \(I(r)\). \[\beta=\beta_{0}e^{-\gamma r^{2}} \tag{2}\]  
where \(\beta_{0}\) presents the attractiveness when \(r=0\). The attractiveness \(\beta\) and light intensity \(I\) are by some means synonymous. The attractiveness is the light relative measure which is subjective and judged by other fireflies. Intensity, however, is an absolute measure of released light by a firefly ([PERSON], 2009). To calculate the distance separating any two fireflies \(s_{i}\) and \(s_{j}\), the Euclidean distance is used as follows:  
\[r_{ij}=||s_{i}-s_{j}||=\sqrt{\sum_{k=1}^{k=n}{(s_{ik}-s_{jk})^{2}}} \tag{3}\]  
where \(n\) represents the problem dimensionality. The \(i\)-th firefly movement is influenced by one other more attractive firefly \(j\), formulated in Equation (4):  
\[s_{i}=s_{i}+\beta_{0}e^{-\gamma r^{2}}(s_{j}-s_{i})+\alpha\varepsilon_{i} \tag{4}\]  
where \(\varepsilon_{i}\) is a random number generated by Gaussian distribution. The firefly's movement includes three terms: (i) the recent \(i\)-th firefly's position, (ii) absorption to a more attractive firefly and (iii) a random walk includes a random number generated from the interval [0, 1] and a randomization parameter \(\alpha\). When \(\beta_{0}=0\), the movement is only based on the random walk. Besides, the convergence speed is highly dependent on the parameter \(\gamma\). This parameter's value could be theoretically captured any value from the interval \(\gamma\in[0,\infty)\). However, it typically varies from 0.1 to 10 and its setting relies on the nature of the optimization problem. In summary, three parameters control FA: (i) the randomization parameter \(\alpha\), (ii) the attractiveness \(\beta\) and (iii) the absorption coefficient \(\gamma\). Based on the parameter setting, FA distinguishes two asymptotic behaviours.