## 5 Algorithm Design
Thus, \(f_{i,1}=F_{1}\sqrt{c_{i}a_{i}}/\big{(}\sum_{i\in\mathcal{N}^{\mathsf{L}}} \sqrt{c_{i}a_{i}}\big{)}\). Considering (8d), we can deduce:  
\[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]1\(\mathcal{P}\)1.2 is the computing resource allocation problem for neighboring satellites' MEC servers, which is expressed as:  
\[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]2 (16) s.t. (8c) and (8e). Since the computing resource allocation of each neighboring satellite is independent of each other, \(\mathcal{P}\)1.2 can be decomposed into \(M-1\) sub-problems, one of which is \(\mathcal{P}\)1.3. \[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]3 (17) s.t. (8c) and (8e). The objective function in (17) is set as \(U^{\text{N}}\). Then, we can have \(\partial U^{\text{N}}/\partial f_{i,j}=-c_{i}a_{i}/\left(f_{i,j}\right)^{2}\), which is less than \(0\). \(\partial^{2}U^{\text{N}}/\partial\big{(}f_{i,j}\big{)}^{2}=2c_{i}a_{i}/\left( f_{i,j}\right)^{3}\), which is greater than \(0\). \(\partial^{2}U^{\text{N}}/\left(\partial f_{i,j}\partial f_{k,j}\right)=0\), \(i,k\in\mathcal{N}^{\text{N}}\), \(i\
eq k\). The Hessian matrix of \(U^{\text{N}}\) is positive definite. Hence, \(U^{\text{N}}\) is convex. \(\mathcal{P}\)1.3 can be solved by using the Lagrange multiplier method. The Lagrangian function is constructed as:  
\[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]4  
where \(\lambda\) is the Lagrange multiplier and \(\lambda\geq 0\). The KKT conditions of \(\mathcal{P}\)1.3 are listed as:  
\[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]5 \[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]6 (20) \[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]7 (21) (8c) and (8e), \[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]8  
Similar to solving \(\mathcal{P}\)1.1, \(f_{i,j}=\sqrt{c_{i}a_{i}/\lambda}\) is obtained from (19). Substituting it into (20), we can obtain \(\sum_{i\in\mathcal{N}^{\text{N}}}\sqrt{c_{i}a_{i}/\lambda}-F_{j}=0\), i.e., \(\sqrt{\lambda}=\big{(}\sum_{i\in\mathcal{N}}\sqrt{c_{i}a_{i}}\big{)}/F_{j}\). So \(f_{i,j}=F_{j}\sqrt{c_{i}a_{i}}/\big{(}\sum_{i\in\mathcal{N}^{\text{N}}}\sqrt{ c_{i}a_{i}}\big{)}\). Given (8e), we can obtain:  
\[\text{s.t.}\,\sum_{i\in\mathcal{N}^{\mathsf{L}}}f_{i,1}\leq F_{1},\]9  
By solving \(\mathcal{P}\)1.1 and \(\mathcal{P}\)1.3 above, we can obtain \(f_{i,1}^{*}\) and \(f_{i,j}^{*}\), respectively. By taking them back to \(\mathcal{P}\), \(\mathcal{P}\) can be transformed into \(\mathcal{P}\)2. \[\sum_{i\in\mathcal{N}^{\mathsf{N}}}f_{i,j}\leq F_{j},\forall j\in \mathcal{M},\]0 (24) s.t. (7f) and (7g). Equation (24) is the objective function. \(\mathcal{P}\)2 is an integer linear programming (ILP) problem, which is NP-hard. When the scale of a problem is large, it is difficult to obtain the optimal solution in polynomial time. ILP problems can be solved by intelligence optimization algorithms, one of which is the GWO algorithm. The GWO algorithm is widely used and has few parameters and is easy to implement [34]. According to the GWO algorithm [35], the grey wolf population is highly hierarchical and each wolf represents a feasible solution. The top rank wolf is \(\alpha\), i.e., the optimal solution. The second rank wolf is \(\beta\), i.e., the suboptimal solution. The third rank wolf is \(\delta\), i.e., the third optimal solution. The remaining wolves are \(\omega\), which are the lowest rank and form a set \(\mathcal{N}^{\omega}\), i.e., the remaining solutions. The prey is the optimal solution to the problem. During each iteration, \(\alpha\), \(\beta\), and \(\delta\) command \(\omega\) to encircle, hunt, and attack the prey to obtain the optimal solution. We use \(N^{W}\) to represent the number of grey wolves in the population. The wolf \(l\) is encoded as \(\vec{X}_{l}=[x_{l,1},x_{l,2},x_{l,3},\ldots,x_{l,N}]\), where \(x_{l,j}\) is the task offloading decision of task \(i\) of wolf \(l\).