## 3 Proposed Algorithm
### _Moth Flame Optimisation Algorithm_  
Moths are insects similar to butterflies, and their most remarkable aspect is their unique night-time navigational system; they have evolved to use moonlight to fly at night and use transverse orientation as a navigational tool. By maintaining a steady angle with respect to the moon, this mechanism enables the moth to fly, making it an efficient way to cover large distances in a straight line. A conceptual model of transverse orientation is shown in Figure 10. This system ensures straight-line flight because the moon is far from the moth. Humans can use the same navigating technique. Consider a scenario in which the moon is on the south side of the sky and a person is heading east. He or she could walk in a straight line towards the east if he/she keeps the moon on his/her left side while doing so [43]. As seen in Figure 11, a moth flies spiralling around a light rather than in a straight line because only when the light source is very far away does the transverse orientation method work effectively (moonlight). Moths try to maintain the same angle as the light source in the case of artificial light. Following that idea, moths are seen flying in spiral patterns around lights. To develop the moth flame optimisation (MFO) algorithm, mathematical models of moth flight behaviour were used. MFO is a metaheuristic algorithm that defines parameters firstly, creates moths at random, determines each moth's position, and tags the optimal response in relation to the light source (flame). To achieve better locations in relation to the light source, the moths' future positions are modified based on the spiral path function. The requirements are satisfied (after obtaining the best solution) when this process, which involves updating the next positions and tagging the best solutions with respect to the flame, is completed [43]. Three main steps make up MFO: the creation of the initial moth population, the updating of the moth positions, and the updating of the flame count. Creating the initial population of moths in the first stage assumes that each moth can move in multiple dimensions. The moths' set (M) matrix is as follows:  
\[M= \begin{bmatrix}M_{11}&M_{12}&\cdots&M_{1d}\\ M_{21}&M_{22}&\cdots&M_{2d}\\ \vdots&\vdots&\vdots&\vdots\\ M_{n1}&M_{n2}&\cdots&M_{nd}\end{bmatrix}  \tag{61}\]  
Figure 8: Amplitude scale of \((-2,2)\) and a period range of \((0,2\pi)\) for sine and cosine. where \(n\) is the quantity of moths, and \(d\) is the spatial dimension. The fitness values \(OM\) are kept in an array for all moths. \[\text{OM}= \begin{bmatrix}OM_{1}\\ OM_{2}\\ \vdots\\ OM_{n}\end{bmatrix}  \tag{62}\]  
Figure 9: SCA flowchart. The following describes the set of flames (\(F\)) in \(d\)-dimensional space as a matrix:  
\[F= \begin{bmatrix}F_{11}&F_{12}&\cdots&F_{1d}\\ F_{21}&F_{22}&\cdots&F_{2d}\\ \vdots&\vdots&\vdots&\vdots\\ F_{n1}&F_{n2}&\cdots&F_{nd}\end{bmatrix}  \tag{63}\]  
The fitness values of all flames are kept in an array. \[\text{OF}= \begin{bmatrix}OF_{1}\\ OF_{2}\\ \vdots\\ OF_{n}\end{bmatrix}  \tag{64}\]  
Secondly, three functions are used to update the moth positions to converge to the global optimum. \[MFO=(I,P,T) \tag{65}\]  
where \(I\) denotes the moth's initial location within the search area, \(P\) is its motion within the area, and \(T\) is its destination. Function \(I\) can be represented by the following equation:  
Figure 11: A moth’s spiral flight route around a source of light. Figure 10: Transverse orientation of a moth. \[M\left(i,j\right)=\left(ub(i)-lb(j)\right)^{*}\text{rand }()+lb(i) \tag{66}\]  
where the variable's upper and lower bounds are indicated by \(ub\) and \(lb\), respectively. The MFO algorithm's logarithmic spiral equation ensures that the moth near the flame will be explored and used in the search space, as follows:  
\[\text{S}(M_{i},F_{j})= D_{i}e^{ht}.cos(2\pi t)+F_{j} \tag{67}\]  
where \(b\) is the spiral shape, \(t\) is a value between 1 and 1, and \(D_{i}\) is the distance between the \(i\)th moth and the \(j\)th flame.