## 3 Methods
### Quantitative Evaluation Metric for Swarm Robustness  
In a sparse robot swarm, robots transfer information via the local and bandwidth-limited communication network. Generally, the more reliable the communication network is, the more robust the swarm could be. Therefore, we define the swarm robustness based on the reliability of the communication network. In the field of communication, researchers have proposed entropy-evaluation-based methods [42; 43] to quantitatively evaluate the reliability of communication networks. Without any prior knowledge about nodes and links, the reliability can be directly defined based on the topological relations. The swarm robustness depends on the distribution of the node and link importance. In other words, the more balanced the distribution is, the less the impact of a single node or link is, and the more robust the robot swarm will be. In informatics, [PERSON]'s information entropy is used to evaluate the uncertainty of a signal source, and its value indicates the amount of information needed to eliminate the uncertainty of the source. For a random variable \(X\), its information entropy \(H(X)\) is defined as:  
\[ \begin{cases}H(X)=-\sum_{m=1}^{M}p_{m}\log_{2}(p_{m}),\\ \sum_{m=1}^{M}p_{m}=1,\end{cases}  \tag{2}\]  
Figure 2: The framework of the proposed imitation learning method based on IDGCNs. The part in the pink box will become the distributed flocking control strategy we need by learning from the template. where \(p_{m}\) represents the probability of \(X=X_{m}\) and \(M\) is the number of all possible values of \(X\). When all possible values of \(X\) appear with equal probability, \(H(X)\) reaches the maximum value \(\log M\). In that case, the value of \(X\) achieves the maximum uncertainty, and the maximum amount of information is needed to eliminate the uncertainty. The importance of nodes and links in a swarm can also be considered as a kind of information. Suppose some nodes and links are of far greater importance than others. In that case, the information entropy of the importance distribution will be small, and these critical nodes and links could be identified easily. On the contrast, if all nodes and links are of similar or equal importance, the information entropy of the swarm will be larger, and it is hard to identify critical nodes or links. From the perspective of private flocking, such a swarm will be more robust in adversarial environments. Therefore, we introduce the information entropy into the definition of node importance and link importance. Note that the graph importance is evaluated from the perspective outside the swarm, so the direction of the data flow is usually difficult to obtain. Therefore, we consider all links to be bidirectional when evaluating the graph importance. When a node in the swarm breaks down, it also leads to the failure of the communication links directly connected to it. Obviously, the greater the degree of the node, the greater the impact of its destruction on the network. Therefore, the degree of a node can be used to measure its importance, which can be expressed by:  
\[p_{i}=\frac{\deg(v_{i})}{\sum_{v_{i}\in\mathcal{V}}\deg(v_{i})}. \tag{3}\]  
Notice that \(\sum_{v_{i}\in\mathcal{V}}p_{i}=1\). Then, we can further define the node importance entropy based on the node importance:  
\[E_{N}=-\sum_{i=1}^{N}p_{i}\log p_{i}. \tag{4}\]  
To define the link importance entropy, we first clarify the generalization of link contraction degree [42]. Link contraction is defined as the contraction of two connected nodes to a new node along the link between them, and the number of nodes directly connected to the new node is the link contraction degree. Analogously to the definition of node importance, the link importance \(p_{ij}\) of link \(e_{ij}\) can be expressed as:  
\[p_{ij}= \begin{cases}\frac{\deg(v_{ij})}{\sum\deg(v_{ij})},&\text{if}\sum\deg( v_{ij})\
eq 0\text{ and }e_{ij}\in\mathcal{E},\\ 0,&\text{otherwise},\end{cases}  \tag{5}\]  
where \(v_{ij}\) denotes the new node after the contraction along \(e_{ij}\).