## 4 Nature-Inspired Algorithms
### Firefly Algorithm  
As highlighted in the introduction, the Firefly Algorithm draws its inspiration from the social flashing behavior of fireflies and the way they communicate through bioluminescence. In FA, each firefly represents a candidate solution in the search space, and its \"brightness\"  
Figure 8: Graphical overview of the roulette-wheel method performed on ANSYS.  
Figure 7: Graphical overview of the workflow at the beginning of the optimization procedure.  
corresponds to the quality of that solution. When two fireflies encounter one another, the less bright individual moves toward the brighter one, often referred to as the \"queen\" firefly, so long as the brighter firefly lies within a certain attraction range.  
This attraction is governed by an inverse-square relationship: as the distance between two fireflies increases, the perceived light intensity falls off in proportion to the square of that distance. In practice, we model this using an attractiveness function \(\beta\) (Equation (2)) which attains its maximum value \(\beta_{0}\) when the distance is zero and decays according to a user-defined light-absorption coefficient \(\gamma\). As shown in [12], \(\beta_{0}\) is commonly set to 1.  
\[\beta=\beta_{0}e^{-\gamma t^{2}} \tag{2}\]  
In Equation (2), \(d\) denotes the Euclidean distance, which is given by Equation (3). Figure 9 shows a schematic representation of this distance in three-dimensional space.  
\[d_{ij}=\sqrt{(DVi_{1}-DVj_{1})^{2}+(DVi_{2}-DVj_{2})^{2}+\dots+(DVi_{m}-DVj_{m })^{2}} \tag{3}\]  
The parameter \(\gamma\) has a relevant impact on the analysis convergence rate: small values encourage broader exploration by allowing fireflies to influence one another over longer distances, while larger values concentrate the search locally. In most engineering applications, \(\gamma\) is tuned between 0.01 and 10. In the study, we selected \(\gamma=1\)[10; 12] to strike a balance between exploration and exploitation.  
The movement of each firefly combines deterministic attraction with a stochastic component. After computing the Euclidean distance to any brighter neighbor, a firefly updates its position by moving toward that neighbor proportional to its attractiveness (see Equation (4)), then adds a random perturbation (parameter \(\alpha\cdot\varepsilon_{i}\)) to encourage local exploration around its new location. Specifically, the position update from the \(t\) iteration to the next is given by Equation (4), where \(\alpha=0.2\)[10; 12] and \(\varepsilon_{i}\) is a random number in the range \([-1,1]\).  
\[DVi^{t+1}=DVi^{t}+\beta_{0}e^{-\gamma t^{2}_{ij}}.\left(DVi^{t}-DVi^{t}\right) +\alpha\cdot\varepsilon_{i} \tag{4}\]  
Unlike existing literature, our implementation of the FA in the ANSYS environment extends the standard movement rules by allowing selected \"ranger\" fireflies to adopt one of four random-motion strategies:  
1. Unrestricted global moves: fireflies may relocate to any point in the entire search domain, promoting broad exploration.
2. Queen-centric local moves: movements are confined to a neighborhood around the current \"queen\" firefly's position, intensifying the search near the best solution.  
Figure 9: Schematic representation of the Euclidean distance in three-dimensional space.  
3. Cycle-by-cycle hybrid: at each iteration, a random binary flag determines whether a firefly uses the global or queen-centric rule, injecting stochasticity into the exploration-exploitation balance.
4. Periodic hybrid: The algorithm systematically alternates between global and local moves every \(N\) iterations (with \(N\) specified by the user), ensuring regular shifts in search behavior.