# 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
(ii) Selection phase--it updates the position of rooster, hens' and chicks using Equations (7)-(12). Moreover, crossover and mutation operators were applied over hens' and chicks to enhance their fitness value. (iii) Output step--individuals having the best fitness value generated as the optimum set of CHs. ```
1. Begin
2. Read network configuration
3. First phase: FLIS optimization
4. Input: \(I_{re}\), \(I_{nd}\), \(I_{de}\)
5. Execute the FLIS engine based on rules define in Table 2
6. Return the chance of an IoT node selected as CH
7. Output: **T**: tentative set \(W\) number of CH
8. Second phase: CSGO algorithm
9. Initialization:
``` a.  assign \(pop_{size}\), \(t_{max}\)= maximum generation, \(\tau\), \(\theta\), \(\tau\), \(\theta\)b.  Initialize the population matrix \(U\) by random values from 0 and 1. c.  Include the output of FLIS (set of k number of CHs) as one feasible solution. 10. Selection: ```
11. Reconstruction of infeasible solution takes places those have CHs less than \(k\). 12. Calculate the fitness value of each row of \(U\). 13. Optimum set (\(O_{CH}\)) = row of \(U\) having best fitness value. 14. For t = 1 to \(t_{max}\)do
15. If( \(t\ mod\ \theta==0\ ||\ t==1\)) then
1. Sort the individuals into ascending order according to their fitness value. b.  Divide into three category rooster (\(N_{t}\)), \(\text{hens}^{\prime}(N_{h})\) and chicks (\(N_{c}\)). c.  Determine the relationship between mother-child in a pack. 16. End If
17. for each \(m^{th}\) individuals in each \(Y\) row of \(U\)do// \(pop_{size}\)
18. If m== rooster then update its position using Equation (8). 19. Else if m== hen then update its position using Equation (10). 20. Else if m==chick then update its position using Equation (12). 21. end if
22. Convert Y into binary form using Equation (7)
23. // Single-point Crossover
24. for\(D=N_{t}+1\) to \(pop_{size}\)do
25. generate two child offspring \(y_{o1}\) and \(y_{o1}\) from two parent chromosome \(Y_{D}\) and \(Y_{D+1}\)
26. set \(Y_{D}=y_{o1}\) and \(Y_{D+1}=y_{o2}\)
27. endfor // end of for loop in line no. 22
28. // Mutation
29. for\(D=N_{t}+1\) to \(pop_{size}\)do
30. \(r=\text{generate}\ rand(0,1)\)
31. if\(r<\tau\)then
32. integer\(\rho_{1}=\text{generate}\ rand(0,n)\)
33. if\(Y(\rho_{1})==1\)then
34. set \(Y(\rho_{1})=0\)
35. else
36. set \(Y(\rho_{1})=1\)
37. endif
38. endfor // end of for loop in line no. 27
39. Reconstruction of infeasible solution takes places those have CHs less than \(k\). 40. Updating the fitness value of each \(Y\) row of \(U\). 41. If fitness value of new solution is better than previous one, then update optimum CH set with new solution. 42. End for // end of for loop in line no. 17. 43. End for // end of for loop in line no. 14
44. Output: Return the optimum set \((O_{CH})\) of CHs. ```

**Algorithm 1**HIOA

#### 3.3.3 Complexity Analysis of HIOA

The presented HIOA algorithm works in two phases. The time complexity of FLIS optimization consists of maximum comparison for each elected CH is \((N^{2}-N)\), where \(N\) is the number of IoT nodes. Thus, the time complexity of the first phase is \(O\big{(}N^{2}\big{)}\). In the CSGO phase, the initialization step takes a constant time of \(O(1)\). In addition, line no. 11 to line no. 13 are executed in \(O(1)\) time. Further, the computational complexity of the second phase mainly depends upon line no. 14 up to line 43, which consists of four nested loops. Line no. 14, 17, runs up to maximum generation \(t_{max}\) and possible solution \(pop_{size}\), respectively; further Line no. 24 and 29 both executed up to \(N\) number of nodes. Therefore, the time complexity of the second phase can be evaluated as \(O(1)+O(1)+O(t_{max}\times pop_{size}(N+N))\)\(\approx\)\(O(N)\), where \(t_{max}\) and \(pop_{size}\) are very small compared to the number of IoT nodes and can be neglected. Thus, the overall time complexity of the presented HIOA algorithm is the summation of first phase and second phase \(\big{[}O\big{(}N^{2}\big{)}+O(N)\big{]}\).