## 4 Methodology
### Multi-Objective Task Scheduling Based on Gradient Descent
The task offloading and resource allocation matrices are then updated as follows:  
\[\min_{\mathbf{X}}f_{1}(\mathbf{X})=\sum_{i=1}^{N}\sum_{j=1}^{M}\frac{d_{ik}^{ j}}{b_{i}}X_{ij} \tag{26}\]9  
\[\min_{\mathbf{X}}f_{2}(\mathbf{X})=\sum_{i=1}^{N}\sum_{j=1}^{M}X_{ij}(c_{i}+s_{ i}+b_{i}) \tag{27}\]0  
where \(\eta\) is the step size. This iterative process ensures that the optimization converges to a balanced solution that minimizes latency and maximizes resource utilization, thereby achieving optimal system scheduling. Overall, the proposed distributed optimization-based framework, enhanced with multi-objective optimization and Gradient Surgery, provides an effective solution for task scheduling and resource management in dynamic and distributed satellite networks. Based on the conceptions, we propose Algorithm 2. ```
0: Number of satellite nodes \(N\) with resources \(c_{i}\), \(s_{i}\), \(b_{i}\); Number of tasks \(M\) with Latency \(\phi_{ik}^{j}\), Data volume \(d_{ik}^{j}\); Computational demand \(t_{j}^{c}\); Max resources \(R_{\max}^{i}\); Maximum number of iterations \(K_{\max}\). 0: Task offloading matrix \(\mathbf{X}^{*}\); Resource allocation matrix \(\mathbf{R}^{*}\). 1: Initialize\(\mathbf{X}_{0}\) randomly, \(\mathbf{R}_{0}\) based on initial resource allocation. 2: Set learning rate \(\eta\); Set weights \(\alpha\), \(\beta\) for latency and resource functions. 3:for\(k=0\) to \(K\)do
4: Compute \(\
abla_{\mathbf{X}}f_{1}\), \(\
abla_{\mathbf{X}}f_{2}\) using Equations (31) and (32);
5: Compute \(\
abla_{\mathbf{R}}f_{2}\) using Equation (33);
6: Adjust \(\
abla_{\mathbf{X}}\), \(\
abla_{\mathbf{R}}\) using Equations (36) and (37);
7:\(\mathbf{X}_{k+1}\leftarrow\mathbf{X}\) with Equation (41);
8:\(\mathbf{R}_{k+1}\leftarrow\mathbf{R}\) with Equation (42);
9:if\(|f(\mathbf{X}_{k+1},\mathbf{R}_{k+1})-f(\mathbf{X}_{k},\mathbf{R}_{k})|\leq \varepsilon\;\mathbf{or}\;k\geq K_{\max}\;\)then
10: terminate. 11:endif
12:endfor
13:return\(\mathbf{X}^{*}\), \(\mathbf{R}^{*}\)
```  
**Algorithm 2** Distributed optimization-based resource management (DORM)  
The input includes the number of satellite nodes \(N\) and their resources \(c_{i}\), \(s_{i}\), \(b_{i}\); the number of tasks \(M\) and their latency \(\phi_{ik}^{j}\); data volume \(d_{ik}^{j}\); computational demand \(t_{j}^{c}\); maximum resources of nodes \(R_{\max}^{i}\); and the maximum number of iterations \(K_{\max}\). The output consists of the optimal task offloading matrix \(\mathbf{X}^{*}\) and resource allocation matrix \(\mathbf{R}^{*}\). The matrices \(\mathbf{X}_{0}\) and \(\mathbf{R}_{0}\) are initialized randomly, with the resource allocation matrix set based on initial distribution (line 1). The learning rate \(\eta\), and weight parameters \(\alpha\) and \(\beta\) for latency and resource functions are set (line 2). The iterative process runs from \(k=0\) to \(K\) (line 3), with a maximum of \(K_{\max}\) iterations to prevent infinite loops. This limits the time for optimization while allowing convergence. In each iteration, the gradients of the task offloading objective function \(f_{1}\) and the resource consumption objective function \(f_{2}\) with respect to \(\mathbf{X}\) are computed (line 4). These gradients guide the adjustment of task offloading decisions to optimize the objective function. The gradient of \(f_{2}\) with respect to the resource allocation matrix \(\mathbf{R}\) is computed (line 5). The gradients for task offloading and resource allocation are adjusted using Gradient Surgery (line 6), ensuring a balanced optimization process by orthogonalizing conflicting gradients. This step mitigates trade-off issues between minimizing latency and maximizing resource usage. The matrices \(\mathbf{X}_{k+1}\) and \(\mathbf{R}_{k+1}\) are updated using the adjusted gradients (lines 7 and 8). This update step allows the optimization process to move towards a Pareto optimal solution by dynamically adjusting resource allocation based on the task offloading decisions.