# An On-Orbit Task-Offloading Strategy Based on Satellite Edge Computing
## 4 Algorithm Introduction and Simulation Analysis  
### Algorithm Introduction  
The binary particle swarm optimization (BPSO) algorithm was utilized to solve the similar model [21]. The BPSO algorithm has a memory function and can converge to a stable solution in a short time, but it is easy for it to fall into a local optimum. The genetic algorithm (GA) algorithm has a wide range of spatial search capability and variational capability, with strong global search capability, and can effectively overcome the problem of falling into a local optimum in the search process, making it suitable for massively parallel computing. To compensate for the limitations of the BPSO algorithm, we combine the BPSO algorithm and the GA in this work to obtain the GABPSO algorithm. It not only ensures a better information exchange mechanism but also avoids the deficiency of falling into a local optimum, enhances the search velocity, and improves the success rate of optimal solutions.  
First, we design the position and velocity of the \(u<U\) particles in the \(i<I\) iteration of the BPSO algorithm as  
\[X^{i}_{u}=\Big{(}x^{i}_{u}(1),\cdots,x^{i}_{u}(k),\cdots,x^{i}_{u}(p)\Big{)}, \tag{20}\]  
\[V^{i}_{u}=\Big{(}v^{i}_{u}(1),\cdots,v^{i}_{u}(k),\cdots,v^{i}_{u}(p)\Big{)}. \tag{21}\]  
In (23), \(x^{i}_{u}(k)\in X^{i}_{u}\triangleq[1,J]\{0,1\}\), where \([1,J]\) represents a \(1\times J\)-dimensional array, and \(2^{J}>d\times N\). Then each particle position \(X^{i}_{u}\) is represented by a binary combination of \(p\) groups, and the corresponding task allocation node can be obtained by combining the decision matrix \(M\) after decimal decoding. That is, \(\forall X^{i}_{u}(u\in U,i\in I)\) is a possible solution to the objective function. In (24), the initial value of \(v^{i}_{u}(k)\in V^{i}_{u}\) is defined as a random array within [0,1], which is matched with \(X^{i}_{u}\).  
The velocity update formula is  
\[V=W\times V+C1\times r1\times(\textit{pbest}-X)+C2\times r2\times(\textit{ gbest}-X), \tag{22}\]  
where \(W\) is the inertia weight, \(r1,r2\) is a random number between 0 and 1, and \(C1,C2\) is the learning factor.  
The position update formula is  
\[x^{i+1}_{u}(k)[j]=\begin{cases}0,&r\geq\frac{1}{1+e^{-\frac{r^{2}}{d^{2}}+1}( 0)|j|}\\ 1,&r<\frac{1}{1+e^{-\frac{r^{2}}{d^{2}}+1}(0)|j|}\end{cases} \tag{23}\]  
where \(r\) is a random number.  
The GA's crossover and mutation operations are introduced after updating particle positions. The updated particle positions in the \(i\)_th_ iteration is polled in turn. A particle position \(X^{i}_{f}\) is randomly chosen from the particle population, and its partial encoding is crossed with the polled particle position. The crossed particle position is inverted with a particular probability to obtain the mutation. Finally, the particle positions are utilized as input of the decision matrix \(M\) to find the fitness function, which is the value of the optimization objective function \(COST\) in (19). When we find the minimum fitness function, the minimum system cost can be obtained.  
The specific steps of the improved GABPSO hybrid algorithm are shown in Algorithm 1.