## 5 Intelligent Opportunistic Protocol (IOP)
This process was repeated again and again, but not more than the threshold, to calculate the PRR of each node and the neighbor list was formed using this procedure repeatedly. From the neighbor list and the value of PRR, the forwarder set was extracted. The pre-requisite for the working of the second phase was the output of the first phase. The forwarder set generated from Algorithm 1 was the set of all nodes that had the potential to forward the data packets. However, all nodes in the set could not be picked for transmission, as this would lead to duplication of packets in the network. To tackle this situation, only one node from the forwarder list should be selected to transmit the packet to the next-hop toward the destination. This was accomplished using Algorithm 2, which took a forwarder node list as input and selected a single node as a forwarder. Algorithm 2 used a machine-learning technique called naive Baye's Classifier, to select the forwarder node intelligently. The proposed method of relay node selection using IOP could be understood by considering an example of WSN shown in Figure 2 and using the naive [PERSON]'s algorithm on the generic data available \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{6}{c}{(a)} \\ \hline \multicolumn{6}{c}{**Attributes**} \\ \cline{2-6}
**Neighbours of A1** & \(\mathbf{x_{1}}\) & \(\mathbf{x_{2}}\) &... & \(\mathbf{x_{n}}\) \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{1}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{2}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{K}\)} \\ \hline \multicolumn{6}{c}{(b)} \\ \hline \multicolumn{6}{c}{**Attributes**} \\ \cline{2-6}
**Neighbours of A2** & \(\mathbf{x_{1}}\) & \(\mathbf{x_{2}}\) &... & \(\mathbf{x_{n}}\) \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{1}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{2}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{K}\)} \\ \hline \multicolumn{6}{c}{...} \\ \hline \multicolumn{6}{c}{(a)} \\ \hline \multicolumn{6}{c}{**Attributes**} \\ \cline{2-6}
**Neighbours of A\(\mathbf{a_{n}}\)** & \(\mathbf{x_{1}}\) & \(\mathbf{x_{2}}\) &... & \(\mathbf{x_{n}}\) \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{1}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{2}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{2}\)} \\ \hline \multicolumn{6}{c}{\(\mathrm{N_{A}}^{K}\)} \\ \hline \end{tabular}
\end{table} 
Table 3: Description of node features for different neighbor nodes of A.  
in Table 4, to find the optimal path in terms of energy efficiency and reliability from source node S to destination node D. Therefore, by using the proposed naive Baye's classifier method, the probability of selection of a relay node R1, R2, or R3 from source node S was denoted by P(R1, R2, R3 JS), which could be calculated using Equation (7). ```
//When any source node S want to send a packet towards D, it will execute this algorithm// Notations  NBL: Neighbor list  REP_Count: Count of replies received by the source node  SID: Identity of the source node  RES: Energy residual of the node  PRR: Packet Reception Ratio  FL(S): Forwarder List of source node S Input  Source Node S, SID, RES, and Location corresponding to the node S Process START
1. Let NBL (S) be the neighbor list of node S
2. Let REP_Count (node): = 0
3. For count : = 1 to 5 repeat  Broadcast \"Hello_Packet\" as [SID, Coordinates (x, y), RES] from S;
4. If (reply == True and node!eNBL(S))  Add the relying node to the neighbor list NBL(S) with following values updated [Node_ID, Location, Energy];  Else IF (reply == True and node!NBL(S))  REP_Count (node) = REP_Count (node) + 1;  Else  count = count + 1;  endIF  count = count + 1;  endFor
5. For each node in NBL (S) repeat  Calculate PRR (node);  IF PRR (node) >= 0.2  Add node to forwarder set (FL(S));  endIF  endFor
6. Forwarder Set FL(S) is formed; END Output: Creation of forwarder list consisting of neighbor nodes of the source node S.
```  
**Algorithm 1**Forwarder_Set_Selection (S = Source, D = Destination)  
Using Equation (5), we can compute: