## 5 Intelligent Opportunistic Protocol (IOP)  
Let there be N nodes in the WSN, where each node has K neighbors, i.e., N\({}_{1}\), N\({}_{2}\),..., N\({}_{K}\) and each neighbor nodes are represented by X\({}_{1}\), X\({}_{2}\),..., X\({}_{n}\) attributes. In this case, the number of neighbors (k) might vary for the different nodes at a particular instance. Additionally, it was assumed that the wireless sensor network is spread over an area of \(500\times 500\) square meters. Let us assume that a node A \(\in\) N and had neighbors as NA\({}_{1}\), NA\({}_{2}\),..., NA\({}_{K}\), with respective features like Node Id, Location, PRR (Packet Reception Ratio), Residual Energy (RE) of nodes, and Distance (D), which are represented by X\({}_{1}\), X\({}_{2}\),..., X\({}_{n}\), respectively. The goal was to intelligently find a potential relay node A, say AR, such that AR \(\in\) {NA\({}_{1}\), NA\({}_{2}\),..., NA\({}_{K}\)}. In the proposed machine learning-based protocol for the selection of potential forwarder, the packet reception ratio, distance, and outstanding energy of node was taken into consideration. The Packet Reception Ratio (PRR) [29] is also sometimes referred to as PSR (packet success ratio). The PSR was computed as the ratio of the successfully received packets to the sent packets. A similar metric to the PRR was the PER (packet error ratio), which could be computed as (1--PRR). A node loses a particular amount of energy during transmission and reception of packets. Accordingly, the residual energy in a node gets decreased [30]. The distance (D) was the distance between the source node and the respective distance of each sensor node in the forwarder list. The potential relay node selection was multi-class, with multiple features-based probabilistic problems, where the inherent selection of the relay node was dependent upon each node feature. The underlying probabilistic-based relay node selection problem could be addressed intelligently by building a machine learning model. The selection of a node with 'n' characteristics for a given node 'A' could be considered a supervised multiclass non-linearly separable problem. In this algorithm, the [PERSON]'s classifier was used to find the probability of node A to reach one of its neighbors, i.e., {N\({}_{1}\), N\({}_{2}\),..., N\({}_{K}\)}. We computed the probability, P(N\({}_{1}\), N\({}_{2}\),..., N\({}_{K}\)|A). The node with maximum probability, i.e., P(N\({}_{1}\), N\({}_{2}\),..., N\({}_{K}\)|A) was selected. The probability P of selecting an individual relay node of the given node A could be computed individually for each node, as shown respectively for each node in Equation (4). \[\begin{array}{l}P(NA_{1}|A)=P(X_{1})*P(X_{2})\........\........\.P(X_{n})\\ P(NA_{2}|A)=P(X_{1})*P(X_{2})\........\.P(X_{n})\\........\........\........\........\.  
where \(i\) = 1, 2, 3,..., n and P(\(Xi\)|A) is called likelihood, P(A) is called the prior probability of the event, and P(\(Xi\)) is the prior probability of the consequence. The underlying problem is to find the relay node A that has the maximum probability, as shown in Equation (6).  
\[P(A|NA_{1},NA_{2},\ldots\ldots\ldots NA_{K})=max((P(NA_{1}\big{|}A_{1})\big{|}( P(NA_{2}|A_{1})\ldots\ldots\ldots(P(NA_{K}\big{|}A_{1}) \tag{6}\]  
Table 3a-x represent the neighbor sets {NA1, NA2,..., NAK} along with their feature attributes as {X1, X2, X3,..., Xn} of Node A. The working of IOP is comprised of two phases, i.e., Phase I (Forwarder_Set_Selection) and Phase II (Forwarder_Node_Selection). In Phase I, the authors used Algorithm 1 for the forwarder set selection. In this step, the information collection task was initiated after the nodes were randomly deployed in the area of interest, with specific dimensions. The beginning of the phase started with a broadcast of \"Hello Packet\" which contained the address and the location of the sending node. If any node received this packet, it sent an acknowledgment to the source and was added to the neighbor list.