## 4 Routing Using SPWO Algorithm
### The SPWO Algorithm  
The proposed SPWO model is derived by integrating WOA [42] with the SPBO [43] algorithm. The proposed optimization algorithm enables training of the Deep maxout network. The weights of the Deep maxout network are trained using the optimization algorithm. The optimization algorithm helps in generating accurate results. In the proposed work, optimization is enhanced for routing. Selecting the routing path by excluding malicious nodes still results in a complex task in the network domain. Hence, the proposed algorithm is designed for data communication from IoT devices to the sink node located in the coverage area. The performance of students can be estimated in light of their imprints accomplished during assessment. Likewise, students with higher marks are specified as the best students and, in general, students try to increase their efficiency to attain the position of the best student in the class. The SPBO algorithm operates with the psychology of students who attempt to raise their performance in examinations. WOA considers the behavior of humpback whales by considering their hunting strategy. Whales are fancy creatures and are mainly assumed to be predators. The interesting mechanism of whales is their social behavior, and they try to live in groups or alone. A special foraging mechanism used by WOA is the bubble net model that is specifically considered to hunt fishes on the surface. The algorithmic process of the proposed SPWO is illustrated as follows [41]:  
* Initialization: In this phase, initially initialize the population in solution space L by the number of students [41] in class by Equation (17) \[C=\{C_{1},C_{2},\ldots,C_{w},\ldots,C_{j}\};1\leq w\leq j.\] (17) Here, \(C\) is the population group, \(C_{w}\) denotes \(w\)th student, and j implies total students;
* Fitness measure: The fitness factor employed to route data bundles between the network entities is specified in Equation (13);
* Update solution: The effort made by students is based on their psychology and most of the students increase their effectiveness by making more effort. However, the effort made by students is based on their interest in the subject. Best student: The student who gains more marks is termed the best student and he or she will maintain the position by gaining higher marks in class. The expression used to specify improvement of the best student [26] is in Equation (18):  
\[C_{\text{newbest}}\,=\,C_{\text{best}}\,+(-1)^{i}\times\text{rand}\times(C_{ \text{best}}\,-\,C_{w}), \tag{18}\]  
where \(C_{\text{best}}\) implies the marks of the best student, \(C_{w}\) shows the marks of the \(w\)th student, and i implies a random factor that has a  
respective subject, \(X\) and \(D\) are coefficient vectors, \(C^{*}\) indicates the position vector of the best solution, and \(v\) implies the current iteration. Average student: The effort made by the student is based on the student's interest in relevant subjects. The performance of this category is expressed in Equation (36):  
\[C_{\text{new x}}=C_{x}+[\text{rand}\times(C_{\text{mean}}-C_{x})]. \tag{36}\]  
Here, \(C_{\text{mean}}\) denotes the average marks attained in class. Students try to increase randomly: The type of student trying to make more effort in studying the related subject [41] is expressed in Equation (37):  
\[C_{\text{new x}}=C_{\text{min}}+[\text{rand}\times(C_{\text{max}}-C_{\text{ min}})], \tag{37}\]  
where \(C_{min}\) denotes the minimum mark limit, and \(C_{max}\) specifies the maximum mark limit. * Evaluating feasibility: The wellness of every arrangement of the solution is calculated to derive an optimal solution with a minimum fitness value. * Termination: The above advances are rehashed until the best arrangement is achieved. Algorithm 1 depicts the pseudo-code of the proposed SPWO.