## 4 Algorithm Design
### DMP-TA Algorithm  
The DMP-TA algorithm solves the task aggregation problem iteratively based on the initial MSMTAG model. The idea of the algorithm is to set a merge priority for each edge in the MSMTAG model and merge the two vertices connected to the edge with the maximum merge priority in each round until no edge exists in the graph. The calculation of the merge priority at the core of the DMP-TA algorithm. Considering that task aggregation aims to reduce the consumption of satellite energy resources, the algorithm takes the value of the energy that can be consumed less by executing a task after aggregation than by performing a task without aggregation as the basis for the merge priority. The merger priority is defined as follows. Figure 3: Multi-satellite and multi-task aggregation graph model. Figure 2: Vertex and aggregation method schematic. ```
1 Define \(f:GT\to V:\forall GT,\exists!v_{i}\in V:f(GT)=v_{i}\);
2 Initialize \(p=1\), \(q=2\), \(k=1\);
3 for\(\forall tw_{p,j,kp}\in GTW_{p,j}\) and \(\forall tw_{q,j,kq}\in GTW_{q,j}\)do
4 if\((\exists S_{j}\in GS:\forall T_{pi}\in GT_{p},GTW_{pi,j}\
eq\varnothing)\)and \((\forall T_{pi}\in GT_{p},\exists S_{j}\in GS,tw_{p,j,k}\in GTW_{pq,j})\)then
5\(E_{p,q}=\{tw_{p,j,kp},tw_{q,j,kq}\}\);
6\(E\gets E\cup E_{p,q}\);
7\(k=k+1\);
8 while\(p<|GT|\)do
9 if\(q\leq|GT|\)then
10\(q=q+1\);
11 else
12\(p=p+1\);
13\(q=p+1\);
14 return\(G\)
```  
**Algorithm 1**Initial MSMTAG model construction algorithm  
**Definition 1**. : _Aggregation Priority._  
\[AP\big{(}E_{i,j}\big{)}=f_{\min}(v_{i})+f_{\min}\big{(}v_{j}\big{)}-f_{\min} \Big{(}v_{C_{i,j}}\Big{)} \tag{5}\]  
where \(f_{\min}(v_{i})\), \(f_{\min}(v_{j})\) denote the minimum value of energy required for the execution of the aggregation tasks corresponding to vertex \(v_{i}\) and vertex \(v_{j}\), respectively, and \(f_{\min}\Big{(}v_{C_{i,j}}\Big{)}\) denotes the minimum value of energy needed for the execution of the new aggregation tasks formed by the aggregation of tasks corresponding to vertex \(v_{i}\) and vertex \(v_{j}\). Since the MSMTAG model \(G\) changes with each task merge performed by the algorithm, the merge priority between tasks is also dynamically changing. The algorithm will dynamically calculate and update the merge priority of the edges during each round of iteration. The essence of calculating merge priority lies in determining the minimal amount of energy required for the execution of aggregation tasks. As shown in Figure 2, for any edge \(E_{p,q}\), the more elements contained in \(E_{p,q}\) of the aggregation graph, the more aggregation methods are available between vertices \(v_{p}\) and \(v_{q}\). Although the aggregation tasks generated under different aggregation methods include the same meta-tasks, the corresponding satellite resources and execution times may be different. Thus the energy consumption required for the execution of the aggregated tasks obtained after aggregation is also different. Therefore, solving the minimum energy consumption required for executing the aggregated task requires calculating the minimum energy consumption value for generating this aggregated task under different aggregation methods. This paper designs a dynamic programming-based computational method to quickly solve the minimum energy consumption of an aggregation task generated under a certain aggregation method. Let one aggregation method of the aggregation task \(C_{p}=\Big{\{}T_{p1},T_{p2},\cdots,T_{p1}\Big{\}}\) be \(\Big{\{}tw_{p1,j,k1},tw_{p2,j,k2},\cdots,tw_{p1,j,kM}\Big{\}}\), the algorithm for solving \(C_{p}\) the minimum value of energy consumption \(ME_{p}\) is shown in Algorithm 2.