# Precise Mission Process Control Based on a Novel Dual-Code Group Network Plan Diagram
## 3 Dual-Code Group Network Plan Diagram Model with Time Line
### Topological Sorting of Missions  
The calculation of the parameters of the group network plan diagram needs to be carried out in the logical order of the missions. Therefore, it is necessary to logically order the missions first. For small-scale network plan diagrams, the logical ordering of missions is usually performed manually. However, for large-scale group network plan diagrams, the number of missions is large, the relationship between missions is complex, and the manual work is time-consuming and prone to errors, so it is necessary to design an automated sorting method. To address this problem, we designed a topological sorting algorithm for group network plan diagram missions (see Algorithm 1).  
```
Mission set \(\mathcal{M}=\{m_{1},m_{2},m_{3},...,m_{n}\}\)  Prior-mission set \(\mathcal{EM}_{m_{i}},m_{i}\in\mathcal{M}\)  Post-mission set \(\mathcal{F}\mathcal{M}_{m_{i}},m_{i}\in\mathcal{M}\) Output: Sorted mission set \(\mathcal{M}_{s}\)
1 Initialize: \(\mathcal{M}_{s}\) and FIFO queue \(Q\) for\(m_{i}\in\mathcal{M}\)do
2 get \(n_{m_{i}}^{e}\) \(\triangleright\)\(n_{m_{i}}^{e}\) is the prior-missions number of \(m_{i}\) if\(n_{i}^{e}==0\)then
3 add \(m_{i}\) to \(Q\) endif
4
5 endfor
6 while\(Q\)do
7 get \(m_{k}\) \(\triangleright\)\(m_{k}\) is the first mission of \(Q\)
8 add \(m_{k}\) to \(\mathcal{M}_{s}\) for\(m_{j}\in\mathcal{F}\mathcal{M}_{m_{k}}\)do
9 get \(\
u(m_{j})\) \(\triangleright\)\(\
u(m_{j})\) is the prior-missions number of \(m_{j}\)
10\(\
u(m_{j})\leftarrow\
u(m_{j})-1\) if\(\
u(m_{j})==0\)then\(\triangleright\) all prior-missions of \(m_{j}\) have added to \(\mathcal{M}_{s}\)
11 add \(m_{j}\) to \(Q\)
12 endif
13 endfor
14
15 endwhile return\(\mathcal{M}_{s}\)
```  
**Algorithm 1** Framework of ensemble learning for our system  
Figure 6: Diagram of mission continuous relationships.  
There are two inputs to the Algorithm 1, the first is the set of tasks \(\mathcal{M}=\{m_{1},m_{2},m_{3},...,\)\(m_{n}\}\), which contains a total of \(n\) sub-tasks; the second input is the prior-mission set \(\mathcal{EM}_{m_{i}},m_{i}\in\mathcal{M}\) for each sub-task and the the post-missions set \(\mathcal{FM}_{m_{i}},m_{i}\in\mathcal{M}\). The output of Algorithm 1 is a mission set \(\mathcal{M}_{s}\) sorted according to mission logical relationships. The sorted missions set \(\mathcal{M}_{s}\) obtained by Algorithm 1 is in accordance with the conclusions of Theorem 1.  
**Theorem 1**.: _Define a binary relation \(\mathbf{\mathcal{R}}\) on \(\mathcal{M}_{s}\times\mathcal{M}_{s}\), where \(\mathbf{\mathcal{R}}=\{(m_{1},m_{2})|m_{1}\) before \(m_{2}\) in \(\mathcal{M}_{s}\}\). For all \(\forall m\in\mathcal{M}_{s}\), if \(\mathcal{EM}_{m}\
eq\varnothing\), then for all \(\forall m^{\prime}\in\mathcal{EM}_{m}\), both with\((m^{\prime},m)\in\mathbf{\mathcal{R}}\). If \(\mathcal{FM}_{m}\
eq\varnothing\), then for all \(m^{\prime\prime}\in\mathcal{EM}_{m}\), it must be the case that \((m,m^{\prime\prime})\in\mathbf{\mathcal{R}}\). In other words, any mission in the sorted mission set \(\mathcal{M}_{s}\) must be preceded by all of its prior-missions and followed by all of its post-missions._  
Proof of Theorem 1.: According to the implementation of Algorithm 1, for any mission \(m\), it can join \(\mathcal{M}_{s}\) only if \(\
u(m)=0\), i.e., all prior-missions of mission \(m\) join the sorted set \(\mathcal{M}_{s}\). Thus all prior-missions of mission \(m\) must be arranged before it in \(\mathcal{M}_{s}\). If \(\exists m^{\prime\prime}\in\mathcal{FM}_{m}\) is added to \(\mathcal{M}_{s}\) before \(m\), then when \(m^{\prime\prime}\) joins \(\mathcal{M}_{s}\), there must be \(\
u(m^{\prime\prime})\
eq 0\), in contradiction to the fact that \(\
u(m^{\prime\prime})=0\) for any mission \(m^{\prime\prime}\) in \(\mathcal{M}_{s}\). Thus there is no \(m^{\prime\prime}\) joining \(\mathcal{M}_{s}\) before \(m\), i.e., all \(m^{\prime\prime}\) joins \(\mathcal{M}_{s}\) after \(m\).  
This completes the Proof of Theorem 1.