## 4 Background on Chicken Swarm Optimization Algorithm  
The chicken swarm optimization (CSO) simulated based on the movement of chickens and the performance of chicken swarm. The CSO algorithm consists of various clusters and each cluster contains a leading rooster, hens, and chicks. Each cluster numbers are fixed using the fitness values of the roosters, hens, and chicks. Here the best fitness values are provided to the roosters (chickens). The least fitness values are given to the chicks. The majority in numbers is occupied by the hens and those fitness values are random inside the cluster. The dominant relationship between the mothers to the chicks in the cluster follows the unchanged manner as well as updates the iteration for every instant of time (G). The father to child relation in the cluster among the hens and the child is processed in a random manner. The Figure 7 explains the work flow of CSO optimization algorithm [53].  
The movement of chickens mainly depends on the ability to search for food of the different members of the cluster, which is updated according to the fitness values of the initial population. The movement can be formulated as follows:  
(1) The movement of the roosters is given by Equation (4)  
\[x_{ij}^{t+1}=x_{ij}^{t}\left(1+randn(0,\sigma^{2})\right) \tag{4}\]  
Figure 7: Chicken Swarm optimization Flowchart.  
where  
\[\sigma^{2}=\begin{cases}1&\text{if $f_{i}\leq f_{k}$}\\ \exp\Bigl{(}\frac{f_{k}-f_{i}}{|f_{i}+\varepsilon|}\Bigr{)}&\text{Otherwise}\end{cases} \tag{5}\]  
where \(x_{ij}^{t+1}\) the position of rooster; in \(j^{th}\) dimension during t and t + 1 iteration, \(\text{randn}(0,\sigma^{2})\) represents a Gaussian random number, the average is 0, and the standard deviation is \(\sigma^{2}\). \(k\in[1,N_{r}]\), \(k\
eq i\) and \(N_{r}\) is the number of roosters selected, \(\varepsilon\) is a low-value constant and \(f_{i}\) is the fitness value for the corresponding rooster;
2. The movement of the hens is given by Equation (3) \[x_{i,j}^{t+1}=x_{i,j}^{t}+S_{1}\times rand\Bigl{(}x_{r1,j}^{t}-x_{i,j}^{t} \Bigr{)}+S_{2}\times rand\Bigl{(}x_{r2,j}^{t}-x_{i,j}^{t}\Bigr{)}\] (6) where \[S_{1}=\exp\Bigl{(}\frac{f_{i}-f_{r1}}{abs(f_{i})+\varepsilon}\Bigr{)}\] (7) \[S_{2}=\exp(f_{r2}-f_{i})\] (8) where \(r1,\ r2\in[1,N\,]\), \(r1\
eq r2\), \(r1\) is the rooster index and \(r2\) is a swarm chicken, which may be a rooster or a hen.
3. The movement of the chicks is given by Equation (6) \[x_{ij}^{t+1}=x_{i,j}^{t}+FL\ \times\Bigl{(}x_{m,j}^{t}-x_{i,j}^{t}\Bigr{)}\ FL\in[0,2]\] (3) where \(x_{ij}^{t+1}\) is the position of the i\({}^{th}\) chicks' mother. FL is a parameter which means the chick will follow its mother. The complete process is explained in Algorithm 1.  
```
Define parameters such as population size (popSize), number of generations (gen), the number of roosters (Rn), the number of hens (Hn), the number of chicks (Cn) and the update time steps (G).  Set 1--Initialize the population of chicken as a matrix k;  Step 2--Calculates the fitness values for each row in k;  Step 3--While (t<gen);  Step 4--t = t+1;  Step 5--If (t %G == 0)  Step 6--Divide k into three groups (rooster, hens, and chicks) according to their fitness value  Step 7--else  Step 8--For i = 1: k  Step 9--If (i = rooster); Updates the position of rooster using Eq (4); end if  Step 10--If (i = hen); Updates the position of hen using Eq (6); end if  Step 11--If (i = chick); Updates the position of chick using Eq (9); end if  Step 12--Update the new solution of k  Step 13--end  Step 14--end
```  
**Algorithm 1**Pseudo code of CSO