## 4 Extension to Switching Topologies and Dynamic Leaders  
Due to transmission failure and other factors, the communication topology between agents may change in the containment process. On the other hand, the trajectories of leaders usually change over time in practical agent coordination tasks. Therefore, the proposed containment design is extended to the switching topologies and dynamic leaders situation. A switching graph \(\mathcal{G}(k)\) associated with time instant \(k\) is now used to indicate the communication topology among agents. The graph switches from the set \(\mathcal{G}=\{\mathcal{G}_{1},\mathcal{G}_{2},...,\mathcal{G}_{p}\}\), where \(\psi\in\mathbb{Z}^{+}\) is the total number of possible graphs. The time-varying adjacency matrix and the Laplacian matrix are denoted by \(\mathcal{A}(k)=[a_{ij}(k)]\in\mathbb{R}^{(N+M)\times(N+M)}(i,j\in\mathcal{V})\) and \(\mathcal{L}(k)\), respectively. The two blocks in (1) are also time-varying and written as \(\mathcal{L}_{1}(k)\) and \(\mathcal{L}_{2}(k)\). The in-degree matrix in time instant \(k\) is denoted by \(\mathcal{D}(k)=diag\big{(}d_{1}(k),...,d_{N+M}(k)\big{)}\) with diagonal entries \(d_{i}(k)=\sum_{j=1}^{N+M}a_{ij}(k)\). For a specific interaction graph \(\mathcal{G}_{l}\) in the set \(\mathcal{G}\), the corresponding in-degree matrix is defined as \(\mathcal{D}^{l}=diag\big{(}d_{1}^{l},...,d_{N+M}^{l}\big{)}\). The neighbors of the \(i\)th agent in time instant \(k\) are denoted by the set \(\mathcal{N}_{i}(k)\). **Assumption 5**. : _For every graph in \(\mathcal{G}\), the communication graph among followers is strongly connected and each follower can receive the information via a directed path from at least one leader._  
Next, we consider the time varying leaders. Assume that the trajectories of leaders have lower and upper bounds, that is  
\[\bar{w}^{-}\leq w_{l}(k)\leq\bar{w}^{+},l=N+1,...,N+M\]  
where \(\bar{w}^{-}\) and \(\bar{w}^{+}\) are two constants. Considering the above changes, the local containment error in (4) is modified as  
\[\xi_{i}(k) =\sum_{j=1}^{N}a_{ij}(k)(y_{j}(k)-y_{i}(k))\] \[+\sum_{l=N+1}^{N+M}a_{il}(k)(w_{l}(k)-y_{i}(k)) \tag{29}\]  
The control input (7) is extended as  
**Extended Distributed containment input law:**  
\[u_{i}(k)=u_{i}(k-1)+\frac{\rho_{i}\widehat{\mathcal{H}}_{i}(k)}{\lambda+| \widehat{\mathcal{H}}_{i}(k)|^{2}}\xi_{i}(k) \tag{30}\]  
where \(\rho_{i}\in(0,1]\), \(\eta\in(0,2]\), \(\mu>0\), \(\lambda>0\) are parameters. Now, Equations (5), (6), and (30) consist the extended algorithm, and the result is given as the following theorem. **Theorem 2**. : _In the switching topologies and dynamic leaders case, assume that the MASs dynamics satisfy Assumptions 1-3 and the communication topology satisfies Assumption 5. Let the distributed MFACC (5), (6), and (30) be applied. If the parameter \(\rho_{i}\)\((i=1,...,N)\) is selected to satisfy the following convergence condition_  
\[0<\rho_{i}<\frac{1}{\max_{l=1,2,...,\bar{w}}d_{i}^{l}}\]  
_then there exists a \(\lambda_{min}>b^{2}/4\), and the MASs will converges to \([\bar{w}^{-},\bar{w}^{+}]\) when \(\lambda>\lambda_{min}\) and \(k\rightarrow\infty\)._  
Proof. : Define the time-varying leaders' output collective stack vectors as \(\mathbf{w}(k)=[w_{1}(k),\)\(w_{2}(k),\)\(...,\)\(w_{N}(k)]^{T}\). In this case, Equation (17) becomes  
\[\mathbf{y}(k+1)=\mathbf{\tilde{\Gamma}}(k)\bigg{[} \begin{array}{c}\mathbf{y }(k)\\ \mathbf{w}(k)\end{array} \bigg{]} \tag{31}\]  
where  
\[\mathbf{\tilde{\Gamma}}(k) =\big{[} \begin{array}{c}I-\rho\mathbf{\Phi}(k)\mathbf{H}(k) \mathcal{L}_{1}(k)\\ \end{array} -\rho\mathbf{\Phi}(k)\mathbf{H}(k)\mathcal{L}_{2}(k)\end{array} \big{]}\] \[=[\widehat{\mathcal{H}}_{ii}]\in\mathbb{R}^{N\times(N+M)}.\]  
The \(\tilde{\mathcal{T}}_{ii}(k)\) is now written as  
\[\tilde{\mathcal{T}}_{ii}(k)=1-\frac{d_{i}(k)\rho_{i}\phi_{i}(k)\widehat{\phi}_ {i}(k)}{\lambda+|\widehat{\phi}_{i}(k)|^{2}} \tag{32}\]If the condition \(0<\rho_{i}<\frac{1}{\max_{i=1,2,\ldots,p}d_{i}^{2}}\) holds, one has \(0<d_{i}(k)\rho_{i}<1\).