# Resource Allocation Strategy for Satellite Edge Computing Based on Task Dependency
## 3 System Models and Problem Formulation
### Task Scheduling Model
#### 3.3.1 Scheduling Model Based on Subtask Degree
Update the position of the sparrow joiner according to Equation (14). 10.endfor
11.for\(i=1\) to the number of investigators do
12. Update the position of the Sparrow Vigilant according to Equation (15). 13.endfor
14. The Cauchy mutation is used to apply Formula (16) to interfere with the population position so that individual sparrows can jump out of the local optimum. 15.if the fitness of the new solution is better than that of the previous solution, and the new solution is updated to the global optimal solution
16.\(t=t+1\)
17.endfor
18. return the completion delay of tasks in the optimal resource allocation strategy \(F\), \(B\), and subtask sets

#### 3.3.2 Improve the Resource Allocation Method of the Sparrow Search Algorithm

Compared with most traditional optimization algorithms, the swarm intelligence optimization algorithm is characterized by the simple cooperation of individuals in the group and is easy to implement. The advantage of the sparrow search algorithm lies in its specific search strategy and diversity maintenance mechanism, which helps to avoid falling into the local optimal solution and improve the global search ability. This enables the algorithm to search for the optimal solution more effectively in the resource allocation problem. Therefore, the sparrow search algorithm is chosen to solve the resource allocation problem. In the original sparrow algorithm, due to the lack of diversity among individuals in the population, it is easy to lead to a local optimum. The value of each dimension of the producer will decrease with the increase in the number of iterations, which will make the overall population too concentrated, resulting in a decrease in population diversity and affecting the effect of optimization. In the later stage of the iteration of the basic sparrow algorithm, the diversity of the sparrow population decreases and it is easy to fall into the situation of local optimum. To solve these problems, an improved sparrow search algorithm is proposed. The mapping relationship between the algorithm and the resource allocation optimization problem is as Table 2:

In the improved sparrow algorithm, the population number of sparrows is the set of resource allocation strategies, and the position of each sparrow is represented by a vector group X. The content of the constructed fitness function should include optimization goals and constraints. The fitness function is the completion delay of the subtask set. In order to meet the resource constraint requirements, a penalty function should be added to the fitness function to ensure that the resources allocated each time do not exceed the maximum value [27]. The optimal individual is found by the constructed fitness function. According to the form of the fitness function in the literature [27], the fitness function can be expressed as

\[T_{s_{l_{i}}}=\max_{j\in L}T_{i,j}^{s} \tag{8}\]

\[f=T_{s_{l_{i}}}+\delta_{1}penalty1+\delta_{2}penalty2 \tag{9}\]

\[penalty1=\left\{ \begin{array}{c}(\sum\limits_{j\in L}F_{i,j}-F_{\max})^{2} \ \sum\limits_{j\in L}F_{i,j}>F_{\max}\\ 0\ \sum\limits_{j\in L}F_{i,j}\leq F_{\max}\end{array} \right. \tag{10}\]

\[penalty2=\left\{ \begin{array}{c}(\sum\limits_{j\in L}B_{i,j}-B_{\max})^{2} \ \sum\limits_{j\in L}B_{i,j}>B_{\max}\\ 0\ \sum\limits_{j\in L}B_{i,j}\leq B_{\max}\end{array} \right. \tag{11}\]

The coding length of the individual is the length of each scheduled task set; 1 to \(L\) is the result of computing resource allocation, and \(1+L\) to \(2L\) is the result of the bandwidth resource allocation. (1) Initialize the population in combination with the opposition-based learning strategy. Due to the random initialization of the population at the beginning of the SSA algorithm, the diversity of the population is relatively poor and uneven in terms of distribution.