## 2 Introduction to the Details of the Algorithm
### Sheep Flock Optimization Algorithm (SFOA)  
The SFOA was designed to mimic the process through which a flock of sheep seeks out fertile pastures during grazing. Throughout the grazing period, the flock endeavours to locate areas with richer grasslands within a specified vicinity and proceeds to move. The flock comprises two varieties of animals, goats and sheep, along with a shepherd. The shepherd is responsible for documenting the richest grassland identified by the flock and attempting to lead the flock towards that location. During grazing, three elements influence sheep movement: the guidance of the shepherd, the previously identified rich grassland, and the proximity of other sheep. Goats typically constitute 10\(\sim\)20% of the flock population. During grazing, the movement of goats is dictated by two factors: the guidance of the shepherd and the richest grassland previously identified by the goats. As grazing progresses, the movement of the flock persists. Whenever the flock discovers richer grasslands, the shepherd likewise documents the details of this location. Upon completion of the grazing process (when the algorithm reaches its maximum number of iterations), the location noted by the shepherd represents the richest grassland. In the SFOA, the flock consists of \(N\) sheep, each symbolizing a feasible solution. Each sheep endeavours to locate areas with richer grasslands within its detection range [9]. \[r_{Gsheep}=0.001*(upper\ bound-lower\ bound)*T. \tag{1}\]  
\[r_{Ggout}=0.1*(upper\ bound-lower\ bound)*T. \tag{2}\]  
\[T=1-\left(\frac{Iteration}{MaxIteration}\right). \tag{3}\]  
In the SFOA, \(r_{Gshep}\) is the grazing radius of the sheep, \(r_{Ggout}\) is the grazing radius of the goats, \(upper\ bound\) is the upper limit of the entire grazing area, and \(lower\ bound\) is the lower limit of the entire grazing area. \(Iteration\) is the current number of iterations, \(MaxIteration\) is the maximum number of iterations, and \(T\) is a time influence factor. The value of \(T\) is related to the movement behaviour of the flock. The movements of a sheep can be divided into two stages. When \(T>T_{s}\), the sheep exhibits the following three behaviours [9]:  
(1) The movement \(v_{sh1,1}\) generated by the interest of the sheep in the globally optimal solution (where the shepherd is located). (2) The movement \(v_{Lbest,1}\) generated by the interest of the sheep in the previous best experiences. (3) The movement \(v_{other,1}\) caused by the interest of the sheep in approaching other sheep. \[v_{sh1,1}=(1-T)*C*Rand(1,Dim)*(X_{GBest}-X). \tag{4}\]  
\[v_{Lbest,1}=C*Rand(1,Dim)*(X_{Lbest}-X). \tag{5}\]  
\[v_{other,1}=C*Rand(1,Dim)*\left(X_{RandomSheep}-X\right). \tag{6}\]  
\[C=3*Rand. \tag{7}\]  
\(X\) represents the current position of the sheep, \(X_{GBest}\) represents the position of the global optimal solution found by the entire flock thus far, and \(X_{Lbest}\) represents the position of the optimal solution found by each sheep itself. \(X_{RandomSheep}\) is a random sheep position, \(Dim\) is the dimensionality of the problem, and \(Rand(1,Dim)\) is a \(1\times Dim\)-dimensional array between 0 and 1. \(Rand(1,Dim)\) enhances the randomness of population movements. \(C\) is a constant whose initial value is determined by \(Rand\), and \(Rand\) is a random number ranging between 0 and 1. \(T_{s}\) is usually taken as 0.3 [9]. When \(T\leq T_{s}\), the sheep exhibits the following two behaviours:The movement \(v_{sh2,1}\) generated by the interest of the sheep in the global optimal solution (where the shepherd is located). The movement \(v_{Lbest,1}\) generated by the interest of the sheep in the previous best experiences. \[v_{sh2,1}=C*(1-T)*(X_{GBest}-X). \tag{8}\]  
\[v_{Lbest,1}=C*Rand(1,Dim)*(X_{Lbest}-X). \tag{9}\]  
After determining the speed of the sheep and the current position of the sheep, \(x_{(Iteration)}\) can be updated [9].