# Green Communication in Internet of Things: A Hybrid Bio-Inspired Intelligent Approach
## 3 Green Communication in the Internet of Things: A Hybrid Bio-Inspired Intelligent Approach
### Hybrid Intelligent Energy Optimization
#### 3.3.2 Adapted Chicken Swarm Genetic Optimization for Green Communication  
In the second optimization phase, the set of tentative CHs resulting from FLIS optimization serves as the initial population of the CSGO to generate a better set of CH compared to the first FLIS optimization phase. In the proposed CSGO algorithm, binary representation is used to represent the IoT nodes as CH (1) or a normal IoT node (0). The binary index (\(b_{IN}\)) value of an IoT node can be calculated using the sigmoid function as follows:  
\[b_{IN}=\left\{ \begin{array}{rl}1,&if\;\mathit{sigm}\;f(I_{ch})>0.5\\ &0,\;\mathit{otherwise}\end{array} \right. \tag{7}\]  
where, \(\mathit{sigm}\;f(I_{ch})=1/1+e^{-I_{ch}}\) represent the sigmoid function. The CSGO includes adapting GA crossover and mutation processes into traditional chicken swarm optimization to enhance the diversity in the population. In the presented algorithm, each cluster is represented as pack classified into Rooster, hens and chicks. Chickens have the best fitness value represented as Rooster (CHs) and chicks are the chickens with the worst fitness value. Most chickens are hens labeled as normal IoT nodes. The hens and chicks form mother  
Figure 2: Membership function: (**a**) Residual energy (\(I_{\text{re}}\)), (**b**) Node density (\(I_{\text{nd}}\)), (**c**) Distance to edge node (\(I_{\text{de}}\)), and (**d**) Probability chance (\(I_{\text{de}}\)). child relationships arbitrarily. Moreover, the mother-child relationship and dominance relation are unaltered in a pack and updated every distinct (\(\theta\)) swarm updating frequency as time steps. The position of the rooster is updated using \(rand(0,\sigma^{2})\) Gaussian distribution with mean zero and standard deviation \(\big{(}\sigma^{2}\big{)}\) as follow:  
\[Y_{m,D}^{t+1}=Y_{m,D}^{t}*\left(1+rand\Big{(}0,\sigma^{2}\Big{)}\right) \tag{8}\]  
\[\sigma^{2}=\left\{ \begin{array}{c}1\;if\;\{(F_{m})\leq\{(F_{r})\] \[\exp\Big{(}\frac{\{(F_{r})-\{(F_{m})\}}}{\{(F_{m})+\{E\}}}\Big{)},\; otherwise\;\;,\;r,m\;\in[1,N],\;r\
eq m}\end{array} \right. \tag{9}\]  
where, \(Y_{m,D}^{t+1}\) represent the position of \(m\)th rooster in the D-dimension space, \(\{(F_{r})\) define the fitness function of the randomly selected \(r\)th rooster and \(E\) is the smallest constant to avoid zero-error division. The position of the \(m\)th hens' is updated as follows:  
\[Y_{m,D}^{t+1}=Y_{m,D}^{t}+\rho_{1}*rand\big{(}Y_{\omega 1,D}^{t}-Y_{m,D}^{t} \big{)}+\rho_{2}*rand\big{(}Y_{\omega 2,D}^{t}-Y_{m,D}^{t}\big{)} \tag{10}\]  
\[\rho_{1}=exp\Big{(}\frac{\{(F_{m})-\{(F_{\omega 1})\}}}{\{(F_{m})|+E\}}\Big{)} \;\text{and}\;\rho_{1}=\exp(\{(F_{\omega 2})-\{(F_{m})\}} \tag{11}\]  
where, \(\rho_{1}\), \(\rho_{2}\in[1,2\ldots N]\) are the index of randomly chosen rooster and chickens (hens' or chicks), respectively, such that \(\rho_{1}\
eq\rho_{2}\). The \(rand(\;)\) function generates a uniform random number between 0 and 1. Similarly, the position of \(m\)th chicks follows their mother position (FL) as follows:  
\[Y_{m,D}^{t+1}=Y_{m,D}^{t}+FL\big{(}Y_{\Omega N,D}^{t}-Y_{m,D}^{t}\big{)} \tag{12}\]  
where, \(Y_{\Omega N,D}^{t}\) stands for the position of \(m\)th chick's mother, such that \(\mathfrak{M}\in[1,n]\). \(FL(\;)\) function allows chick's to choose any random value between zero and two. The proposed HIOA algorithm (refer to Algorithm 1) for the generation of the best set of CH works in two phases shown in Figure 3. The first phase generates the tentative list of CHs using FLIS. The second phase (CSGO) generates the optimum set of (rooster) CHs and genetic operators such as crossover and mutation are applied over hens' and chicks to enhance their fitness value. In addition, CSGO includes three steps: (i) initialization step--set the \(K\) number of CHs obtained from FLIS optimization, number of rooster (\(N_{r}\)), hens (\(N_{h}\)) and chicks (\(N_{c}\)), population size (\(pop_{size}\)), maximum number of swarm updating frequency (\(\theta\)), single point crossover (\(\theta\)) and mutation rate (\(\tau\)) with maximum iteration.