## 4 The PI-Based Task Offloading Algorithm
### Consensus and Task Removal
#### 4.3.1 Consensus  
During the consensus process, satellites \(s\in S\) broadcasts \(\mathbf{R}_{s}\), \(\mathbf{W}_{s}\) and \(\mathbf{Q}_{s}\) to neighboring satellites via LISL. Subsequently, the values of \(\mathbf{R}_{s}\) and \(\mathbf{W}_{s}\) in satellite \(s\in S\) are revised, based on the information of its neighbors, following the action rules [35] designed to achieve consensus. Then, the adopted consensus mechanism is detailed as follows.  
Considering sending satellite \(s\) and receiving satellite \(k\), vectors \(\mathbf{R}_{s}=[R_{s1}\), \(R_{s2}\), \(\ldots\), \(R_{sn}]^{\mathrm{T}}\), \(\mathbf{W}_{s}=[W_{s1}\), \(W_{s2}\), \(\ldots\), \(W_{sn}]^{\mathrm{T}}\) and \(\mathbf{Q}_{s}=[Q_{s1}\), \(Q_{s2}\), \(\ldots\), \(Q_{sm}]^{\mathrm{T}}\) are transmitted from \(s\) to \(k\) via LISL. After receiving these vectors, satellite \(k\) first updates its timestamp vector \(\mathbf{Q}_{k}\), based on (22). Then, for each task \(t\in T\), elements \(R_{kt}\) and \(W_{kt}\) in \(\mathbf{R}_{k}\) and \(\mathbf{W}_{k}\) are updated according to Table 2. In Table 2, three actions are considered, with _Maintain_ being the default one: (1) _Update_: \(R_{kt}=R_{st}\) and \(W_{kt}=W_{st}\); (2) _Maintain_: \(R_{kt}=R_{kt}\) and \(W_{kt}=W_{kt}\); and (3) _Reset_: \(R_{kt}=\infty\) and \(W_{kt}=0\).  
Notably, the consensus process is crucial for reaching a common \(\mathbf{R}_{s}\) among satellites. Recall that the removal impact vector \(\mathbf{R}_{s}\), as defined in Section 4.1, relies heavily on its task sequence \(\theta_{s}\). Broadcasting the removal impacts directly to all satellites may lead to server elements in \(\mathbf{R}_{s}\) reaching non-existent small values, which cannot be achieved by any satellite \(s\in S\) with its task sequences \(\theta_{s}\).  
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Value of \(\mathbf{W}_{st}\) from** & **Value of \(\mathbf{W}_{kt}\) from** & **Actions Taken by \(k\)** \\
**Sending Satellite \(\mathbf{s}\)** & **Receiving Satellite \(k\)** & **Actions Taken by \(k\)** \\ \hline \multirow{4}{*}{\(s\)} & \(k\) & if \(R_{st}<R_{kt}\rightarrow\) Update \\ \cline{2-3}  & \(s\) & Update \\ \cline{2-3}  & \(l\
otin\{\mathrm{s},k\}\) & if \(Q_{sl}>Q_{kl}\) or \(R_{st}<R_{kt}\rightarrow\) Update \\ \cline{2-3}  & 0 & Update \\ \hline \multirow{4}{*}{\(k\)} & \(k\) & Maintain \\ \cline{2-3}  & \(s\) & Reset \\ \cline{2-3}  & \(l\
otin\{\mathrm{s},k\}\) & if \(Q_{sl}>Q_{kl}\rightarrow\) Reset \\ \cline{2-3}  & 0 & Maintain \\ \hline \multirow{4}{*}{\(k\)} & \(k\) & if \(Q_{sl}>Q_{kl}\) and \(R_{st}<R_{kt}\rightarrow\) Update \\ \cline{2-3}  & \(s\) & if \(Q_{sl}>Q_{kl}\rightarrow\) Update \\ \cline{2-3}  & \(l\) & \(Q_{sl}>Q_{kl}\rightarrow\) Update \\ \cline{2-3}  & \(q\
otin\{\mathrm{s},k,l\}\) & if \(Q_{sl}>Q_{kl}\) and \(Q_{sl}>Q_{kl}\rightarrow\) Update \\ \cline{2-3}  & \(q\
otin\{\mathrm{s},k,l\}\) & if \(Q_{sl}>Q_{kl}\) and \(R_{st}<R_{kt}\rightarrow\) Update \\ \cline{2-3}  & \(q\) & \(Q_{st}>Q_{kl}\) and \(Q_{sl}<Q_{kl}\rightarrow\) Reset \\ \cline{2-3}  & 0 & if \(Q_{sl}>Q_{kl}\rightarrow\) Update \\ \hline \multirow{4}{*}{0} & \(k\) & Maintain \\ \cline{2-3}  & \(s\) & Update \\ \cline{2-3}  & \(l\
otin\{\mathrm{s},k\}\) & if \(Q_{sl}>Q_{kl}\rightarrow\) Update \\ \cline{2-3}  & 0 & Maintain \\ \hline \hline \end{tabular}
\end{table}
Table 2: Action Rules for satellite \(k\) after receiving information from satellite \(s\).