# An Efficient Opportunistic Routing Based on Prediction for Nautical Wireless Ad Hoc Networks
## 3 The Proposed Algorithm
### The Description of WRSP
#### 3.2.2 Relay Advancement Prediction  
The packet is transmitted from the carrier node to its intermediate nodes based on the packet reception ratio, and the packet must be broadcast further. Therefore, the relay advancement prediction is introduced. The definition of the intermediate node degree was given in Definition 3. When the nodes are deployed in the relay region, the probability for a carrier node that the number of relay nodes is \(n_{rel}\) is given by [12]:  
\[P_{rel}(n_{rel})=((\rho\Omega)^{n_{rel}}/n_{rel}!)e^{-\rho\Omega} \tag{4}\]  
where \(\rho\) is the node density and \(\Omega\) denotes the coverage region of node \(S\) and can be described as: \(\Omega=\pi R_{S}^{2}\). However, not all coverage regions of the carrier node are considered to participate in the node selections of the candidate relay set. Therefore, the calculation of \(\Omega\) is not reasonable, and it must be recalculated.  
As shown in Figure 2, according to Definitions 2 and 3, the coverage region \(\Omega\) is recalculated by:  
\[\Omega=S_{a}+S_{b}+S_{c} \tag{5}\]  
where \(S_{a}\) denotes the area of sector \(SDB\), and \(S_{b}\) and \(S_{c}\) are the areas of sector \(SCD\) and the shadow area, respectively.  
Figure 2 shows the intersection region of the two circles \(C(S,R_{S})\) and \(C(D,d_{DS})\) (red line), where \(R_{S}\) and \(d_{DS}\) are the communication ranges of node \(S\) and the Euclidean distance between node \(D\) and node \(S\), respectively. Hence, the length of the line \(DB\) is equal to \(d_{DS}\). Thus, for the isosceles triangle \(SDB\), the angle \(\theta_{SDB}\) is expressed as:  
\[\theta_{SDB}=arccos\left(\frac{R_{S}}{2d_{DS}}\right) \tag{6}\]  
Therefore, the area of \(S_{a}\) is calculated by:  
\[S_{a}=\frac{1}{2}R_{S}^{2}arccos\left(\frac{R_{S}}{2d_{DS}}\right) \tag{7}\]  
Similarly, for calculation of angle \(SDB\), angle \(S13\) and angle \(DS3\) are:  
\[\theta_{1S3}=arccos\left(\frac{d_{1S}^{2}+d_{3S}^{2}-d_{13}^{2}} {2d_{1S}d_{3S}}\right) \tag{8}\] \[\theta_{DS3}=arccos\left(\frac{d_{3S}^{2}+d_{DS}^{2}-d_{D3}^{2}} {2d_{3S}d_{SD}}\right)\]  
Therefore, the area of \(S_{b}\) is the area of sector \(SCE\), which is calculated as follows:  
\[S_{b}=\frac{1}{2}R_{S}^{2}\left[arccos\left(\frac{d_{1S}^{2}+d_{3 S}^{2}-d_{13}^{2}}{2d_{1S}d_{3S}}\right)\right.\] \[\left.+arccos\left(\frac{d_{3S}^{2}+d_{DS}^{2}-d_{D3}^{2}}{2d_{3 S}d_{SD}}\right)\right] \tag{9}\]  
The area of \(S_{c}\) is the area of sector \(SDB\) minus the area of isosceles triangle \(SDB\), which is described as:  
\[S_{c}=\frac{1}{2}R_{S}^{2}\bigg{\{}\bigg{[}\pi-2 arccos\left( \frac{R_{S}}{2d_{DS}}\right)\bigg{]}\] \[-sin\bigg{[}\pi-2 arccos\left(\frac{R_{S}}{2d_{DS}}\right)\bigg{]} \bigg{\}} \tag{10}\]Hence, the value \(\Omega\) of the intermediate node region is expressed as:  
\[\Omega =\frac{1}{2}R_{S}^{2}\Bigg{\{}arccos\bigg{(}\frac{R_{S}}{2d_{DS}} \bigg{)}+arccos\bigg{(}\frac{d_{15}^{2}+d_{35}^{2}-d_{13}^{2}}{2d_{15}d_{35}} \bigg{)}\] \[+arccos\bigg{(}\frac{d_{35}^{2}+d_{DS}^{2}-d_{D3}^{2}}{2d_{35}d_{SD }}\bigg{)}+\bigg{(}\pi-2 arccos\frac{R_{S}}{2d_{DS}}\bigg{)}\] \[-sin\bigg{(}\pi-2 arccos\frac{R_{S}}{2d_{DS}}\bigg{)}\bigg{\}} \tag{11}\]  
To effectively reflect the relay possibility of the carrier nodes forwarding data messages to the destination, we define a new metric \(P_{FD}\), which can be given as follows:  
\[P_{FD}=\alpha P_{prr}+\beta P_{rel} \tag{12}\]  
where \(\alpha\) and \(\beta\) are the weight factors of the packet reception ratio and the relay advancement prediction of the relay possibility of the node, respectively. The larger the value of \(P_{FD}\), the more likely it is that the node will be selected to participate in relaying messages.