## 3 Methodology
### Proposed Improved Bacterial Foraging Optimization Algorithm  
Like many other metaheuristic algorithms, the BFOA exhibits certain limitations, including high computational cost, inherent complexity, and susceptibility to becoming trapped in local optima [29]. These shortcomings necessitate further research efforts to enhance the performance of BFOA and address these deficiencies. The improvement of BFOA in the existing literature mainly focuses on the chemotaxis of bacteria, as shown in [52; 53; 54]. Chemotaxis, the core operation of the BFOA, relies heavily on the \"chemotaxis step length\" parameter \(C(i)\) for effective exploration. However, the classical BFOA employs a fixed value for \(C(i)\), leading to potential drawbacks. A large constant step size might hinder bacteria from reaching distant nutrient sources, while a small value could significantly slow their movement towards nearby nutrients [55].  
This study introduces an improved bacterial foraging optimization algorithm (IBFOA) that modifies the chemotaxis operation using the sine cosine algorithm (SCA) for inspiration. The key improvement lies in adapting the constant step size (\(C(i)\)) of bacteria during chemotaxis. The standard BFOA employs a fixed step size for bacterial movement during chemotaxis. The IBFOA proposes an adaptive step size defined by Equation (19):  
\[C(i)=a-t\frac{a}{S} \tag{19}\]  
where \(a\) is a defined constant, and \(t\) is a count of the chemotaxis. This adaptation introduces a gradual increase in the step size as the chemotaxis process progresses. Additionally, the IBFOA incorporates a mechanism inspired by the SCA to generate random movement directions for the bacteria during chemotaxis. Equation (20) adopted from SCA generates a random direction vector for each bacterium's movement:  
\[\Delta_{n}^{d}(t,r,e)=\begin{cases}\sin(r_{2})\times\left|r_{3}P^{d}(t,r,e)-X_ {n}^{d}(t,r,e)\right|&r_{4}<0.5\\ \cos(r_{2})\times\left|r_{3}P^{d}(t,r,e)-X_{n}^{d}(t,r,e)\right|&r_{4}\geq 0. 5\end{cases} \tag{20}\]  
where \(X_{n}^{d}(t,r,e)\) and \(P^{d}(t,r,e)\) are the current position of the \(n\)-th bacterium and the best solution so far at the \(t\)-th chemotactic step, \(r\)-th reproduction, and \(e\)-th elimination dispersal in the \(d\)-th dimension, respectively. Variables of \(r_{2}\), \(r_{3}\), and \(r_{4}\) are a random number in between 0 and \(2\pi\), and \(\mid\mid\) indicates the absolute value similar to SCA. The position of the \(n\)-th bacterium after a tumble is given by Equation (21):  
\[\theta^{n}(t+1,r,e)=\theta^{n}(t,r,e)+\left(a-t\frac{a}{S}\right)\left(\frac{ \Delta_{n}(t,r,e)}{\sqrt{\Delta_{n}^{T}(t,r,e)\Delta_{n}(t,r,e)}}\right) \tag{21}\]  
If the bacterium encounters a higher nutrient concentration after a tumble (Equation (22)), it continues swimming in the same direction for a predefined number of swim lengths as long as the concentration increases. Conversely, if the concentration decreases, the bacterium performs another tumble to explore a new direction (Equations (19) and (20)). The remainder of the IBFOA follows the standard BFOA process, including reproduction and elimination-dispersal. This improved algorithm aims to achieve better exploration and exploitation capabilities compared to the original BFOA.  
\[\theta^{n}(t+1,r,e)=\theta^{n}(t+1,r,e)+\left(a-t\frac{a}{S}\right)\left(\frac {\Delta_{i}(t,r,e)}{\sqrt{\Delta_{i}^{T}(t,r,e)\Delta_{i}(t,r,e)}}\right) \tag{22}\]