1 Introduction

Cooperative control problem for multi-agent systems has been extensively studied recently. Consensus problem, as a branch of cooperative control, has received a great deal of attention in the recent decades. The basic idea of consensus is that a group of agents achieves a consistent state by exchanging information with their neighbors. Due to its wide applications, such as unmanned aerial vehicles, the attitude alignment of satellite clusters, sensor networks, a lot of methods have been used to deal with consensus problems. Based on algebraic graph theory and matrix theory, some consensus problems were solved in [1, 2]. In [35], some sufficient conditions of consensus were obtained via linear system theory method. In [6], the game theory was used to deal with the consensus problems.

Many new topics on consensus are reported in the current literature. These topics mainly include consensus of heterogenous multi-agent systems [7, 8], containment control [9, 10], finite-time consensus [11, 12], and consensus of multi-agent systems with stochastic switching topologies [1315]. In [8], the high-order consensus problem for heterogeneous multi-agent systems with unknown communication delays was studied from the perspective of frequency domain. By using the control input information of neighbors, a novel protocol for containment control problem was proposed in [10], where both continuous-time and discrete-time systems were considered. In [11], a nonlinear distributed consensus algorithm was presented to study the problem of finite-time consensus. The main objective of finite-time consensus is that consensus can be achieved in a finite period of time [11]. Stochastic systems have been extensively studied in control field [16, 17]. Recently, as one kind of stochastic models, Markov model has been used to describe the stochastic switching rule of the interaction topologies of the multi-agent systems. The consentability problem for a network of double-integrator agents with Markovian switching topologies was studied in [14].

Very recently, group consensus is employed to describe the phenomena of multi-agent systems in which the agents may reach different consistent states. Similar problem can be found in [18], where the authors studied the consensus problem includes a special case, that is, the topology with separated subgroups. In [18], the agents belonging to different separated subgroups reached different consensus states. Sometimes, there are some relationships among these subgroups, that is, the subgroups are not separated. In order to solve this problem, group consensus of multi-agent systems was presented, and new consensus algorithms were designed in [19] and [20]. In [19], a group consensus of multi-agent systems was defined, and a novel linear consensus protocol was designed to achieve the group average consensus, where the interaction topology was undirected. In [21], the authors studied the group consensus problems for multi-agent systems with switching topologies and communication delays. The couple-group consensus problem of multi-agent systems with directed and fixed topology was studied in [22], where the consensus protocol was different from that of [19]. In [23], the authors studied the group consensus problem for double-integrator multi-agent systems, where two different kinds of consensus protocols were proposed. The hybrid protocol was proposed to solve the couple-group average-consensus problem of multi-agent systems with a fixed topology in [24]. However, in the above literature, the systems considered are continuous, and the topologies are fixed or switching in a deterministic framework. It is necessary to extend the results to the cases of discrete-time multi-agent systems and stochastic switching topology.

Motivated by the recent results on group consensus, we try to further study the group consensus problems for discrete-time multi-agent systems. Both the cases of a fixed topology and stochastic switching topologies are considered. Suppose that the stochastic switching topologies are governed by a finite-time Markov chain. First, the couple-group consensus problems are considered. Some necessary and sufficient conditions are obtained. Then, the results are extended to the case of multi-group consensus problems. The algorithms based on cone-complementarity linearization (CCL) are given to design the allowable control gains.

Notation. Let \(\mathbb {R}\) and \(\mathbb {N}\) represent, respectively, the real number set and the nonnegative integer set. Denote the spectral radius of the matrix \(M\) by \(\rho (M)\). Suppose that \(A, B \in \mathbb {R}^{p\times p}\). Let \(A\succeq B\) (respectively, \(A\succ B\)) denote that \(A- B\) is symmetric positive semi-definite (respectively, symmetric positive definite). Given \(X(k) \in \mathbb {R}^{p}\), define \(\Vert X(k)\Vert _{E} \triangleq \Vert E[X(k)X^{T}(k)]\Vert _{2}\), where \(E[\cdot ]\) is the mathematical expectation. \(I_{n}\) denotes the \(n\times n\) identity matrix. \(Re(\cdot )\) and \(Im(\cdot )\) represent, respectively, the real part and the imaginary part of a number. Let \(\mathbf {0}_{m\times n}\) denote \(m\times n\) zero matrix.

2 Preliminaries

We introduce the graph theory notions, first. Let \(\mathcal {G}=(\mathcal {V}, \mathcal {E}, \mathcal {A})\) be a directed graph of order \(n\), where \(\mathcal {V} = \{v_{1}, \ldots , v_{n}\}\) and \(\mathcal {E}\) represent the node set and the edge set, respectively. \(\mathcal {A} = [a_{ij}] \in \mathbb {R}^{n\times n}\) is the adjacency matrix associated with \(\mathcal {G}\), where \(a_{ij} > 0\) if \((v_{i}, v_{j})\in \mathcal {E}\), otherwise, \(a_{ij}=0\). An edge \((v_{i}, v_{j})\in \mathcal {E}\) if agent \(j\) can obtain the information from agent \(i\). We say agent \(i\) is a neighbor of agent \(j\). Let \(N_{i} = \{ v_{j} \in \mathcal {V}: (v_{i}, v_{j}) \in \mathcal {E}\}\) denote the neighbor set of agent \(i\). The (nonsymmetrical) Laplacian matrix \(\mathcal {L}\) associated with \(\mathcal {A}\), and hence \(\mathcal {G}\) is defined as \(\mathcal {L}=[l_{ij}]\in \mathbb {R}^{n\times n}\), where \(l_{ii}=\sum _{j=1,j\ne i}^{n}a_{ij}\) and \(l_{ij}=-a_{ij}\), \(\forall i\ne j\). A directed path is a sequence of edges in a directed graph in the form of \((v_{i_{1}}, v_{i_{2}})\), \((v_{i_{2}}, v_{i_{3}})\), \(\ldots \), where \(v_{i_{k}}\in \mathcal {V}\). A directed tree is a directed graph, where every node has exactly one parent except for one node, called the root, which has no parent, and the root has a directed path to every other node. A directed spanning tree of \(\mathcal {G}\) is a directed tree that contains all nodes of \(\mathcal {G}\). A directed graph has or contains a directed spanning tree if there exists a directed spanning tree as a subset of the directed graph, that is, there exists at least one node having a directed path to all of the other nodes. The union of graphs \(\mathcal {G}_{1}\) and \(\mathcal {G}_{2}\) is the graph \(\mathcal {G}_{1}\bigcup \mathcal {G}_{2}\) with vertex set \(\mathcal {V}(\mathcal {G}_{1})\bigcup \mathcal {V}(\mathcal {G}_{2})\) and edge set \(\mathcal {E}(\mathcal {G}_{1})\bigcup \mathcal {E}(\mathcal {G}_{2})\).

3 Problem formulation and consensus analysis

Similar to [19], we first consider couple-group consensus problem, and then, we extend the results to the case of multi-group consensus. For the case of couple-group, suppose that the multi-agent system consists of \(n+m\) agents. Without loss of generality, we assume that the first \(n\) agents achieve a consistent state, while the last \(m\) agents achieve another consistent state. Let \(\mathcal {G}=(\mathcal {V}, \mathcal {E}, \mathcal {A})\) denote the topology of multi-agent system considered. Denote \(\mathcal {I}_{1}=\{1, 2, \ldots , n\}\), \(\mathcal {I}_{2}=\{n+1, n+2, \ldots , n+m\}\). Let \(\mathcal {V}_{1}=\{v_{1}, v_{2}, \ldots , v_{n}\} \) and \(\mathcal {V}_{2}=\{v_{n+1}, v_{n+2}, \ldots , v_{n+m}\} \) represent the first \(n\) agents and the last \(m\) agents, respectively. Then, \(\mathcal {V} = \mathcal {V}_{1} \cup \mathcal {V}_{2}\), \(\mathcal {V}_{1} \cap \mathcal {V}_{2} = \Phi \). In addition, let \(N_{1i} = \{v_{j} \in \mathcal {V}_{1}: (v_{i}, v_{j}) \in \mathcal {E}\}\) and \(N_{2i} = \{v_{j} \in \mathcal {V}_{2}: (v_{i}, v_{j}) \in \mathcal {E}\}\). It is obvious that \(N_{i}= N_{1i} \cup N_{2i}\).

Suppose the dynamics of the \(i\)th agent is given by

$$\begin{aligned} x_{i}[k+1] = x_{i}[k]+u_{i}[k],\quad i= 1, 2, \ldots , n+m,\nonumber \\ \end{aligned}$$
(1)

where \(x_{i}[k] \in \mathbb {R}\) and \(u_{i}[k]\in \mathbb {R}\) represent the state and the input of agent \(i\) at time \(k\), respectively.

3.1 Fixed topology case

In [1923], the continuous-time consensus algorithms were proposed. Motivated by these results, we consider the following discrete-time consensus algorithm:

$$\begin{aligned} u_{i}[k] = \left\{ \begin{array}{ll} \gamma \left( \sum _{v_{j}\in N_{1i}} a_{ij} (x_{j}[k]- x_{i}[k]) + \sum _{v_{j}\in N_{2i}} a_{ij} x_{j}[k] \right) &{} \forall i \in \mathcal {I}_{1} \\ \gamma \left( \sum _{v_{j}\in N_{1i}} a_{ij} x_{j}[k] + \sum _{v_{j}\in N_{2i}} a_{ij} (x_{j}[k]- x_{i}[k]) \right) &{} \forall i \in \mathcal {I}_{2} \end{array} \right. , \end{aligned}$$
(2)

where \(a_{ij}\ge 0\) for all \(i, j \in \mathcal {I}_{1}\), \(a_{ij} \ge 0\) for all \(i, j \in \mathcal {I}_{2}\) and \(a_{ij} \in \mathbb {R}\) for all \((v_{i}, v_{j}) \in \mathcal {E}_{o} = \{(i, j): i \in \mathcal {I}_{1}, j \in \mathcal {I}_{2}\}\) \(\cup \) \(\{(i, j): j \in \mathcal {I}_{1}, i \in \mathcal {I}_{2}\}\). \(\gamma \) is the control gain to be designed. In addition, we suppose the algorithm in (2) satisfies the similar assumption to that of [19].

Assumption 1

(1) \(\sum _{j=n+1}^{n+m}a_{ij} =0\) for all \(i \in \mathcal {I}_{1}\); (2) \(\sum _{j=1}^{n}a_{ij} =0\) for all \(i \in \mathcal {I}_{2}\).

Assumption 2

The subgraphs \(\mathcal {G}_{1}\) and \(\mathcal {G}_{2}\) have a directed spanning tree, respectively.

Denote \(x[k] \triangleq [x_{1}[k], x_{2}[k], \ldots , x_{n+m}[k]]^{T}\). By applying the algorithm (2) to (1), we rewrite (1) in compact form as follows:

$$\begin{aligned} x[k+1] = \left[ \begin{array}{ll} I_{n}- \gamma \mathcal {L}_{1} &{}\quad \gamma \Omega _{1} \\ \gamma \Omega _{2} &{}\quad I_{m}- \gamma \mathcal {L}_{2} \end{array} \right] x[k], \end{aligned}$$
(3)

where

$$\begin{aligned} \Omega _{1}&= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} a_{1(n+1)} &{} a_{1(n+2)} &{} \cdots &{} a_{1(n+m)} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ a_{n(n+1)} &{} a_{n(n+2)} &{} \cdots &{} a_{n(n+m)} \end{array} \right] , \\ \Omega _{2}&= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} a_{(n+1)1} &{} a_{(n+1)2} &{} \cdots &{} a_{(n+1)n} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ a_{(n+m)1} &{} a_{(n+m)2} &{} \cdots &{} a_{(n+m)n} \end{array} \right] . \end{aligned}$$

Before giving the main results, the following definition is needed.

Definition 1

[19] The multi-agent system in (3) is said to achieve couple-group consensus if the states of agents satisfy (i) \(\lim _{k\rightarrow \infty } \Vert x_{i}[k]- x_{j}[k]\Vert = 0 \), \(\forall i, j \in \mathcal {I}_{1}\) and (ii) \(\lim _{k\rightarrow \infty } \Vert x_{i}[k]- x_{j}[k]\Vert = 0 \), \(\forall i, j \in \mathcal {I}_{2}\).

Now we will convert the couple-group consensus problem of multi-agent system in (3) into the stability problem of error system by the following transformation:

Let

$$\begin{aligned} z_{i}&\triangleq x_{i}-x_{n}, i=1, \ldots , n-1, \\ z_{j}&\triangleq x_{j}-x_{n+m}, j=n+1, \ldots , n+m-1, \\ Z&\triangleq [z_{1}, \ldots , z_{n-1}, z_{n+1}, \ldots , z_{n+m-1}]^{T}. \end{aligned}$$

Using Assumption 1 and some computations, we obtain the following error system:

$$\begin{aligned} Z[k+1]&= \left[ \begin{array}{ll} I_{n-1}-\gamma \widetilde{\mathcal {L}}_{1} &{}\quad \gamma \widetilde{\Omega }_{1} \\ \gamma \widetilde{\Omega }_{2} &{}\quad I_{m-1}-\gamma \widetilde{\mathcal {L}}_{2}\end{array} \right] Z[k] \nonumber \\&\triangleq FZ[k] \nonumber \\&= (I_{n+m-2}+\gamma \widetilde{F})Z[k], \end{aligned}$$
(4)

where

$$\begin{aligned} \widetilde{F}&= \left[ \begin{array}{l@{\quad }l} -\widetilde{\mathcal {L}}_{1} &{} \widetilde{\Omega }_{1} \\ \widetilde{\Omega }_{2} &{} - \widetilde{\mathcal {L}}_{2}\end{array} \right] \\ \widetilde{\mathcal {L}}_{1}&= \left[ \begin{array}{c@{\quad }c@{\quad }c} l_{11}- l_{n1} &{} \cdots &{} l_{1(n-1)}- l_{n(n-1)} \\ \vdots &{} \cdots &{} \vdots \\ l_{(n-1)1}- l_{n1} &{} \cdots &{} l_{(n-1)(n-1)}- l_{n(n-1)} \end{array} \right] \\ \widetilde{\mathcal {L}}_{2}&= \left[ \begin{array}{c@{\quad }c@{\quad }c} l_{(n+1)1}- l_{(n+m)1} &{} \cdots &{} l_{(n+1)(n+m-1)}- l_{(n+m)(n+m-1)} \\ \vdots &{} \cdots &{} \vdots \\ l_{(n+m-1)1}- l_{(n+m)1} &{} \cdots &{} l_{(n+m-1)(n+m-1)}- l_{(n+m)(n+m-1)} \end{array} \right] \\ \widetilde{\Omega }_{1}&= \left[ \begin{array}{c@{\quad }c@{\quad }c} a_{1(n+1)}- a_{n(n+m)} &{} \cdots &{} a_{1(n+m-1)}- a_{n(n+m-1)} \\ \vdots &{} \cdots &{} \vdots \\ a_{(n-1)(n+1)}- a_{n(n+m)} &{} \cdots &{} a_{(n-1)(n+m-1)}- a_{n(n+m-1)} \end{array} \right] \\ \widetilde{\Omega }_{2}&= \left[ \begin{array}{c@{\quad }c@{\quad }c} a_{(n+1)1}- a_{(n+m)1} &{} \cdots &{} a_{(n+1)(n-1)}- a_{(n+m)(n-1)} \\ \vdots &{} \cdots &{} \vdots \\ a_{(n+m-1)1}- a_{(n+m)1} &{} \cdots &{} a_{(n+m-1)(n-1)}- a_{(n+m)(n-1)} \end{array} \right] . \end{aligned}$$

Remark 1

In [19] and [20], the continuous-time algorithms were studied. Here we consider the discrete-time algorithm. In addition, we will extend the results to the case of stochastic switching topology.

Now we are in a position to give our main results.

Theorem 1

The multi-agent system (1) with algorithm (2) can achieve couple-group consensus asymptotically if and only if \(\gamma \) satisfies one of the following conditions for each \(i (i=1, \ldots , n+m-2)\). i) \(0<\gamma < -\frac{2Re(\mu _{i})}{|\mu _{i}|^{2}}\) (\(Re(\mu _{i})< 0\)); ii) \(-\frac{2Re(\mu _{i})}{|\mu _{i}|^{2}}<\gamma <0\) (\(Re(\mu _{i})> 0\)), where \(\mu _{i}(i=1, \ldots , n+m-2)\) is the \(i\)th eigenvalue of \(\widetilde{F}\).

Proof

According to the aforementioned discussion, the multi-agent system (1) with algorithm (2) can achieve couple-group consensus asymptotically if and only if the error system in (4) is stable. From linear system theory [25], we know system in (4) is stable if and only if \(\rho (F) < 1\). Let \(\mu _{i}\) and \(\lambda _{i}\) be the \(i\)th eigenvalue of \(\widetilde{F}\) and \(F\), respectively. Then, \(\lambda _{i} = 1+\gamma \mu _{i}= [1+\gamma Re(\mu _{i})]+ i[\gamma Im(\mu _{i})]\). Hence,

$$\begin{aligned} \rho (F) < 1 \Leftrightarrow |\lambda _{i}|< 1, i=1, \ldots , n+m-2, \end{aligned}$$

namely,

$$\begin{aligned}{}[1+\gamma Re(\mu _{i})]^{2}+ [\gamma Im(\mu _{i})]^{2} < 1. \end{aligned}$$
(5)

By solving the inequality in (5), we get that \(0<\gamma < -\frac{2Re(\mu _{i})}{|\mu _{i}|^{2}} (Re(\mu _{i})< 0)\) or \(-\frac{2Re(\mu _{i})}{|\mu _{i}|^{2}}\!<\gamma \!<\) \( \,0\, (Re(\mu _{i})\!> 0)\), \(i= 1, \ldots , n+m-2\), which is equivalent to i) and ii). This completes the proof.

Remark 2

Theorem 1 provides a necessary and sufficient condition for couple-group consensus of multi-agent system (1) with algorithm (2). The proof is based on the matrix theory. It follows from linear system theory that \(\rho (F) < 1\) is equivalent to that there exists a positive definite matrix \(P\in \mathbb {R}^{(n+m-2)\times (n+m-2)}\) satisfies \(P- F^{T}PF \succ \mathbf 0 _{(n+m-2)\times (n+m-2)}\). So we can get another condition for couple-group consensus of multi-agent system (1) with algorithm (2) in forms of linear matrix inequality.

Theorem 2

The multi-agent system (1) with algorithm (2) can achieve couple-group consensus if and only if there exist positive definite matrices \(P\in \mathbb {R}^{(n+m-2)\times (n+m-2)}\) and \(Q\in \mathbb {R}^{(n+m-2)\times (n+m-2)}\), and scalar \(\gamma \) such that the following LMI

$$\begin{aligned} \left[ \begin{array}{ll} P &{}\quad F^{T} \\ F &{}\quad Q \end{array}\right] \succ \mathbf 0 _{2(n+m-2)\times 2(n+m-2)} \end{aligned}$$
(6)

holds with the constraint \(P^{-1} = Q\). Here \(F\) is defined in (4).

Proof

According to the aforementioned discussion, we know that the multi-agent system (1) with algorithm (2) can achieve couple-group consensus if and only if \(\rho (F) < 1\), which is equivalent to that there exists a positive definite matrix \(P\) such that

$$\begin{aligned} P- F^{T}PF \succ \mathbf 0 _{(n+m-2)\times (n+m-2)}. \end{aligned}$$
(7)

Using Schur complement lemma and letting \(Q= P^{-1}\), we can get that (7) is equivalent to (6). This completes the proof.

Remark 3

Theorem 2 provides a necessary and sufficient condition for couple-group consensus of multi-agent systems (1) with algorithm (2). The advantage of this theorem is that we can obtain \(\gamma \) by solving LMI in (6) with constraint \(P^{-1} = Q\). This problem can be solved via the cone-complementarity linearization (CCL) method.

The CCL method which first appeared in [27] can be found in many studies in the literature, such as [14, 28]. Therefore, here we only give a short algorithm to compute \(\gamma \).

Algorithm 1

Step 1. Find a feasible point of LMI (6) \(\gamma ^{0}, P^{0}, Q^{0}\), set \(k=0\). If there are none, exit; Step 2. Find \(\gamma ^{k+1}, P^{k+1}, Q^{k+1}\) by solving the convex minimization problem:

$$\begin{aligned} t_{k} = \hbox {min} \{tr (PQ^{k}+ QP^{k})\} \end{aligned}$$

s.t.

$$\begin{aligned}&\left[ \begin{array}{ll} P &{} F^{T} \\ F &{} Q \end{array}\right] \succ \mathbf 0 _{2(n+m-2)\times 2(n+m-2)},\\&\quad \hbox {and} \left[ \begin{array}{ll} P &{} I_{n+m-2} \\ I_{n+m-2} &{} Q \end{array}\right] \succeq \mathbf 0 _{2(n+m-2)\times 2(n+m-2)}; \end{aligned}$$

Step 3. If \(t_{k}= 2(n+m-2)\), end this algorithm, and the feasible \(\gamma \) is given by \(\gamma = \gamma ^{k+1}\). Otherwise, set \(k=k+1\) and go to step 2.

3.2 Stochastic switching topology case

For the case of stochastic switching topology, we suppose that the switching topologies are governed by a finite-time Markov chain. Let \(\theta [k]\) be a homogeneous, discrete-time Markov chain, which takes values in a finite set \(S= \{1, \ldots , r\}\) with a probability transition matrix \(\Pi = [\pi _{ij}] \in \mathbb {R}^{r \times r}\). The Markov chain is assumed to be ergodic throughout this paper. The switching topology set is \(\overline{\mathcal {G}} = \{ \mathcal {G}^{1}, \ldots , \mathcal {G}^{r} \}\), where \(\mathcal {G}^{i}\), \((i=1, \ldots , r)\) are directed graphs with order \(n+m\). For each \(i\), the corresponding adjacency matrix and Laplacian matrix have the same definition as that of fixed topology.

We investigate the following algorithm:

$$\begin{aligned} u_{i}[k] = \left\{ \begin{array}{ll} \gamma \left( \sum _{v_{j}^{\theta [k]} \in N_{1i}^{\theta [k]}} a_{ij}^{\theta [k]} (x_{j}[k]- x_{i}[k]) + \sum _{v_{j}^{\theta [k]}\in N_{2i}^{\theta [k]}} a_{ij}^{\theta [k]} x_{j}[k] \right) &{} \forall i \in \mathcal {I}_{1}^{\theta [k]} \\ \gamma \left( \sum _{v_{j}^{\theta [k]}\in N_{1i}^{\theta [k]}} a_{ij}^{\theta [k]} x_{j}[k] + \sum _{v_{j}^{\theta [k]}\in N_{2i}^{\theta [k]}} a_{ij}^{\theta [k]} (x_{j}[k]- x_{i}[k]) \right) &{} \forall i \in \mathcal {I}_{2}^{\theta [k]} \end{array} \right. , \end{aligned}$$
(8)

where \(a_{ij}^{\theta [k]}\ge 0\) for all \(i, j \in \mathcal {I}_{1}^{\theta [k]}\), \(a_{ij}^{\theta [k]} \ge 0\) for all \(i, j \in \mathcal {I}_{2}^{\theta [k]}\) and \(a_{ij}^{\theta [k]} \in \mathbb {R}\) for all \((v_{i}, v_{j}) \in \mathcal {E}_{o}^{\theta [k]} = \{(i, j): i \in \mathcal {I}_{1}^{\theta [k]}, j \in \mathcal {I}_{2}^{\theta [k]}\}\) \(\cup \) \(\{(i, j): j \in \mathcal {I}_{1}^{\theta [k]}, i \in \mathcal {I}_{2}^{\theta [k]}\}\). \(\gamma \) is the control gain to be designed. Similar to the case of fixed topology, the following assumptions are needed.

Assumption 3

(1) \(\sum _{j=n+1}^{n+m}a_{ij}^{\theta [k]} =0\) for all \(i \in \mathcal {I}_{1}^{\theta [k]}\); (2) \(\sum _{j=1}^{n}a_{ij}^{\theta [k]} =0\) for all \(i \in \mathcal {I}_{2}^{\theta [k]}\).

Assumption 4

For each \(i\) \((i=1, \ldots , r)\), suppose \(\mathcal {G}\) includes two subgraphs \(\mathcal {G}_{1}^{i}\) and \(\mathcal {G}_{2}^{i}\), which satisfy \(\mathcal {V}_{1}^{i} \cup \mathcal {V}_{2}^{i}= \mathcal {V}^{i}\) and \(\mathcal {V}_{1}^{i} \cap \mathcal {V}_{2}^{i}= \Phi \). Denote \(\mathcal {G}_{l}^{u} \triangleq \mathcal {G}_{l}^{1} \cup \mathcal {G}_{l}^{2} \cup \cdots \cup \mathcal {G}_{l}^{r} \), \((l=1, 2)\). Suppose that \(\mathcal {G}_{l}^{u} (l=1, 2)\) have a directed spanning tree.

Similar to the case of fixed topology, using the algorithms (8) to (1), we can rewrite (1) in compact form as follows:

$$\begin{aligned} x[k+1] = \left[ \begin{array}{ll} I_{n}- \gamma \mathcal {L}_{1}^{\theta [k]} &{}\quad \gamma \Omega _{1}^{\theta [k]} \\ \gamma \Omega _{2}^{\theta [k]} &{}\quad I_{m}- \gamma \mathcal {L}_{2}^{\theta [k]} \end{array} \right] x[k], \end{aligned}$$
(9)

where

$$\begin{aligned} \Omega _{1}^{\theta [k]}&= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} a_{1(n+1)}^{\theta [k]} &{} a_{1(n+2)}^{\theta [k]} &{} \cdots &{} a_{1(n+m)}^{\theta [k]} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ a_{n(n+1)}^{\theta [k]} &{} a_{n(n+2)}^{\theta [k]} &{} \cdots &{} a_{n(n+m)}^{\theta [k]} \end{array} \right] , \\ \Omega _{2}^{\theta [k]}&= \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} a_{(n+1)1}^{\theta [k]} &{} a_{(n+1)2}^{\theta [k]} &{} \cdots &{} a_{(n+1)n}^{\theta [k]} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ a_{(n+m)1}^{\theta [k]} &{} a_{(n+m)2}^{\theta [k]} &{} \cdots &{} a_{(n+m)n}^{\theta [k]} \end{array} \right] . \end{aligned}$$

Definition 2

The multi-agent system in (9) is said to achieve couple-group consensus in mean-square sense if the states of agents satisfy (i) \(\lim _{k\rightarrow \infty } \Vert x_{i}[k]- x_{j}[k]\Vert _{E} = 0 \), \(\forall i, j \in \mathcal {I}_{1}\) and (ii) \(\lim _{k\rightarrow \infty } \Vert x_{i}[k]- x_{j}[k]\Vert _{E} = 0 \), \(\forall i, j \in \mathcal {I}_{2}\).

Let

$$\begin{aligned}&\xi _{i} \triangleq x_{i}-x_{n}, i=1, \ldots , n-1, \\&\xi _{j} \triangleq x_{j}-x_{n+m}, j=n+1, \ldots , n+m-1, \\&\xi \triangleq [\xi _{1}, \ldots , \xi _{n-1}, \xi _{n+1}, \ldots , \xi _{n+m-1}]^{T}. \end{aligned}$$

Using Assumption 3 and some computations, we obtain the following error system:

$$\begin{aligned} \xi [k+1]&= \left[ \begin{array}{l@{\quad }l} I_{n-1}-\gamma \widetilde{\mathcal {L}}_{1}^{\theta [k]} &{} \gamma \widetilde{\Omega }_{1}^{\theta [k]} \\ \gamma \widetilde{\Omega }_{2}^{\theta [k]} &{} I_{m-1}-\gamma \widetilde{\mathcal {L}}_{2}^{\theta [k]}\end{array} \right] \xi [k] \nonumber \\&\triangleq F^{\theta [k]}\xi [k] \nonumber \\&= (I_{n+m-2}+\gamma \widetilde{F}^{\theta [k]})\xi [k], \end{aligned}$$
(10)

where

$$\begin{aligned} \widetilde{F}^{\theta [k]}&= \left[ \begin{array}{l@{\quad }l} -\widetilde{\mathcal {L}}_{1}^{\theta [k]} &{} \widetilde{\Omega }_{1}^{\theta [k]} \\ \widetilde{\Omega }_{2}^{\theta [k]} &{} - \widetilde{\mathcal {L}}_{2}^{\theta [k]}\end{array} \right] \\ \widetilde{\mathcal {L}}_{1}^{\theta [k]}&= \left[ \begin{array}{c@{\quad }c@{\quad }c} l_{11}^{\theta [k]}- l_{n1}^{\theta [k]} &{} \cdots &{} l_{1(n-1)}^{\theta [k]}- l_{n(n-1)}^{\theta [k]} \\ \vdots &{} \cdots &{} \vdots \\ l_{(n-1)1}^{\theta [k]}- l_{n1}^{\theta [k]} &{} \cdots &{} l_{(n-1)(n-1)}^{\theta [k]}- l_{n(n-1)}^{\theta [k]} \end{array} \right] \\ \widetilde{\mathcal {L}}_{2}^{\theta [k]}&= \left[ \begin{array}{ccc} l_{(n+1)1}^{\theta [k]}- l_{(n+m)1}^{\theta [k]} &{} \cdots \\ \vdots &{} \cdots \\ l_{(n+m-1)1}^{\theta [k]}- l_{(n+m)1}^{\theta [k]} &{} \cdots \end{array} \right. \left. \begin{array}{cc} l_{(n+1)(n+m-1)}^{\theta [k]}- l_{(n+m)(n+m-1)}^{\theta [k]} \\ \vdots \\ l_{(n+m-1)(n+m-1)}^{\theta [k]}- l_{(n+m)(n+m-1)}^{\theta [k]} \end{array} \right] \\ \widetilde{\Omega }_{1}^{\theta [k]}&= \left[ \begin{array}{ccc} a_{1(n+1)}^{\theta [k]}- a_{n(n+m)}^{\theta [k]} &{} \cdots \\ \vdots &{} \cdots \\ a_{(n-1)(n+1)}^{\theta [k]}- a_{n(n+m)}^{\theta [k]} &{} \cdots \end{array} \right. \left. \begin{array}{ccc} a_{1(n+m-1)}^{\theta [k]}- a_{n(n+m-1)}^{\theta [k]} \\ \vdots \\ a_{(n-1)(n+m-1)}^{\theta [k]}- a_{n(n+m-1)}^{\theta [k]} \end{array} \right] \\ \widetilde{\Omega }_{2}^{\theta [k]}&= \left[ \begin{array}{ccc} a_{(n+1)1}^{\theta [k]}- a_{(n+m)1}^{\theta [k]} &{} \cdots \\ \vdots &{} \cdots \\ a_{(n+m-1)1}^{\theta [k]}- a_{(n+m)1}^{\theta [k]} &{} \cdots \end{array} \right. \left. \begin{array}{ccc} a_{(n+1)(n-1)}^{\theta [k]}- a_{(n+m)(n-1)}^{\theta [k]} \\ \vdots \\ a_{(n+m-1)(n-1)}^{\theta [k]}- a_{(n+m)(n-1)}^{\theta [k]} \end{array} \right] .\end{aligned}$$

It follows from [26] that \(\{\xi [k], k \in \mathbb {N} \}\) is not a Markov process, but is the joint process \(\{\xi [k], \theta [k], k \in \mathbb {N} \}\). Now the mean-square couple-group consensus problem of multi-agent system in (9) has been converted into the mean-square stability problem of Markov jump system in (10).

Definition 3

The Markov jump system (10) is said to be mean-square stable (MSS) if for any initial condition \(\{\xi _{0}, \theta _{0}\}\), \(\sum _{k=0}^{\infty }\Vert \xi (k)\Vert _{E} < \infty .\)

Now we are in a position to give our main results.

Theorem 3

Under the stochastic switching topologies, the multi-agent system (1) with algorithm (8) can achieve mean-square couple-group consensus if and only if there exist positive definite matrices \(P_{i}\in \mathbb {R}^{(n+m-2)\times (n+m-2)}\) and \(Q_{i}\in \mathbb {R}^{(n+m-2)\times (n+m-2)}\) \((i=1, \ldots , r)\) and scalar \(\gamma \) such that the following LMIs

$$\begin{aligned} \left[ \begin{array}{ll} P_{i} &{} F^{T}_{i} \\ F_{i} &{} Q_{i} \end{array}\right] \succ \mathbf 0 _{2(n+m-2)\times 2(n+m-2)}, \quad i=1, \ldots , r \end{aligned}$$
(11)

hold with the constraints \(\sum _{j=1}^{r}\pi _{ij}P_{j}= Q_{i}^{-1}\) \((i=1,\ldots ,r)\). Here \(F_{i}\) is defined in (10).

Proof

According to the aforementioned discussion, the multi-agent system (1) with algorithm (8) can achieve mean-square couple-group consensus if and only if the error system (10) is mean-square stable. It follows from [26] that system (10) is mean-square stable if and only if there exists a positive definite matrix \(P_{i} \in \mathbb {R}^{(n+m-2)\times (n+m-2)}\) such that

$$\begin{aligned} P_{i}- F_{i}^{T}\sum _{j=1}^{r}\pi _{ij}P_{j}F_{i} \succ \mathbf 0 _{(n+m-2)\times (n+m-2)}. \end{aligned}$$
(12)

From Schur complementary lemma, we know that (12) is equivalent to (11). This completes the proof.

Remark 4

Theorem 3 provides a necessary and sufficient condition for mean-square couple-group consensus of multi-agent system (1) with algorithm (8). It follows from [26] that the condition in (11) is equivalent to \(\rho ((\Pi ^{T} \otimes I_{(n+m-2)^{2}})\cdot \hbox {diag} (F_{1} \otimes F_{1}, \cdots , F_{r} \otimes F_{r})) < 1\). Unfortunately, it is difficult to obtain the relationship between \(\gamma \) and the coefficient matrix. However, \(\gamma \) also can be obtained using CCL method.

Next we give the algorithm based on CCL to compute the feasible \(\gamma \).

Algorithm 2

Step 1. Find a feasible point of LMIs (11) \(\gamma ^{0}, P_{i}^{0}, Q_{i}^{0}\), set \(k=0\). If there are none, exit; Step 2. Find \(\gamma ^{k+1}, P_{i}^{k+1}, Q_{i}^{k+1}\) by solving the convex minimization problem:

$$\begin{aligned} t_{k}&= \hbox {min} \left\{ tr \left( \sum _{i=1}^{r} \left[ \left( \sum _{j=1}^{r} \pi _{ij}P_{j}^{k} \right) Q_{i}\right. \right. \right. \\&\qquad \quad \left. \left. \left. +Q_{i}^{k}\left( \sum _{j=1}^{r} \pi _{ij}P_{j} \right) \right] \right) \right\} \end{aligned}$$

s.t.

$$\begin{aligned}&\left[ \begin{array}{ll} P_{i} &{} F_{i}^{T} \\ F_{i} &{} Q_{i} \end{array}\right] \succ \mathbf 0 _{2(n+m-2)\times 2(n+m-2)},\\&\quad \hbox {and} \quad \left[ \begin{array}{ll} \sum _{j=1}^{r} \pi _{ij}P_{j} &{} I_{n+m-2} \\ I_{n+m-2} &{} Q_{i} \end{array}\right] \succeq \mathbf 0 _{2(n+m-2)\times 2(n+m-2)}; \end{aligned}$$

Step 3. If \(t_{k}= 2r(n+m-2)\), end this algorithm, and the feasible \(\gamma \) is given by \(\gamma = \gamma ^{k+1}\). Otherwise, set \(k=k+1\) and go to step 2.

4 Extensions

In this section, we will extend the previous results, that is, couple-group consensus to multi-group consensus.

4.1 Fixed topology case

Suppose that the topology considered includes \(p\) subgraphs, that is, \(\mathcal {G}= \mathcal {G}_{1} \cup \mathcal {G}_{2} \cup \cdots \cup \mathcal {G}_{p}\). Each subgraph includes \(n_{i}\) nodes, \(i=1, \ldots , p\), \(n_{1}+n_{2}+\cdots +n_{p} =N\). We employ the following discrete-time algorithm:

$$\begin{aligned} u_{i}[k]&= \gamma \left( \sum _{v_{j} \in N_{1,i}}a_{ij}x_{j}[k] + \cdots +\sum _{v_{j} \in N_{k-1,i}}a_{ij}x_{j}[k]\right. \nonumber \\&\left. + \sum _{v_{j} \in N_{k,i}}a_{ij}(x_{j}[k]-x_{i}[k]) \right. \nonumber \\&+ \left. \sum _{v_{j} \in N_{k+1,i}}a_{ij}x_{j}[k]+ \cdots +\sum _{v_{j} \in N_{p,i}}a_{ij}x_{j}[k] \right) ,\nonumber \\&\forall i\in \mathcal {I}_{k}, k= 1, 2, \ldots , p ,\nonumber \\ \end{aligned}$$
(13)

where \(a_{ij} \ge 0\) for all \(i,j \in \mathcal {I}_{k}\), and \(\sum _{j=n_{k-1}-1}^{n_{k}}a_{ij} =0\) for \(k \ne i\).

Denote \(x[k]\triangleq [x_{1}[k], x_{2}[k], \ldots , x_{N}[k]]^{T}\). Similar to couple-group case, we can rewrite (1) with (13) in compact form as follows:

$$\begin{aligned}&x[k+1] \nonumber \\&\quad = \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} I_{n_{1}}-\gamma \mathcal {L}_{1} &{} \gamma \Omega _{12} &{} \cdots &{} \gamma \Omega _{1p} \\ \gamma \Omega _{21} &{} I_{n_{2}}-\gamma \mathcal {L}_{2} &{} \cdots &{} \gamma \Omega _{2p} \\ \cdots &{} \cdots &{} \cdots &{} \cdots \\ \gamma \Omega _{p1} &{} \gamma \Omega _{p2} &{} \cdots &{} I_{n_{p}}-\gamma \mathcal {L}_{p} \end{array}\right] x[k],\nonumber \\ \end{aligned}$$
(14)

where \(\mathcal {L}_{i}\) \((i=1,\ldots , p)\) and \(\Omega _{ij}\) \((i\ne j, i,j = 1, \ldots , p)\) have the similar definitions to that of couple-group case.

Definition 4

[19] The multi-agent system in (14) is said to achieve multi-group consensus asymptotically if the states of agents satisfy \(\lim _{k\rightarrow \infty } \Vert x_{i}[k]- x_{j}[k]\Vert = 0 \), \(\forall i, j \in \mathcal {I}_{l}\), \(\forall l=1, \ldots , p\).

Denote \(m_{1} \triangleq n_{1}, m_{2} \triangleq m_{1} + n_{2}, m_{3} \triangleq m_{2} + n_{3}, \ldots , m_{p} \triangleq m_{p-1} + n_{p} = N\). Let

$$\begin{aligned} z_{1i}&\triangleq x_{i}-x_{m_{1}}, i=1, \ldots , m_{1}-1, \\ z_{2i}&\triangleq x_{i}-x_{m_{2}}, i=m_{1}+1, \ldots , m_{2}-1, \\&\vdots&\\ z_{pi}&\triangleq x_{i}-x_{m_{p}}, i=m_{p-1}+1, \ldots , m_{p}-1, \\ Z&\triangleq [z_{11}, z_{12}, \ldots , z_{pm_{p}-1}]^{T}. \end{aligned}$$

Similarly, we can obtain the error system as follows:

$$\begin{aligned}&Z[k+1] \nonumber \\&\quad = \left[ \begin{array}{cccc} I_{n_{1}-1}-\gamma \mathcal {\widetilde{L}}_{1} &{} \gamma \widetilde{\Omega }_{12} &{} \cdots &{} \gamma \widetilde{\Omega }_{1p} \\ \gamma \widetilde{\Omega }_{21} &{} I_{n_{2}-1}-\gamma \mathcal {\widetilde{L}}_{2} &{} \cdots &{} \gamma \widetilde{\Omega }_{2p} \\ \cdots &{} \cdots &{} \cdots &{} \cdots \\ \gamma \widetilde{\Omega }_{p1} &{} \gamma \widetilde{\Omega }_{p2} &{} \cdots &{} I_{n_{p}-1}-\gamma \mathcal {\widetilde{L}}_{p} \end{array}\right] Z[k] \nonumber \\ \end{aligned}$$
(15)
$$\begin{aligned}&\quad \triangleq H Z[k] \end{aligned}$$
(16)
$$\begin{aligned}&\quad = (I_{N-p}+ \gamma \widetilde{H} )Z[k], \end{aligned}$$
(17)

where

$$\begin{aligned} \widetilde{H} = \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} -\mathcal {\widetilde{L}}_{1} &{} \widetilde{\Omega }_{12} &{} \cdots &{} \widetilde{\Omega }_{1p} \\ \widetilde{\Omega }_{21} &{} -\mathcal {\widetilde{L}}_{2} &{} \cdots &{} \widetilde{\Omega }_{2p} \\ \cdots &{} \cdots &{} \cdots &{} \cdots \\ \widetilde{\Omega }_{p1} &{} \widetilde{\Omega }_{p2} &{} \cdots &{} -\mathcal {\widetilde{L}}_{p} \end{array}\right] \end{aligned}$$

and \(\widetilde{\mathcal {L}}_{i}\) \((i=1,\ldots , p)\), \(\widetilde{\Omega }_{ij}\) \((i\ne j, i,j= 1, \ldots , p)\) have the similar definitions to that of couple-group case.

Similar to the case of couple-group, we provide necessary and sufficient conditions for multi-group consensus in different two forms.

Theorem 4

The multi-agent system (1) with algorithm (13) can achieve multi-group consensus asymptotically if and only if \(\gamma \) satisfies one of the following conditions for each \(i (i=1, \ldots , N-p)\). i) \(0<\gamma < -\frac{2Re(\mu _{i})}{|\mu _{i}|^{2}} (Re(\mu _{i}) <0)\); ii) \(-\frac{2Re(\mu _{i})}{|\mu _{i}|^{2}}<\gamma <0 (Re(\mu _{i}) >0)\), where \(\mu _{i}(i=1, \ldots , N-p)\) is the \(i\)th eigenvalue of \(\widetilde{H}\).

Theorem 5

The multi-agent system (1) with algorithm (13) can achieve multi-group consensus if and only if there exist positive definite matrices \(P\in \mathbb {R}^{(N-p)\times (N-p)}\) and \(Q\in \mathbb {R}^{(N-p)\times (N-p)}\), and scalar \(\gamma \) such that the following LMI

$$\begin{aligned} \left[ \begin{array}{ll} P &{}\quad H^{T} \\ H &{}\quad Q \end{array}\right] \succ \mathbf 0 _{2(N-p)\times 2(N-p)} \end{aligned}$$
(18)

holds with the constraint \(P^{-1} = Q\). Here \(H\) is defined in (17).

Remark 5

The proofs of Theorems 4 and 5 are parallel to those of Theorems 1 and 2, respectively. Hence, they are omitted. Algorithm 1 also can be used to compute the feasible \(\gamma \) for the case of multi-group.

4.2 Stochastic switching topology case

Based on the aforementioned discussion, we consider the following consensus algorithm for multi-group consensus of the multi-agent systems with Markovian switching topologies:

$$\begin{aligned} u_{i}[k]&= \gamma \left( \sum _{v_{j}^{\theta [k]} \in N_{1,i}^{\theta [k]}}a_{ij}^{\theta [k]}x_{j}[k] + \cdots +\sum _{v_{j}^{\theta [k]} \in N_{k-1,i}^{\theta [k]}}a_{ij}^{\theta [k]}x_{j}[k]\right. \nonumber \\&\left. +\sum _{v_{j}^{\theta [k]} \in N_{k,i}^{\theta [k]}}a_{ij}^{\theta [k]}(x_{j}[k]-x_{i}[k]) \right. \nonumber \\&+ \left. \sum _{v_{j}^{\theta [k]} \in N_{k+1,i}^{\theta [k]}}a_{ij}^{\theta [k]}x_{j}[k]\!+\! \cdots +\sum _{v_{j}^{\theta [k]} \in N_{p,i}^{\theta [k]}}a_{ij}^{\theta [k]}x_{j}[k] \right) \!,\nonumber \\&\forall i\in \mathcal {I}_{k}, k= 1, 2, \ldots , p, \nonumber \\ \end{aligned}$$
(19)

where \(a_{ij}^{\theta [k]} \ge 0\) for all \(i,j \in \mathcal {I}_{k}\), and \(\sum _{j=n_{k-1}-1}^{n_{k}}a_{ij}^{\theta [k]} =0\) for \(k \ne i\).

Let

$$\begin{aligned} \xi _{1i}&\triangleq x_{i}-x_{m_{1}}, i=1, \ldots , m_{1}-1, \\ \xi _{2i}&\triangleq x_{i}-x_{m_{2}}, i=m_{1}+1, \ldots , m_{2}-1, \\&\vdots&\\ \xi _{pi}&\triangleq x_{i}-x_{m_{p}}, i=m_{p-1}+1, \ldots , m_{p}-1, \\ \xi&\triangleq [\xi _{11}, \xi _{12}, \ldots , \xi _{pm_{p}-1}]^{T}, \end{aligned}$$

where the definitions of \(m_{i}\) \((i=1,\ldots , p)\) are the same as that of fixed topology. By some deductions, we get the error system as follows:

$$\begin{aligned}&\xi [k+1] \nonumber \\&\quad = \left[ \begin{array}{cccc} I_{n_{1}-1}-\gamma \mathcal {\widetilde{L}}_{1}^{\theta [k]} &{} \gamma \widetilde{\Omega }_{12}^{\theta [k]} &{} \cdots &{} \gamma \widetilde{\Omega }_{1p}^{\theta [k]} \\ \gamma \widetilde{\Omega }_{21}^{\theta [k]} &{} I_{n_{2}-1}-\gamma \mathcal {\widetilde{L}}_{2}^{\theta [k]} &{} \cdots &{} \gamma \widetilde{\Omega }_{2p}^{\theta [k]} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ \gamma \widetilde{\Omega }_{p1}^{\theta [k]} &{} \gamma \widetilde{\Omega }_{p2}^{\theta [k]} &{} \cdots &{} I_{n_{p}-1}-\gamma \mathcal {\widetilde{L}}_{p}^{\theta [k]} \end{array}\right] \xi [k]\nonumber \\ \end{aligned}$$
(20)
$$\begin{aligned}&\quad \triangleq H^{\theta [k]} \xi [k] \end{aligned}$$
(21)
$$\begin{aligned}&\quad =(I_{N-p}+ \gamma \widetilde{H}^{\theta [k]} )\xi [k], \end{aligned}$$
(22)

where

$$\begin{aligned} \widetilde{H}^{\theta [k]} = \left[ \begin{array}{c@{\quad }c@{\quad }c@{\quad }c} -\mathcal {\widetilde{L}}_{1}^{\theta [k]} &{} \widetilde{\Omega }_{12}^{\theta [k]} &{} \cdots &{} \widetilde{\Omega }_{1p}^{\theta [k]} \\ \widetilde{\Omega }_{21}^{\theta [k]} &{} -\mathcal {\widetilde{L}}_{2}^{\theta [k]} &{} \cdots &{} \widetilde{\Omega }_{2p}^{\theta [k]} \\ \vdots &{} \vdots &{} \cdots &{} \vdots \\ \widetilde{\Omega }_{p1}^{\theta [k]} &{} \widetilde{\Omega }_{p2}^{\theta [k]} &{} \cdots &{} -\mathcal {\widetilde{L}}_{p}^{\theta [k]} \end{array}\right] \end{aligned}$$

and \(\widetilde{\mathcal {L}}_{i}^{\theta [k]}\) \((i=1,\ldots , p)\), \(\widetilde{\Omega }_{ij}^{\theta [k]}\) \((i\ne j, i,j= 1, \ldots , p)\) have the similar definitions to that of couple-group case.

Definition 5

The multi-agent system in (1) with algorithm (19) is said to achieve multi-group consensus in mean-square sense if the states of agents satisfy \(\lim _{k\rightarrow \infty } \Vert x_{i}[k]- x_{j}[k]\Vert _{E} = 0 \), \(\forall i, j \in \mathcal {I}_{l}\), \(\forall l=1, \ldots , p\).

Similar to the case of couple-group consensus, we provide here a necessary and sufficient condition for mean-square multi-group consensus in forms of LMI.

Theorem 6

Under the stochastic switching topology, the multi-agent system (1) with algorithm (19) can achieve mean-square multi-group consensus if and only if there exist positive definite matrices \(P_{i}\in \mathbb {R}^{(N-p)\times (N-p)}\) and \(Q_{i}\in \mathbb {R}^{(N-p)\times (N-p)}\) \((i=1, \ldots , r)\) and scalar \(\gamma \) such that the following LMIs

$$\begin{aligned} \left[ \begin{array}{ll} P_{i} &{} H^{T}_{i} \\ H_{i} &{} Q_{i} \end{array}\right] \succ \mathbf 0 _{2(N-p)\times 2(N-p)}, \quad i=1, \ldots , r \end{aligned}$$
(23)

hold with the constraints \(\sum _{j=1}^{r}\pi _{ij}P_{j}= Q_{i}^{-1}\) \((i=1, \ldots , r)\). Here \(H_{i}\) is defined in (22).

Remark 6

The proof of Theorem 6 is similar to that of Theorem 3, and here, it is omitted. Here, algorithm 2 also can be used to compute the allowable \(\gamma \).

5 Simulation results

In this section, we give two examples to show the effectiveness of the proposed results. In the following examples, for simplicity, we let \(a_{ij}= 1\) if \((i,j) \in \mathcal {E}\). In addition, in order to satisfy Assumptions 1 and 3, we suppose that \(a_{ij}\) takes values in a set \(\{-1, 0, 1\}\) for \(v_{i}\), \(v_{j}\) belonging to different node sets, respectively.

Example 1

This is an example for the case of fixed topology. The interaction topology is as shown in Fig. 1, which includes five nodes. It can be seen that the graph \(\mathcal {G}_{0}\) contains two subgraphs \(\mathcal {G}_{1}\) and \(\mathcal {G}_{2}\). Subgraphs \(\mathcal {G}_{1}\) and \(\mathcal {G}_{2}\) have a directed spanning tree, respectively. By solving the minimization problem in Algorithm 1 and using the Matlab LMI toolbox, we get a feasible \(\gamma = 0.3917\), and

$$\begin{aligned} P&= \left[ \begin{array}{l@{\quad }l@{\quad }l} 1.7613 &{} 0.0886 &{} 1.2740 \\ 0.0886 &{} 1.3692 &{} 1.0483 \\ 1.2740 &{} 1.0483 &{} 2.2447 \end{array} \right] , \\ Q&= \left[ \begin{array}{l@{\quad }l@{\quad }l} 1.3391 &{} 0.7707 &{} -1.1199 \\ 0.7707 &{} 1.5804 &{} -1.1754 \\ -1.1199 &{} -1.1754 &{} 1.6300 \end{array} \right] . \end{aligned}$$

Figure 2 shows the consensus results. It can be seen that the agents belonging to \(\mathcal {G}_{1}\) and \(\mathcal {G}_{2}\) achieve two different consistent states, respectively.

Fig. 1
figure 1

\(\mathcal {G}_{0}\)

Fig. 2
figure 2

State trajectories under fixed topology

Example 2

This example is for the case of stochastic switching topology. Suppose that there are two switching topologies, that is, the corresponding Markov chain includes two modes. Let the transition probability matrix be \(\Pi = \left[ \begin{array}{ll} 0.4 &{} 0.6 \\ 0.7 &{} 0.3 \end{array}\right] \). The topologies are as shown in Figs. 3 and 4 . Each of them includes two subgraphs. It can be seen that \(\mathcal {G}_{ij} (i,j= 1,2)\) do not have a directed spanning tree, while the unions of \(\mathcal {G}_{11}\) and \(\mathcal {G}_{21}\), and \(\mathcal {G}_{12}\) and \(\mathcal {G}_{22}\) contain a directed spanning tree, respectively. Using Algorithm 2 and Matlab LMI toolbox, we obatain a feasible \(\gamma = 0.5250\) and

$$\begin{aligned} P_{1}&= \left[ \begin{array}{l@{\quad }l@{\quad }l} 1.7613 &{} 0.0886 &{} 1.2740 \\ 0.0886 &{} 1.3692 &{} 1.0483 \\ 1.2740 &{} 1.0483 &{} 2.2447 \end{array} \right] ,\\ P_{2}&= \left[ \begin{array}{l@{\quad }l@{\quad }l} 1.3391 &{} 0.7707 &{} -1.1199 \\ 0.7707 &{} 1.5804 &{} -1.1754 \\ -1.1199 &{} -1.1754 &{} 1.6300 \end{array} \right] , \\ Q_{1}&= \left[ \begin{array}{l@{\quad }l@{\quad }l} 1.7613 &{} 0.0886 &{} 1.2740 \\ 0.0886 &{} 1.3692 &{} 1.0483 \\ 1.2740 &{} 1.0483 &{} 2.2447 \end{array} \right] , \nonumber \\ Q_{2}&= \left[ \begin{array}{l@{\quad }l@{\quad }l} 1.3391 &{} 0.7707 &{} -1.1199 \\ 0.7707 &{} 1.5804 &{} -1.1754 \\ -1.1199 &{} -1.1754 &{} 1.6300 \end{array} \right] . \end{aligned}$$

Figure 5 shows that the agents belonging to \(G_{11}\), namely, \(\{v_{1}, v_{2}, v_{3}\}\) and \(G_{12}\), namely, \(\{v_{4}, v_{5}, v_{6}\}\) achieve two different consistent states.

Fig. 3
figure 3

\(\mathcal {G}_{1}\)

Fig. 4
figure 4

\(\mathcal {G}_{2}\)

Fig. 5
figure 5

State trajectories under switching topology

6 Conclusion

In this paper, the group consensus problems have been considered for discrete-time multi-agent systems with a fixed topology and stochastic switching topologies. The discrete-time consensus algorithms have been provided, under which the agents belonging to different subgraphs can achieve different consistent states. Some necessary and sufficient conditions based on matrix theory and linear system theory have been obtained for (mean-square) couple-group consensus. Similar conditions have been obtained for (mean-square) multi-group consensus. The algorithms based on CCL have been provided to compute the allowable control gains. Simulation examples have been given to show the effectiveness of the theoretical results.