# Deep Learning-Based Optimization for Maritime Relay Networks
## 2 System Model
### Data Acquisition  
In maritime communication networks, the communication quality among ships is influenced by multiple factors, including ship speed (\(v\)), direction (\(\theta\)), distance (\(d\)) and wave height (\(h\)). At a specific time point t, ships may be elevated to different sea surface heights due to the influence of ocean waves. Let \(h_{1}\), \(h_{2}\) and \(h_{3}\) denote the wave heights of the ships in their respective sea area. Assuming that wave height is a random variable with a Gaussian distribution, its fluctuations can significantly affect communication quality. Furthermore, particular attention is given to the wave height differences, denoted as \(\Delta h_{1}=|h_{1t}-h_{2t}|\) and \(\Delta h_{2}=|h_{2t}-h_{3t}|\), as these differences directly affects the stability of signal transmission. To determine the optimal relay node ship, two critical distance parameters are introduced, which can be expressed as:  
\[L_{1t}=\sqrt{(d_{1t})^{2}+|h_{1t}-h_{2t}|^{2}}, \tag{3}\]  
\[L_{2t}=\sqrt{(d_{2t})^{2}+|h_{2t}-h_{3t}|^{2}}, \tag{4}\]  
where, at time \(t\), \(L_{1t}\) represents the distance between the source node ship and the relay ship, while \(L_{2t}\) represents the distance between the relay ship and the destination node ship. Additionally, \(d_{1t}\) and \(d_{2t}\) capture the horizontal spatial distances between adjacent ships at this time, \(t\). \(v_{1t}\), \(v_{2t}\) and \(v_{3t}\) denote the scalar speed of ships at the time point t and are given by:  
\[v_{1t}=V_{1t}+\Delta_{1t}, \tag{5}\]  
\[v_{2t}=V_{2t}+\Delta_{2t}, \tag{6}\]  
\[v_{3t}=V_{3t}+\Delta_{3t}, \tag{7}\]  
where \(V_{1t}\), \(V_{2t}\) and \(V_{3t}\) are the speeds measured by ship logs and \(\Delta_{1t}\), \(\Delta_{2t}\) and \(\Delta_{3t}\) are the random deviations. \(\theta_{1t}\), \(\theta_{2t}\) and \(\theta_{3t}\) denote the angles of cruising directions deviating from the nominal direction at the time point \(t\). In a Rayleigh fading channel, the fading coefficient \(\alpha\) is a random variable, and the instantaneous SNR (\(\gamma\)) of the channel is also a random variable. \(\gamma_{S,R_{k}}\) and \(\gamma_{R_{k},D}\) are independent exponential random variables representing the instantaneous SNR of the small-scale fading from S to R and from R to D, respectively. In the considered system, both small-scale fading and large-scale fading effects are taken into account. Consequently, the overall average end-to-end SNR reflects the combined influence of both fading types. The expression for the overall average SNR is presented as follows:  
\[\tilde{\gamma}=\frac{P|\alpha|^{2}}{WL^{n}}, \tag{8}\]  
where \(P\) represents the transmission power, and \(W\) represents the noise power. In the DF protocol, the parameters \(\gamma_{R_{k},1}\) and \(\gamma_{R_{k},2}\) denote the end-to-end SNRs of the first and second hops on the \(k\)-th relay's communication link, respectively. The equivalent SNR for this link is determined as the minimum value between \(\gamma_{R_{k},1}\) and \(\gamma_{R_{k},2}\). According to the maximum function criterion, the relay with the highest equivalent SNR is selected as the optimal relay. The expressions for \(\gamma_{R_{k}}\) and \(\gamma^{*}\) are given as follows:  
\[\gamma_{R_{k}}=\min\{\tilde{\gamma}_{R_{k},1},\tilde{\gamma}_{R_{k},2}\}\]  
\[=\min\{\frac{P_{t}|\alpha_{R_{k},1}|^{2}}{WL_{1}^{n}},\frac{P_{t}|\alpha_{R_{ k},2}|^{2}}{WL_{2}^{n}}\}, \tag{9}\]\[\gamma^{*}=\max_{1\leq k\leq K}\gamma_{R_{k}}. \tag{10}\]  
In maritime communications systems, link quality is a critical determinant of communication performance and reliability. Thus, assessing the connectivity probability of the optimal link is essential to ensuring stable and robust communication. In a dual-hop network, the communication process involves the source node transmitting data to the destination node through an intermediate relay node. For a single relay node, the connectivity probability is defined as the probability that the SNR of the relay node exceeds the outage threshold.