## 4 Optimization Problem Modeling
### Optimization Constraints
#### 4.4.4 Flow Conservation  
In the transmission of user data via inter-satellite and satellite-to-ground communications, it is essential to adhere to flow conservation laws for both observation and relay satellites. The flow conservation constraint for an observation satellite \(OS_{n}\) is defined by the following:  
\[\sum_{k=1}^{K}\sum_{t=1}^{T}\gamma^{o}_{n,k,t}=1,\quad\forall n \tag{24}\]  
Equation (24) ensures that each observation satellite \(OS_{n}\) (where \(n\) is the index of the satellite) must transmit its data to exactly one relay satellite \(RS_{k}\) within the time frame \([1,T]\). The summation over \(k\) (relay satellites) and \(t\) (time slots) ensures that the total number of transmissions initiated by each observation satellite \(OS_{n}\) equals 1. This reflects the principle that each observation satellite must transmit its data to exactly one relay satellite during the defined time horizon, maintaining data flow from observation satellites to relay satellites. For a relay satellite \(RS_{k}\) handling the data \(D^{o}_{n}\), the constraint is formulated as follows:  
\[\sum_{t=1}^{T}\gamma^{o}_{n,k,t}+\sum_{K=1,K^{\prime}\
eq k}^{K}\sum_{t=1}^{T} \gamma^{r}_{n,k,t^{\prime},t}=\sum_{k^{\prime}=1,k^{\prime}\
eq k}^{K}\sum_{t= 1}^{T}\gamma^{r}_{n,k^{\prime},k,t}+\sum_{t=1}^{T}\gamma^{g}_{n,k,t^{\prime}}, \quad\forall n,k \tag{25}\]  
Equation (25) enforces the principle of flow conservation at each relay satellite \(RS_{k}\) for data originating from a given observation satellite \(OS_{n}\). It ensures that the total incoming data flow into the relay satellite \(RS_{k}\) equals the total outgoing data flow from \(RS_{k}\), preserving the continuity of the data flow within the network. The left-hand side represents the total incoming flow into the relay satellite \(RS_{k}\), which includes data directly transmitted from the observation satellite and relayed from other relay satellites. The right-hand side represents the total outgoing flow from the relay satellite \(RS_{k}\), which includes data relayed to the other relay satellite and transmitted to the ground station. Equations (24) and (25) embody the principle of flow conservation, stating that for any given node in the network, the total data inflow must equal the total data outflow. This principle is vital for maintaining the integrity and efficiency of data transmission within the satellite network. By applying this conservation principle, we ensure that our model accurately tracks data movement and resource utilization across the network, thereby facilitating optimal routing and task offloading strategies. The inter-satellite link's state over time is modeled by representing the ground station as \(T\) nodes, \(GS_{t}\), with \(1\leq t\leq T\). At each time \(t\), link weights to relay satellites depend on link conditions. Using [PERSON]'s algorithm [PERSON] (1999) for shortest path calculations, super nodes are employed, and virtual ground station nodes have link weights set to zero. Specifically, to model the time-varying nature of the satellite-ground links, we represent the ground station as a set of virtual nodes \(GS_{t}\) for each time slot \(t\). Each virtual ground station node \(GS_{t}\) corresponds to the ground station at time \(t\), capturing the link availability and conditions at that specific time. To facilitate the application of [PERSON]'s algorithm, we introduce a'super node'. The super node serves as a single common destination node and is connected to all virtual ground station nodes \(GS_{t}\) with edges of zero weight. This construction ensures that the shortest path algorithm can effectively consider all possible paths reaching the ground station over different time slots. The graph \(G_{n}=(V,E,W_{n})\) is constructed, where \(V\) includes observation satellites \(OS_{n}\), relay satellites, and virtual ground station nodes; \(E\) consists of satellite-ground station links, and \(W_{n}\) contains link weights. All link weights from ground stations to super nodes are zero.