# Joint Optimization of Data Transmission and Energy Harvesting in Relay Satellite Networks
## 4 Solutions and Algorithms
### Decomposition Strategy
#### 4.2.3 Data Transmission and Link Allocation  
To solve the link transmission and link allocation problem, we should minimize the third part in (17) under corresponding constraints as follows  
\[\text{LTO}: \min_{\delta_{ij}(t)_{T}(t)}\sum_{i=1}^{M}\sum_{j=1}^{N}\tau \Bigl{[}\frac{P_{t}}{\xi_{\max}}(\mathcal{B}-E_{i}(t))-\mathcal{D}_{i}(t) \Bigr{]}\delta_{ij}(t)\gamma_{i}(t)\] \[s.t. (\ref{eq:BMO_1}),(\ref{eq:BMO_2}).\]  
Note that the ISL contact state \(\delta_{ij}(t)\) and the transmission rate \(\gamma_{i}(t)\) are integer variable and continuous variable, respectively. It is easy to know the LTO problem is a mixed-integer linear programming (MILP) problem, which is proved to be an NP-hard problem. Thus, we solve the LTO problem in steps. To express our solution conveniently, let \(\delta_{ij}^{*}(t)\) and \(\gamma_{i}^{*}(t)\) be the optimal ISL contact state and transmission rate, respectively. Moreover, \(\lambda_{i}(t)\) is defined as the weight of LTO at slot \(t\), i.e.,  
\[\lambda_{i}(t)=\frac{P_{t}}{\xi_{\max}}(\mathcal{B}-E_{i}(t))-\mathcal{D}_{i} (t). \tag{20}\]  
Before the ISL is established, satellites are constantly harvesting energy and collecting space data. In this case, the energy queue \(E_{i}(t)\) continues to approach the capacity ofbattery \(\mathcal{B}\), and the data queue \(\mathcal{D}_{i}(t)\) keeps approaching the maximum storage of buffer. According to constraint (11), we have  
\[\lambda_{i}(t)<0. \tag{21}\]  
Thus, we can obtain the solution for LTO by maximizing \(\delta_{ij}(t)\cdot\gamma_{i}(t)\). There is no need to optimize the transmission rate when the ISL contact is inactive, i.e., \(\delta_{ij}(t)=0\). It makes sense to optimize the transmission rate when \(\delta_{ij}(t)=1\). Thus, we can obtain the optimal ISL contact state as follows  
\[\delta_{ij}^{*}(t)=1. \tag{22}\]  
In order to improve system utility, the RSN should transfer data to the relay satellite as much as possible when the ISL contact is active. Note that the inter-satellite transmission rate is limited by link capacity. Thus, link capacity is the optimal solution for transmission rate, i.e.,  
\[\gamma_{i}^{*}(t)=\xi_{i}(t). \tag{23}\]  
In addition, the transmission rate can reach the optimal solution only when \(\mathcal{D}_{i}(t)\) is larger than ISL capacity. Therefore, the necessary condition of Formula (23) is \(\mathcal{D}_{i}(t)\geq\xi_{i}(t)\). To this end, the LTO problem can be transformed into a link allocation optimization (LAO) problem, expressed as  
\[\text{LAO}: \min_{\delta_{ij}(t)}\sum_{i=1}^{M}\sum_{j=1}^{N}\tau\lambda_{i}(t )\delta_{ij}(t)\xi_{i}(t)\] \[s.t.\ (1),(2).\]  
To minimize \(\lambda_{i}(t)\), relay satellites tend to assign antennas to user satellites with longer data queues and energy queues. We can observe that the LAO problem falls in the category of a weighted maximum matching problem. As shown in Figure 2, the link allocation problem can be represented as a weighted bipartite graph (WBG). Let \(M\) be the user satellite set and \(N\) be the relay satellite set. For each \(i\in M\), \(j\in N\), we denote \(w_{ij}\) as the weight of edge from \(i\) to \(j\). According to (20), we set \(w_{ij}=\mathcal{D}_{i}(t)-\frac{\mathcal{D}_{i}}{\xi_{\text{max}}}(\mathcal{B }-E_{i}(t))\). Then, the LAO problem can be effectively addressed based on the WBG by the Kuhn-Munkres (KM) algorithm [39].