This paper considers a strongly connected network of agents, each capable of partially observing and controlling a discrete-time linear time-invariant (LTI) system that is jointly observable and controllable.
Additionally, agents collaborate to achieve a shared estimated state, computed as the average of their local state estimates. Recent studies suggest that increasing the number of average consensus steps between state estimation updates allows agents to choose from a wider range of state feedback controllers, thereby potentially enhancing control performance.
However, such approaches require that agents know the input matrices of all other nodes, and the selection of control gains is, in general, centralized.
Motivated by the limitations of such approaches,  we propose a new technique where: (i) estimation and control gain design is fully distributed and finite-time, and (ii) agent coordination involves a finite-time exact average consensus algorithm, allowing arbitrary selection of estimation convergence rate despite the estimator's distributed nature. We verify our methodology's effectiveness using illustrative numerical simulations.

Distributed Estimation, Distributed Control, Distributed Gain Design, LTI Systems, Finite-time Agreement

§ INTRODUCTION

In the last decades, several works in the literature focused on solving the distributed estimation and control problem, mainly relying on the development of linear observers <cit.>.

In <cit.>, the authors establish the necessary conditions for observability in the dependence of the plant model and the underlying communication graph, while in <cit.> the existence of a distributed observer is guaranteed under the detectability and connectivity conditions.
In <cit.>, a state-augmented observer is proposed, and necessary and sufficient conditions for their stabilizability are derived.
More recently, in <cit.>, Kalman's canonical observational decomposition to a multi-sensor environment is introduced.

Comparison of this work against the state of the art.

Approach     Discrete    Consensus     Selection of      Selection of

Time    Consensus     Estimation Gains      Control Gains

<cit.> - 2016
uncoordinated     n/a

<cit.> - 2017            centralized     n/a

<cit.> - 2019             uncoordinated     n/a

<cit.> - 2019             uncoordinated     n/a

<cit.> - 2019         asymptotic     uncoordinated     n/a

<cit.> - 2020

<cit.> - 2022        asymptotic     centralized     uncoordinated

This work         finite-time     coordinated     coordinated

Although all the aforementioned works provided suitable solutions to the distributed estimation problem, none of them was able to directly control the convergence rate. This issue is overcome in <cit.>, which developed the idea of the observability decomposition for the construction of a decomposed diffusive coupling. Specifically, in <cit.> the authors exploit linear matrix inequality (LMI) techniques to compute the observer gains, while in <cit.> the distributed observer design is improved by eliminating the dependence on the communication topology among the observers.

In <cit.>, the estimation error of discrete-time, jointly observable LTI system whose observations are distributed across a time-varying network, converges exponentially fast to zero at a fixed but arbitrarily chosen rate, assuming that the graph is strongly connected. Specifically, the agents are allowed to perform a given number of rounds of distributed agreement in between state updates.
The continuous-time counterpart was presented in <cit.>.

In <cit.>, the authors proposed a distributed observer-based control system where each agent can independently adjust the controlled output to any desired set point value for a continuous-time system. However, although the solutions presented in <cit.> succeed in the convergence rate assignment and can be implemented in a distributed manner, they all always require a degree of centralized coordination for the design of the estimation gains.
In Table <ref>, we analyze the significant aspects of distributed gains design shown by the aforementioned works.
Interestingly, only the approaches in <cit.> and in this paper also account for the control of the system, while all other approaches only focus on state estimation. Indeed, our approach is the only one that allows selecting the local controller gains.

In contrast to these approaches, in our paper, we aim to develop a strategy where agents' local estimation and control gains are designed and executed in a fully distributed manner.
In particular, we took inspiration from <cit.>, in which a distributed estimation and control scheme for LTI systems is developed whereby agents are allowed to perform a given number of asymptotic average consensus iterations between successive time updates.
Additionally, the authors show how the frequency of information exchange between neighboring agents (consensus steps) affects the performance of the system since it affects the set of admissible controllers. Note that, also in this case, the control and estimation gains are known a priori to the agents (they are computed during a centralized design phase).

The main contributions of this work, which address the aforementioned limitations, are: (i) a novel fully distributed method for designing estimation and control gains through coordination, which unlike other approaches, enables self-configuration and resilience to node failures in multi-agent systems;
(ii) an exact finite-time average consensus mechanism (of precomputed required iterations) between estimation steps for precise eigenvalue placement, ensuring estimation error convergence to zero, offering stability guarantees which are not provided by other asymptotic methods where the consensus iterations may be insufficient.
These innovations set our approach apart, particularly in coordinated estimation and control gain selection, and in providing stability assurances. Our simulations demonstrate enhanced stability and performance in communication and computation time and rounds.

§ PRELIMINARIES

§.§ Notation and Graph Theory

We denote vectors with boldface lowercase letters and matrices with uppercase letters. The transpose of matrix $A$ and vector $\mathbf{x}$ are denoted as $A^\top$, $x^\top$, respectively.  We refer to the  entry of a matrix $A$ by $A_{ij}$.
We represent by ${\bm 0}_n$ and ${\bm 1}_n$ vectors with $n$ entries, all equal to zero and to one, respectively.
We use  $\|\cdot\|$ to denote the Euclidean norm.

Let $\mathcal{G}=\{\mathcal{V},\mathcal{E}\}$ be a directed graph (digraph) with $N$ nodes  and $e$ edges $\mathcal{E}\subseteq \mathcal{V}\times \mathcal{V}$, where $(v_i,v_j)\in \mathcal{E}$ captures the existence of a link from node $v_i$ to node $v_j$.

A directed graph is strongly connected if each node can be reached by every other node via the edges, respecting their orientation.
Let the in-neighborhood $\mathcal{N}^{\texttt{in}}_i$ of a node $v_i\in\mathcal{V}$ be the set of nodes $v_j\in\mathcal{V}$ such that $(v_j,v_i)\in \mathcal{E}$; similarly, the out-neighborhood $\mathcal{N}^{\texttt{out}}_i$ of a node $v_i\in\mathcal{V}$ is the set of nodes $v_j\in\mathcal{V}$ such that $(v_i,v_j)\in \mathcal{E}$. In the case $\mathcal{N}^{\texttt{in}}_i$ is equal to $\mathcal{N}^{\texttt{out}}_i$ the graph is said to be undirected and the neighborhood of a node $v_i\in\mathcal{V}$ is expressed with $\mathcal{N}_i$.
The in-degree $d_i^{\texttt{in}}$ of a node $v_i$ is the number of its incoming edges, ;  similarly, the out-degree $d_i^{\texttt{out}}$ of a node $v_i$ is the number of its outgoing edges, .

§.§ Average (Minimum-Time) Consensus in Directed Graphs

The problem of average consensus over digraphs involves a number of nodes in a network represented by a graph $\set{G}$, that exchange information to compute the network-wide average of their initial values.

We consider a synchronous setting in which each
node $v_j$ updates and sends its information to its neighbors at discrete times $t_{0}, t_{1}, t_{2}, \ldots$ (herein called consensus iterations). We use ${\bm \alpha}_j[m] \in \mathbb{R}^n$ to denote the information state of node $v_j$ at time $t_m$. We index nodes' information states and any other information at time $t_m$ by $m$. At each consensus iteration $m$, each node $v_j$ maintains its information state ${\bm \alpha}_j[m] \in \mathbb{R}^n$ (initialized at a certain value, a measurement, say ${\bm \alpha}_j[0]={\bm \theta}_j$), an auxiliary scalar variable $\pi_j[m] \in \mathbb{R}_+$ (initialized at $\pi_j[0]=1$), and ${\bm \mu}_j[m]:={\bm \alpha}_j[m]/\pi_j[m]$. The authors in <cit.> showed that the nodes in an unbalanced digraph can asymptotically reach the exact average consensus by having each node $v_j \in \set{V}$ to iteratively communicate and update its values according to the so called ratio consensus algorithm:

\begin{align}
{\bm \alpha}_j[m+1] &= p_{jj} {\bm \alpha}_j[m] + \sum_{v_i\in \inneighbor{j}} p_{ji} {\bm \alpha}_i[m], \label{eq:auxiliary_x} \\
\pi_j[m+1] &= p_{jj} \pi_j[m] + \sum_{v_i\in \inneighbor{j}} p_{ji} \pi_i[m],\label{eq:auxiliary_y}
\end{align}

where $p_{lj}$ is a nonnegative weight assigned to outgoing information by each agent $v_j$ as $p_{lj}=1/(1+\outdegree{j})$ if $v_l \in \outneighbor{j} \cup \{v_j\}$, otherwise $p_{lj}=0$. The weights assigned based on this strategy form a column-stochastic matrix $P=\{p_{ji}\} \in \mathbb{R}_{+}^{N \times N}$ in which (possible) zero-valued entries, $p_{ji}=0$, denote the absence of a (directed) link $(v_j,v_i)$.

Then, the solution to the average consensus problem can be asymptotically obtained. In particular, we have that <cit.>

\lim _{m \rightarrow \infty} {\bm \mu}_j[m]=\frac{\sum_{v_j \in \mathcal{V}} {\bm \alpha}_j[0]}{\sum_{v_j \in \mathcal{V}} \pi_j[0]}=\frac{\sum_{v_j \in \mathcal{V}} {\bm \theta}_j}{N},~ \forall v_j \in \mathcal{V}.

The results in <cit.> have shown that the exact average ${\bm \mu}$ can be distributively obtained in a finite and minimum number of steps in strongly connected digraphs. The results are based on the use of the concept of the minimal polynomial associated with the linear dynamics of each of (<ref>) and (<ref>), in conjunction with the final value theorem, initially proposed for undirected graphs in <cit.>.

Since the update of each element $r$, $r\leq n$, of the information state of node $v_j$ at time instant $m$, denoted by ${\alpha}_{jr}[m] \in \mathbb{R}$, is independent of the update of all the other elements, we will explain how the minimum-time average consensus works for a scalar information state, for simplicity.

Consider the vectors of the differences between $2m+1$ successive discrete-time values at node $v_j$

$\overline{\alpha}^{\top}_{2m} = (\overline{\alpha}_{jr}[0], \overline{\alpha}_{jr}[1], \ldots, \overline{\alpha}_{jr}[2m] )$ and
$\overline{\pi}^{\top}_{2m} = (\overline{\pi}_j[0], \overline{\pi}_j[1], \ldots, \overline{\pi}_j[2m] )$,

where $\overline{\alpha}_{jr}[l] = {\alpha}_{jr}[l+1]-{\alpha}_{jr}[l]$, and $\overline{\pi}_{j}[l] = {\pi}_j[l+1]-{\pi}_j[l]$ for $l=0,\ldots,2m$.

Then, each agent $v_j$ constructs the Hankel matrices $\Gamma\{\overline{\alpha}^{\top}_{2m}\}$ and $\Gamma\{\overline{\pi}^{\top}_{2m}\}$. The construction for $\Gamma\{\overline{\alpha}^{\top}_{2m}\}$ (and respectively for $\Gamma\{\overline{\pi}^{\top}_{2m}\}$) is as follows:

\begin{align*}
\Gamma\{\overline{\alpha}^{\top}_{2m}\} \triangleq
\begin{bmatrix}
\overline{\alpha}_{jr}[0] & \overline{\alpha}_{jr}[1] & \ldots & \overline{\alpha}_{jr}[m] \\
\overline{\alpha}_{jr}[1] & \overline{\alpha}_{jr}[2] & \ldots & \overline{\alpha}_{jr}[m+1] \\
\vdots & \vdots & \ddots & \vdots \\
\overline{\alpha}_{jr}[m] & \overline{\alpha}_{jr}[m+1] & \ldots & \overline{\alpha}_{jr}[2m]
\end{bmatrix}.
\end{align*}

It has been shown in <cit.> that after $2(M_j +1)$ the kernel of the Hankel matrices $\Gamma\{\overline{\alpha}^{\top}_{2m}\}$ and $\Gamma\{\overline{\pi}^{\top}_{2m}\}$ for arbitrary initial conditions ${\bm \alpha}[0]$ and ${\bm \pi}[0]$ except a set of initial conditions with Lebesgue measure zero

become defective. Once they become defective, node $v_j$ computes $M_j$ among others and has all the information needed to compute the final value of the overall system and, hence, compute the exact average in a finite number of steps.
For more details, see <cit.>.

§.§ Distributed Termination and Synchronization

In <cit.> a distributed termination mechanism is proposed to enhance an existing finite-time distributed algorithm to allow the nodes to agree on when to terminate their iterations, provided they have all computed their exact average. Specifically, their proposed method is based on the fact that the finite-time consensus algorithm in <cit.> allows nodes in the network running iterations (<ref>) and (<ref>) to compute an upper bound of their eccentricity[The eccentricity of a node $v_j \in \set{V}$ is the length of the maximum distance between $v_j$ and any other node $v_i \in \set{V}$.] and use this information for deciding when to terminate the process. The procedure is as follows:

* Once iterations (<ref>) and (<ref>) are initiated, each node $v_j$ also initiates two counters $c_j$, $c_j[0]=0$, and $r_j$, $r_j[0]=0$. Counter $c_j$ increments by one at every time step, $c_j[m+1]= c_j[m]+1$. Counter $r_j$ updates are described next.

* Alongside iterations (<ref>) and (<ref>) a $\max$-consensus algorithm <cit.> is initiated as well, given by

\begin{align}\label{eq:maxconsensus}
\phi_j[m+1] = \max_{v_i \in \inneighbor{j} \cup \{v_j\}}\big\{ \max\{\phi_i[m],c_i[m]\} \big\},
\end{align}

with $\phi_j[0]=0$. Every time step $m$ for which $\phi_j[m+1]={\phi}_j[m]$, $r_j$ increments by one, but if, however, at any step $m'$, $\phi_j[m'+1] \neq \phi_j[m']$, then $r_j$ is set to zero,
\begin{align}\label{eq:rj}
\begin{cases}
0, & \text{if } \phi_j[m+1] \neq \phi_j[m], \\
r_j[m]+1, & \text{otherwise}.
\end{cases}
\end{align}

* Once the square Hankel matrices $\Gamma\{\overline{\alpha}^{\top}_{M_j}\}$ and $\Gamma\{\overline{\pi}^{\top}_{M_j}\}$ for node $v_j$ lose rank, node $v_j$ saves the count of the counter $c_j$ at that time step, denoted by $m^o_j$, as $c^o_j$, $c^o_j\triangleq c_j[m^o_j]$, and it stops incrementing the counter, $\forall m'\geq m^o_j, c[m']=c_j[m^o_j]=c^o_j$. Note that $c^o_j=2(M_j+1)$.

* Node $v_j$ terminates (<ref>) and (<ref>) when $r_j$ reaches $c^o_j$.

The main idea of this approach is that $2(M_j +1)$ serves as an upper bound on the maximum distance of any other node to node $v_j$. This quantity is not known initially but becomes known to node $v_j$ through the finite-time consensus algorithm <cit.>. Therefore, the algorithm in <cit.> is used for computing distributively the number of steps of the consensus iterations $\overline{m}$ needed by all nodes to complete the finite-time consensus; specifically, we have

Hence, after $\overline{m}$ steps, each node can terminate the iterations.

Note that, as a byproduct of the distributed termination mechanism, an upper bound on the diameter of the network, $D^{\prime}=\max_{v_j\in \mathcal{N}} M_j$, can be acquired once a node has completed the execution of the termination mechanism.

The proposed finite-time exact ratio consensus algorithm executes the iterations in (<ref>) and computes the differences between $2m+1$ successive values of ${\bm \alpha}_j[m]$ and $\pi_j[m]$ as

\begin{align}
\overline{\bm \alpha}_{j}[l] &= {\bm \alpha}_j[l+1]-{\bm \alpha}_j[l], \quad \text{for~} l=0,\ldots,2m \nonumber\\
\overline{\pi}_{j}[l] &= {\pi}_j[l+1]-{\pi}_j[l], \quad \text{for~} l=0,\ldots,2m \nonumber
\end{align}

Then, each agent $v_j$ constructs the Hankel matrices $\Gamma\{\overline{\bm \alpha}_{j}\}$ and $\Gamma\{\overline{\pi}_{j}\}$, in which the elements along each anti-diagonal are equal. The Hankel matrix for $\Gamma\{\overline{\bm \alpha}_{j}\}$ (respectively for $\Gamma\{\overline{\pi}_{j}\}$) is constructed as follows

\setlength\arraycolsep{2pt}
\Gamma\{\overline{\bm \alpha}_{j}\} \triangleq\left[\begin{array}{cccc}
\overline{\bm \alpha}_{j}[0] & \overline{\bm \alpha}_{j}[1] & \ldots & \overline{\bm \alpha}_{j}[m] \\
\overline{\bm \alpha}_{j}[1] & \overline{\bm \alpha}_{j}[2] & \ldots & \overline{\bm \alpha}_{j}[m+1] \\
\vdots & \vdots & \ddots & \vdots \\
\overline{\bm \alpha}_{j}[m] & \overline{\bm \alpha}_{j}[m+1] & \ldots & \overline{\bm \alpha}_{j}[2m]
\end{array}\right].

At each consensus iteration $m$, the rank of each Hankel matrix is examined at each node $v_j$, and as soon as the matrix becomes singular, its kernel $\boldsymbol{\beta}_j=\left(\beta_0, \ldots, \beta_{M_j-1}, 1\right)^{\top}$ can be used, along with the variables

\begin{align*}
{\bm \alpha}_{M_j}^{\top} &\triangleq \left(
{\bm \alpha}_{j}[0],{\bm \alpha}_{j}[1],\ldots,{\bm \alpha}_{j}[M_j]\right),\\
{\bm \pi}_{M_j}^{\top} &\triangleq \left(
\end{align*}

to compute the exact average consensus value:

\begin{align}\label{eq:fterc}
{\bm \mu}_j \triangleq \lim _{m \rightarrow \infty} \frac{{\bm \alpha}_j[m]}{{\pi}_j[m]}=\frac{{\bm \alpha}_{M_j}^{\top} \boldsymbol{\beta}_j}{{\bm \pi}_{M_j}^{\top} \boldsymbol{\beta}_j},
\end{align}

where $M_j$ denotes the degree of the minimal polynomial associated with the matrix pair $\left[P, e_j^{\top}\right]$, and $e_j^{\top} \in \mathbb{R}^{1 \times n}$ with its $j$-th element being 1, and others 0 (see <cit.> for more information). Furthermore, after the first round of finite-time consensus, each node $v_j$ computes $M_j$, which is later used in defining for computing distributively the number of steps of the consensus iterations $\overline{m}$ needed to complete the finite-time consensus; specifically, $\overline{m}$ is given by <cit.>
\begin{align}
\overline{m} = 2\max_{v_j\in \mathcal{N}} \{2(M_j+1)\} -1.
\end{align}

§ PROBLEM STATEMENT

The problem considered in this paper is based on the setup used in <cit.> in which a network of agents aim at estimating and controlling a discrete-time LTI system, characterized by

\begin{equation}
\label{eq:sysdyn}
\begin{cases}
{\bm x}[k+1]=A{\bm x}[k]+\sum_{j=1}^N B_j{\bm u}_j[k], ~ {\bm x}[0]\in \mathbb{R}^n , \\
{\bm y}_i[k]=C_i{\bm x}[k],\quad \forall v_i\in \mathcal{V},
\end{cases}
\end{equation}

where $A\in\mathbb{R}^{n\times n}$, $B_j\in\mathbb{R}^{n\times q_j}$, $C_i\in\mathbb{R}^{p_i\times n}$, ${\bm x}[k]\in\mathbb{R}^n$ is the state vector, and ${\bm u}_j[k]\in\mathbb{R}^{q_j}, {\bm y}_i[k]\in\mathbb{R}^{p_i}$ are, respectively, the $j-$th control input and the $i-$th system output at discrete times $t_k$ (information states and any other information at time $t_k$ is indexed by $k$), herein called estimation-control iterations.

Let us consider $q=\sum_{i=1}^N q_i$, $p=\sum_{i=1}^N p_i,$ and let us define
B_1, \dots, B_N
\end{bmatrix}\in\mathbb{R}^{n\times q}$

In the remainder of the paper, we make the following assumption.

The system in Eq. (<ref>) is jointly controllable and jointly observable, the pair $(A,B)$ is controllable and the pair $(A,C)$ is observable.

Assumption <ref> not only implies that each agent can only partially observe the LTI system output and only partially control the LTI system state, but that there exist controllers and observers such that the system is stable and the estimation error converges to zero. Hence, even though each agent might not be able to fully control or observe the system on its own, all the nodes can do so collaboratively by exchanging information over the strongly connected graph $\mathcal{G}$.

The problem is to design the estimation dynamics and feedback
control law for each agent, given its own set of information,
so that jointly the agents stabilize the LTI system. Towards this end, Savas et al. <cit.> proposed a distributed state estimation scheme with the following structure:

\begin{align}
\label{eq:estimation}
\hat{\bm x}_i[k+1]=&A\tilde{\bm x}_i[k]+L_i({\bm y}_i[k]-C_i\tilde{\bm x}_i[k])\\
&+\sum_{j=1}^N B_jK_j\tilde{\bm x}_i[k]+\sum_{j\in\mathcal{N}_i} W_{ij}(\tilde{\bm x}_j[k]-\tilde{\bm x}_i[k]), \nonumber
\end{align}

where $\tilde{\bm x}_i[k]$ is the result of $m$-steps of consensus over the graph topology, using the state estimates $\hat{\bm x}_i[k]$ as the initial conditions; $L_i\in\mathbb{R}^{n\times p_i}$, $W_{ij}\in\mathbb{R}^{n\times n}$ are suitable gains that make the estimation error dynamics asymptotically stable, while the control input is chosen to be in the form
${\bm u}_i=K_i\tilde{\bm x}_i[k],$ with $K_i\in\mathbb{R}^{q_i\times n}$.

Note that in <cit.> matrices $K_i$ are designed offline, in a centralized fashion, so that  $A+\sum_{i=1}^N B_i K_i$ is Schur stable.

Moreover, the authors consider a scenario where the agents are able to run a certain number $m$ of consensus iterations via a linear consensus algorithm for balanced graphs on their estimated states, between two consecutive estimation-control iterations.
Specifically, in <cit.> it is shown that, for sufficiently large $m$, there are gains $L_i, W_{ij}$ which stabilize the overall control and estimation process (there is a separation between estimation and control).

In this paper, we assume that the agents execute, instead, a  finite-time consensus procedure (as described in Sections <ref> and <ref>), between consecutive estimation-control iterations.

Under this assumption, we show that the distributed state estimation process is simplified, enabling the agents to arbitrarily place the eigenvalues for the estimation error dynamics, but also allowing for a larger set of controllers, if implemented under the framework of <cit.>.
Given the existence of this set of controllers, we develop an initialization procedure that allows the agents to coordinate in order to choose appropriate gains $K_i$ and $L_i$ in a completely distributed way and in finite time.

§ FINITE-TIME AVERAGE CONSENSUS AS AN ENABLER FOR DISTRIBUTED ESTIMATION AND CONTROL

In this section, we propose the adoption of the finite-time exact ratio consensus iterations discussed in Section <ref>, which operate in between two successive estimation-control time steps as shown in Fig. <ref>. Under this scheme, the local state estimate $\hat{{\bm x}}_i[k]$ of each node $v_i$ is fed into the consensus protocol that exchanges this information with its neighboring nodes, as detailed in Sections <ref> and <ref>.

Under Assumption <ref>, after of at most $\overline{m}$ consensus iterations, each node $v_i$ has terminated the finite-time consensus procedure, and computed the average of the network-wide state estimate in $M_i$ consensus iterations. Hence, each node $v_i$ at time step $k$ knows the common state estimate that is the average of the network-wide state estimate, $\overline{\bm x}[k]$, $\overline{\bm x}[k]=\frac{1}{N}\sum_{l=1}^N \hat{\bm x}_l[k].$

At least $\overline{m}$ consensus steps can be completed between two successive estimation-control time steps.

[>=stealth, thick,
shorten >=3pt,
shorten <=3pt,

on grid,

ultra thin/.style= line width=0.1pt,
very thin/.style=  line width=0.2pt,
thin/.style=       line width=0.4pt,
semithick/.style=  line width=0.6pt,
thick/.style=      line width=0.8pt,
very thick/.style= line width=1.6pt,
ultra thick/.style=line width=2pt

node distance = 3cm and 2cm
invincible/.style=draw=none, thin, circle, fill=none, minimum size=0
main/.style=draw=black, thick, draw, circle, fill=gray!20, minimum size=0.6cm
label/.style=draw=none, circle, fill=none, minimum size=0.8cm
edge/.style =draw=black, thick, ->,> = latex'

[invincible] (0) at (0,0) ;

[-] +(-0.1,0) edge[very thick] +(1.5,0);
[-] +(1.4,0) edge[very thick, densely dashed] +(2.1,0);
[-] +(2,0) edge[very thick] +(4,0);
[-] +(3.9,0) edge[very thick, densely dashed] +(4.6,0);
[-] +(4.5,0) edge[very thick] +(6.5,0);
[arrows=-Latex[width=9pt, length=9pt]] +(6.4,0) edge[very thick,densely dashed] +(7.3,0);

[-] +(0,0.35) edge[ultra thick,DarkRed!70] +(0,-0.35);
[-] +(0.5,0.25) edge[very thick,blue!70] +(0.5,-0.25);
[-] +(1,0.25) edge[very thick,blue!70] +(1,-0.25);

[-] +(2.5,0.25) edge[very thick,blue!70] +(2.5,-0.25);
[-] +(3,0.35) edge[ultra thick,DarkRed!70] +(3,-0.35);
[-] +(3.5,0.25) edge[very thick,blue!70] +(3.5,-0.25);

[-] +(5,0.25) edge[very thick,blue!70] +(5,-0.25);
[-] +(5.5,0.35) edge[ultra thick,DarkRed!70] +(5.5,-0.35);
[-] +(6,0.25) edge[very thick,blue!70] +(6,-0.25);

[-] +(0,0.6) edge[densely dotted,thick,blue!50] +(0,0.2);
[-] +(1,0.6) edge[densely dotted,thick,blue!50] +(1,0.1);
[-] +(2.5,0.6) edge[densely dotted,thick,blue!50] +(2.5,0.1);
[-] +(5,0.6) edge[densely dotted,thick,blue!50] +(5,0.1);

[-] +(0,-0.6) edge[densely dotted,thick,DarkRed!50] +(0,-0.2);
[-] +(3,-0.6) edge[densely dotted,thick,DarkRed!50] +(3,-0.2);
[-] +(5.5,-0.6) edge[densely dotted,thick,DarkRed!50] +(5.5,-0.2);

[label] at (-0.05,0.7) $m=0$;
[label] at (0.95,0.7) $m=2$;
[label] at (2.5,0.7) $m=\bar{m}$;
[label] at (5,0.7) $m=\bar{m}$;

[label] at (2.5,1) $\overline{\bm{x}}[0]$;

[label] at (5,1) $\overline{\bm{x}}[1]$;

[label] at (0,-0.7) $\hat{\bm{x}}_l[k\!=\!0]$;
[label] at (3,-0.7) $\hat{\bm{x}}_l[k\!=\!1]$;
[label] at (5.5,-0.7) $\hat{\bm{x}}_l[k\!=\!2]$;

[label] at (7.75,0.05) time;

Finite-time average consensus iterations $m$ (blue ticks) within distributed estimation and control iterations $k$ (red ticks).

Notice that, due to such a procedure, the agents are able to reach an agreement on the estimate $\overline{\bm x}[k]$ of the state at time $k$; as a result, the systems' dynamics can be equivalently modeled as

\begin{equation}
\label{eq:pippo}
{\bm x}[k+1]=A{\bm x}[k]+\sum_{j=1}^N B_j K_j \overline{\bm x}[k]
\end{equation}

while since $\hat{\bm x}_i[k]-\hat{\bm x}_j[k]=\overline{\bm x}[k]-\overline{\bm x}[k]={\bm 0}_n$, the local estimator in Eq. (<ref>) reduces to

\begin{align}\label{eq:estimationfinite}
\hat{\bm x}_i[k+1]=&A\overline{\bm x}[k]+L_i\left({\bm y}_i[k]-C_i\overline{\bm x}[k]\right)+\sum_{j=1}^N B_jK_j\overline{\bm x}[k].\nonumber
\end{align}

We define the estimation error for the $i$-th agent as

and the average estimation error

\overline{\bm e}[k]=\frac{1}{N}\sum_{l=1}^N{\bm e}_i[k]=\frac{1}{N}\sum_{l=1}^N ({\bm x}[k]-\hat{\bm x}_l[k])={\bm x}[k]-\overline{\bm x}[k].

An instance of our proposed distributed estimation and control scheme (which extends the approach in <cit.>) for the problem in Section III, considering a simple network, is shown in Fig. <ref>.
In particular, the operations undertaken by each node $v_i$ in-between state updates essentially amount to an estimation task (represented by the symbol $\texttt{E}_i$ in the figure), a finite-time agreement task (represented by the symbol $\texttt{A}_i$) and a control task (represented by the symbol $\texttt{C}_i$). The figure shows the relations among such tasks for each node.
Interestingly, as discussed next, the nodes, besides being coupled by the physical process, directly interact by exchanging information only within the finite-time agreement task, while the estimation and control tasks are performed locally, based on the agreed-upon estimate computed during the finite-time agreement procedures.

[auto, thick, node distance=1cm, >=triangle 45]

block/.style    = draw, rectangle,rounded corners=5, densely dotted, minimum height = 2.3em, minimum width = 3em,
component/.style = draw,rounded corners, thick, rectangle, minimum height = 1.9em, minimum width = 2em,
sum/.style      = draw, circle, node distance = 2cm,

node at (0,-1.75) [component,rotate=90,minimum height=0.8cm,text width=1.3cm,align=center,fill=black!5] (system) LTI System
node at (4,-0.5) [block,fill=blue!2,minimum width=5cm,minimum height=1.7cm] (v1)
node at (4,-3) [block,fill=red!2,minimum width=5cm,minimum height=1.7cm] (vN)
node at (4,-1.75) [block,fill=green!2,minimum width=1cm,minimum height=3.5cm] (consensus)

node at (2.2,-3) [component,fill=red!8] (CN) $\texttt{C}_N$
node at (4,-3) [component,fill=red!8] (AN) $\texttt{A}_N$
node at (5.7,-3) [component,fill=red!8] (EN) $\texttt{E}_N$;

[->] (EN) -> node[xshift=5, yshift=0.2] $\hat{x}_N$ (AN);
[->] (AN) -> node[xshift=0, yshift=0.2] $\overline{x}$ (CN);
[-] (CN) – node[below] $u_N$ (0.1,-3);
[->] (0.1,-3) – node[]  (0.1,-2.52);

[-] (3.4,-3) – node[]  (3.4,-3.7);
[-] (3.4,-3.7) – node[]  (5.7,-3.7);
[<-] (EN) – node[]  (5.7,-3.7);

node at (2.2,-0.5) [component,fill=blue!8] (C1) $\texttt{C}_1$
node at (4,-0.5) [component,fill=blue!8] (A1) $\texttt{A}_1$
node at (5.7,-0.5) [component,fill=blue!8] (E1) $\texttt{E}_1$;

[->] (E1) -> node[xshift=5, yshift=-0.1] $\hat{x}_1$ (A1);
[->] (A1) -> node[xshift=0, yshift=-0.1] $\overline{x}$ (C1);
[-] (C1) – node[above] $u_1$ (0.1,-0.5);
[->] (0.1,-0.5) – node[]  (0.1,-0.98);

[-] (3.4,-0.5) – node[]  (3.4,0.2);
[-] (3.4,0.2) – node[]  (5.7,0.2);
[<-] (E1) – node[]  (5.7,0.2);

[-] (-0.1,0.5) – node[]  (7,0.5);
[-] (7,-0.5) – node[]  (7,0.5);
[->] (7,-0.5) – node[xshift=8, yshift=0.2] $y_1$ (E1);
[-] (-0.1,-0.99) – node[]  (-0.1,0.5);

[-] (-0.1,-4) – node[]  (7,-4);
[-] (7,-3) – node[]  (7,-4);
[->] (7,-3) – node[xshift=8, yshift=13.5] $y_N$ (EN);
[-] (-0.1,-2.51) – node[]  (-0.1,-4);

[->] (A1) edge[bend left=10,dashed] node[]  (AN);
[->] (AN) edge[bend left=10,dashed] node[]  (A1);

node[] at (2.25,-1.65) $\vdots$;
node[] at (5.75,-1.65) $\vdots$;

node[] at (2.25,0.15) node $v_1$;
node[] at (2.25,-2.35) node $v_N$;

Proposed distributed estimation and control scheme.

In the next theorem, we show that finite-time consensus in-between estimation steps, allows arbitrary eigenvalue selection for the error dynamics[Even if the agents execute finite-time average consensus in-between estimation steps, the overall estimation process converges asymptotically.].

Let Assumption <ref> hold. Then, the local estimation errors, ${\bm e}_i[k]$, can be brought to zero asymptotically, by selecting suitable gain matrices $L_i$ that assign arbitrary eigenvalues to
$A-\frac{1}{N}\sum_{l=1}^N L_lC_l$.

In order to prove the result, we observe that the dynamics of the network-wide average estimation error are described by

\begin{aligned}
&\overline{\bm e}[k+1]\!=\!\frac{1}{N}\!\sum_{l=1}^N\!({\bm x}[k+1]\!-\!\hat{\bm x}_l[k+1])\!=\!{\bm x}[k+1]\!-\!\overline{\bm x}[k+1]\!\!\\
\left(A{\bm x}[k]-A\overline{\bm x}[k]-L_l({\bm y}_l[k]-C_l\overline{\bm x}[k])\right)\\
&=\frac{1}{N}\sum_{l=1}^N(A-L_lC_l)(\underbrace{{\bm x}[k]-\overline{\bm x}[k]}_{\overline{\bm e}[k]})=\left(A- \frac{1}{N} \mathcal{L}\,C\right)\overline{\bm e}[k],
\end{aligned}

and, thus,
Since, by Assumption <ref>, the pair $(A,C)$ is observable, we have that also $(A,C/N)$ is observable and thus, by definition, there is a gain $\mathcal{L}$ which brings the error $\overline{\bm e}$ to zero by assigning arbitrary eigenvalues.

Let us now consider the dynamics of the local estimation errors ${\bm e}_i[k]$.
In particular, we have that

\begin{aligned}
{\bm e}_i[k+1] &= {\bm x}[k+1]-\hat{\bm x}_i[k+1]\\
&= A{\bm x}[k]-A\overline{\bm x}[k]-L_l({\bm y}_l[k]-C_l\overline{\bm x}[k])\\
&= \left(A-L_iC_i\right) \left({\bm x}[k]-\overline{\bm x}[k]\right)=\left(A-L_iC_i\right)\overline{\bm e}[k].
\end{aligned}

Therefore, being the local estimation errors ${\bm e}_i[k+1]$ essentially a scaling of $\overline{\bm e}[k]$ (for which we already proved convergence to zero) by a constant matrix $A-L_iC_i$, we have that also the terms ${\bm e}_i[k]$ converge to zero. This completes our proof.

In <cit.> the gains $L_i$ are designed locally.
However, due to the presence of multiple input signals, this strategy is not guaranteed to work for the design of the control gains $K_i$.
Consider, for instance, the case where $N=2$,

\begin{bmatrix}
\end{bmatrix}
\end{small},
\quad B_1=\begin{small}\begin{bmatrix}
\end{bmatrix}\end{small},\!\!
\quad
\end{bmatrix}\end{small}\!\!.\!\!

Using the approach in <cit.> to choose $K_i$ we get

\begin{align}
2.7788 & -2.0033 & 0.0436 & 1.5033
\end{bmatrix},\nonumber\\
-1.7909 & 4.0311 & -0.1091 & -5.0182
\end{bmatrix}.\nonumber
\end{align}

However, the eigenvalues of $A+B_1K_1+B_2K_2$ are unstable, being .
Notice that a similar problem would arise if the gains $L_i$ in our scheme were computed as in <cit.>, as $A-\frac{1}{N}\sum_{i=1}^\ell L_\ell C_\ell$ would not necessarily be stable.

§ DISTRIBUTED SELECTION OF THE GAINS

In this section, we develop an initialization procedure that allows the agents to select suitable gains matrices $K_i$ and $L_i$ in finite time and in a completely distributed way.
Notice that, for the sake of brevity, in the remainder of this section we address the problem of choosing the control gains $K_i$; the application of the envisaged procedure to the selection of the observer gains $L_i$ is straightforward.

Specifically, the overall initialization procedure is comprised of three  consecutive initialization steps, described next:

P1) Run iterations of the finite-time average consensus algorithm twice, as in Sections <ref> and <ref>, to obtain an upper bound $D'$ on the network diameter $D$ (see Remark <ref>) and $\overline{m}$ <cit.>.

P2) Perform a distributed leader election procedure, a max-consensus procedure for $D'$ steps (computed already in procedure P1) over, the agents' identifiers or by just selecting a number from a continuous fixed range of values <cit.>.

P3) Execute the procedure for the distributed selection of the gains discussed next, in Section <ref>; it is based on the methodology discussed in Section <ref>, which requires a leader, already elected in procedure P2.

§.§ Single Eigenvalue Placement

This subsection reviews a control technique for a system in the form ${\bm z}[k+1]=\mathcal{A}{\bm z}[k]+\mathcal{B}{\bm u}[k]$, with $\mathcal{A}\in\mathbb{R}^{n\times n}$ and $\mathcal{B}\in \mathbb{R}^{n\times q}$ that allows a single eigenvalue $\lambda_i$ of the dynamical matrix $\mathcal{A}$ to be modified while leaving all other eigenvalues unchanged.
In particular, in the following we assume that $\lambda_i$ is a controllable eigenvalue of $\mathcal{A}$,
as per the Popov-Belevitch-Hautus test (see <cit.>). Moreover, let us consider a left eigenvector ${\bm w}_i(\mathcal{A})\in\mathbb{R}^n$ associated to $\lambda_i$,
Let us now consider the dynamics  and let us initially assume, for simplicity of exposition, that $\mathcal{B}\in \mathbb{R}^{n\times 1}$, that ${\bm u}[k]$ is scalar.
Premultiplying the systems' dynamics  by ${\bm w}_i^\top(\mathcal{A})$, we highlight the dynamics along the eigenspace spanned by ${\bm w}_i^\top(\mathcal{A})$ (see <cit.>), thus obtaining

\begin{aligned}
{\bm w}_i^\top(\mathcal{A}) {\bm z}[k+1]&={\bm w}_i^\top(\mathcal{A})\mathcal{A}{\bm z}[k]+{\bm w}_i^\top(\mathcal{A})\mathcal{B} {u}[k]\\
& = \lambda_i{\bm w}_i^\top(\mathcal{A}){\bm z}[k]+{\bm w}_i^\top(\mathcal{A})\mathcal{B} {u}[k].
\end{aligned}

Suppose that, as a result of the control action, we want to replace $\lambda_i$ with $\overline{\lambda}_i$, we want to choose $u[k]$ such that

{\bm w}_i^\top(\mathcal{A}) {\bm z}[k+1]=\overline{\lambda}_i{\bm w}_i^\top(\mathcal{A}){\bm z}[k].

This is possible by choosing $u[k]=\mathcal{K}{\bm z}[k]$ with

\begin{equation}
\label{eq:choicegainK}
\mathcal{K}=\dfrac{\overline{\lambda}_i-\lambda_i}{{\bm w}_i^\top(\mathcal{A})\mathcal{B}} {\bm w}_i^\top(\mathcal{A}).
\end{equation}

Notice that the above selection for $\mathcal{K}$ is well-posed; in fact, since $\lambda_i$ is controllable then $\begin{bmatrix}\mathcal{A}-\lambda_i I_n & \mathcal{B}\end{bmatrix}$ is full rank and thus

from which we have that

\begin{bmatrix}{\bm w}_i^\top(\mathcal{A})\mathcal{A}-\lambda_i {\bm w}_i^\top(\mathcal{A}) & \!\!{\bm w}_i^\top(\mathcal{A})\mathcal{B}\end{bmatrix}=\begin{bmatrix}0 &\!\! {\bm w}_i^\top(\mathcal{A})\mathcal{B}\end{bmatrix}\neq0,

which implies that ${\bm w}_i^\top(\mathcal{A})\mathcal{B}\neq 0$.
The above $\mathcal{K}$ is such that $\mathcal{A}+\mathcal{B}\mathcal{K}$ has the same eigenvalues as $\mathcal{A}$, except for the fact that the eigenvalue $\lambda_i(\mathcal{A})$ is replaced by the desired $\overline{\lambda}_i$. Note that this is similar to a Hotelling deflation <cit.>, since we only modify the direction spanned by one eigenvector, without modifying the other directions.

Notably, the procedure can be iterated. Assuming that we also want to replace $\lambda_j$ with $\overline{\lambda}_j$, it is sufficient to set
, where $\mathcal{K}$ is as above, while $r[k]=\mathcal{H} {\bm z}[k]$, with

\begin{equation}
\label{eq:choicegainK2}
\mathcal{H}= \dfrac{\overline{\lambda}_j-\lambda_j}{{\bm w}_i^\top(\mathcal{A}+\mathcal{B}\mathcal{K})\mathcal{B}} {\bm w}_i^\top(\mathcal{A}+\mathcal{B}\mathcal{K}).
\end{equation}

Notice that the left eigenvector used to replace $\lambda_j$ is the one obtained after applying $K$, considering the matrix $\mathcal{A}+\mathcal{B}K$.

Let us now consider the case where $\mathcal{K}\in\mathbb{R}^{n\times q}$ with $q>1$. In this case, assuming that a matrix $\mathcal{K}^{(j)}$ has been selected with the above approach for each column $\mathcal{K}^{(j)}$ of $B$, it is sufficient to set the overall $\mathcal{K}\in\mathbb{R}^{q\times n}$ as

§.§ Proposed Protocol for Choosing the Gains

The main idea of our protocol is to have the agents choose $K_i$ one after another, using the approach discussed in Section <ref>.
In the beginning, a leader is elected in a distributed way[Leader election could be implemented via max-consensus over the agents' identifiers <cit.>.]. The leader initiates a token passing procedure where a token is circulated among the agents, and the token contains a matrix $F$ to be described next.

In general, when a node $v_j$ receives a message $F$ for the first time, it checks if $A+F$ is  Schur stable. If $A+F$ is not Schur stable, it computes a gain $K_j$ that stabilizes all the eigenvalues it can (as done in Section <ref>), it adds its own term $B_jK_j$ to the message and it sends the updated message
$F+B_jK_j$ to an out-neighbor that has not yet been visited.
Notice that some of the agents might not be able to control any eigenvalue, and in that case, they simply choose $K_j=0_{n\times q_i}$.
If, conversely, upon receiving the message for the first time, agent $j$ realizes that $A+F$ is Schur stable, the message becomes read-only and starts being flooded in the network.
A last case is when a message that is not read-only is received by a node that has already received it; in this case, the message is simply forwarded to a not-yet-visited out-neighbor.
Notice that the proposed approach does not require a stopping criterion. In fact, since the system is jointly controllable by all agents, and due to the approach adopted for the selection of the gains, eventually, all unstable eigenvalues will be placed and one of the agents will thus receive $F$ such that $A+F$ is Schur stable; as a consequence, the read-only phase will begin. Also in this case, since the graph is strongly connected, and since each agent broadcasts the message to all its neighbors and then stops participating, the read-only message will reach all nodes in finite time.

Algorithm <ref> summarizes the above procedure.

Choice of $K_i$ (from the perspective of agent $i$)

Assign a priority to each out-neighbor;
Declare to be not yet visited;
$K_i\gets 0_{n\times q_i}$;
Create empty token $F=0$;
Trigger OnReceiveToken($F$);

already visited
Forward $F$ to an out-neighbor according to the priorities;

$A+F$ is not Schur stable
Compute $K_i$ that stabilizes controllable eigenvalues;

$F\gets F+K_iB_i$;

Send $F$ to an out-neighbor according to the priorities;

Declare $F$ read-only;

Broadcast $F$ to all out-neighbors;

Stop Participating;

Broadcast $F$ to all out-neighbors;

Stop Participating;

The matrix $K_i$ can be computed using the approach in Section <ref>, i.e., via  Eqs.(<ref>)–(<ref>).

The following theorem establishes the correctness of the proposed algorithm and characterizes the associated time and message complexity.

Let  $\mathcal{G}=\{\mathcal{V},\mathcal{E}\}$ be strongly connected, let Assumption <ref> hold true, and assume that the algebraic and geometric multiplicities of the unstable eigenvalues of $A$ are the same.
Then, Algorithm <ref> is correct, i.e., each agent computes $K_i$ such that $A+\sum_{\ell=1}^N B_iK_i$ is Schur stable. Moreover, the time complexity and the message complexity of Algorithm <ref> amount to $\mathcal{O}(N^2)$. Finally, at each step, $\mathcal{O}(N)$ messages are transmitted.

In order to prove our statement, let us first show that, over a strongly connected graph $G$, the message will be received by every agent (hence each agent will add its contribution $B_iK_i$) in at most $\mathcal{O}(N^2)$ steps.

To this end, let us consider the worst case in terms of graph topology and priorities and let us use $v_i$ to denote the agents with the order they are first reached by the token (hence, the leader is $v_1$).
Moreover let $\omega_i$ denote the number of steps required to visit node $v_{i}$ from the time the token is first received by node  $v_{i-1}$ (in this view, $\omega_1=0$).
Over a strongly connected graph, in the worst case, the token always goes back to $v_1$ after visiting a new node. Therefore, node $v_i$ is visited after $\omega_i=2i-3$ steps; in fact, it takes $i-2$ steps to go back to $v_1$ and additional $i-1$ steps to reach $v_i$ from $v_1$.
Hence, the total message complexity is

At this point, we observe that since by Assumption <ref> the pair $(A,B)$ is controllable, and since the gain matrices $K_i$ are chosen iteratively, each time modifying only the eigenspace spanned by the eigenvalues that are unstable and controllable by the $i$-th agent alone, by construction $A+B\mathcal{K}$ is Schur stable, with
Correctness follows by noting that, when the last agent receives the message for the last time and updates $F$, it holds

Notice that, since the token passing requires $\mathcal{O}(N^2)$ steps in the worst case, the message is declared as read-only in $\mathcal{O}(N^2)$ steps, and the read-only message is received by all agents in additional $\mathcal{O}(N)$ steps (because the message is flooded over the strongly connected graph). As a consequence, the time complexity of Algorithm <ref> is $\mathcal{O}(N^2)$.
Let us now discuss the message complexity. In particular, during the initial phase in which the nodes transmit the token on a point-to-point basis, $\mathcal{O}(N^2)$ messages are transmitted. Then, when the token becomes read-only, the message is transmitted once for each link, $\mathcal{O}(|E|)$ times.
Therefore, overall, the message complexity of Algorithm <ref> is
To conclude we observe that, in the worst case of a star topology where the star-center broadcasts the read-only message, $\mathcal{O}(N)$ messages are transmitted at each time step.

As a byproduct of Algorithm <ref>, each node will know $\sum_{\ell=1}^N B_\ell K_\ell$, which can be used within Eq. (<ref>), thus relaxing the assumption in <cit.>, in which each agent $v_i$ is required to know $\sum_{j\in \mathcal{N}^{\texttt{in}}_i} B_jK_j$ a priori.
It is worth mentioning that the input matrices $B_i$ are never directly shared; instead, the nodes accumulate $B_iK_i$ in the token.

Algorithm <ref> can be applied also to the selection of the gains $L_i$. In fact, it is sufficient to apply the algorithm to the selection of gain matrices $\widetilde{K}_i$ with respect to the pairs $(A^\top, -\frac{1}{n}C_i^\top)$, and then set $L_i=\widetilde{K}_i^\top$.

§ ILLUSTRATIVE EXAMPLES

Consider a directed network consisting of four nodes, described by matrix $P$, where each node has access to the dynamical matrix $A$.

$$\footnotesize \setlength\arraycolsep{2.2pt}
P \!=\!\!\! \begin{bmatrix}
1/3 & 0 & 1/4 & 1/3\\
1/3 & 1/2 & 1/4 & 0\\
0 & 1/2 & 1/4 & 1/3\\
1/3 & 0 & 1/4 & 1/3
\end{bmatrix}\!\!,
A \! = \!\! \begin{bmatrix}
\end{bmatrix}\!\!.\!\!

[>=stealth, thick,
shorten >=2pt,
shorten <=2pt,
on grid,

node distance = 3cm and 1cm

[every node/.style=circle,thick,draw,
main/.style=draw=black, thick, draw, circle, fill=qual4!10, minimum size=0.9cm,]
[main] (1) $v_1$;
[main] (2) [right of=1] $v_2$;
[main] (3) [below of=2] $v_3$;
[main] (4) [left of =3] $v_4$;

every node/.style=fill=white,circle,minimum size=0.1,
every edge/.style=draw=black, thick, ->,> = latex']

[->]    (1)         edge[bend left]     node                        $p_{21}$      (2);
[->]    (1)         edge[bend left]     node                        $p_{41}$      (4);
[->]    (2)         edge[bend left]     node         $p_{32}$      (3);
[->]    (3)         edge[bend right=5]     node         $p_{13}$      (1);
[->]    (3)         edge[bend left]     node         $p_{23}$      (2);
[->]    (3)         edge[bend left]     node         $p_{43}$      (4);
[->]    (4)         edge[bend left]     node         $p_{14}$      (1);
[->]    (4)         edge[bend left]     node         $p_{34}$      (3);

Moreover, each node in the network has sensing, and computational capabilities to run the finite-time exact average consensus algorithm (for this setup $\overline{m}=11$ steps) and compute its local state estimates, and control input signals. More specifically, each node can sense only one state, and apply only one control signal to the system. The local input matrices $B_i$ for each node $v_i$ are $B_1=\setlength\arraycolsep{2pt}
\begin{bmatrix}
0 & 1 & 0 & 0 & 0 & 0 & 0 & 0
\end{bmatrix}^{\top}, B_2=\begin{bmatrix}
0 & 0 & 0 & 1 & 0 & 0 & 0 & 0
\end{bmatrix}^{\top}, B_3=\begin{bmatrix}
0 & 0 & 0 & 0 & 0 & 1 & 0 & 0
\end{bmatrix}^{\top}, \text{ and } B_4=\begin{bmatrix}
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1
\end{bmatrix}^{\top}
$. Similarly, the local measurement matrices $C_i$ are $
1&0&0&0&0&0&0&0\end{bmatrix}, C_2=\begin{bmatrix}0&0&1&0&0&0&0&0\end{bmatrix}, C_3=\begin{bmatrix}0&0&0&0&1&0&0&0\end{bmatrix}, \text{ and } C_4=\begin{bmatrix}0&0&0&0&0&0&1&0\end{bmatrix}$.

Let $\rho_i$ and $\chi_i$ denote, respectively, the controllability and observability indices for the $i$-th agent, the rank of the controllability and observability matrices for the pairs $(A,B_i)$ and $(A,C_i)$, respectively.

We have that
$\rho_1=4$, $\rho_2=2$, $\rho_3=6$, $\rho_4=2$, while $\chi_1=4$, $\chi_2=2$, $\chi_3=2$, $\chi_4=6$, the system is not independently observable or controllable by the single agents. However, the system is jointly observable and controllable as the rank of both the overall controllability and observability matrices is full.

Let us now consider the initialization phase, and let us assume that $v_1$ is elected as leader and that the token visits the agents in order from $v_1$ to $v_4$. The agents choose $L_i$ and $K_i$ via Algorithm <ref>, with the aim to place the observer eigenvalues at  and the controller eigenvalues at . The local observer and control gains chosen by each agent $v_i$ correspond to the $i$-th row of $K$ and column of $L$, respectively, where

\footnotesize{
\setlength\arraycolsep{1.8pt}
\begin{bmatrix}
\shortminus1.0916 &   0&    0.0003      &   0\\
\shortminus1.0114 &   0&   0.0003   &      0\\
0&  \shortminus1.0664  & 0&         0\\
0&  \shortminus0.7300 &0&         0\\
31.9630&  0&  \shortminus0.8021    &     0\\
32.3204 & 0&   \shortminus0.5786      &   0\\
\shortminus0.0350 &   0 &    0&         0\\
\shortminus0.0247 &   0&    0&         0
\end{bmatrix}^\top\!\!\!\!\!\!,
\begin{bmatrix}
12.5600&    0&         0&    0\\
\shortminus8.1221&   0&         0&   0\\
0&    6.0400&         0&   0\\
0&    7.7600&         0&   0\\
7.0165&    0&         0&    0\\
7.6708&    0&         0&    0\\
\shortminus0.1299&    0&         0&    3.4800\\
\shortminus5.7761&   0&         0&    8.3680\\
\end{bmatrix}\!.}

Here it is worth mentioning that, although all agents participate in all procedures involved in estimating and stabilizing the states of the system, the control gain of $v_4$ and the observer gain of $v_3$ are zero.
In the first case, this occurs since when agent $v_4$ receives the token the matrix already has the desired eigenvalues, while in the second case, this is due to the fact that agent $v_3$ is only able to change some of the eigenvalues that have already been changed, hence there is a need to resort to the observer gain chosen by $v_4$.

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=4.2cm,
xlabel=iteration [$k$],
ylabel=error $\lvert|\cdot\rvert|$,
ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=north east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=${\bm e}_1[k]$,${\bm e}_2[k]$,${\bm e}_3[k]$,${\bm e}_4[k]$,$\overline{\bm e}[k]$,${\bm x}[k]$
[qual1,no markers] table [x expr=k-1,y=EstErr1norm, col sep=comma]xhatNorm.csv;
[qual2,no markers] table [x expr=k-1,y=EstErr2norm, col sep=comma]xhatNorm.csv;
[qual3,no markers] table [x expr=k-1,y=EstErr3norm, col sep=comma]xhatNorm.csv;
[qual4,no markers] table [x expr=k-1,y=EstErr4norm, col sep=comma]xhatNorm.csv;
[black,densely dotted,no markers] table [x expr=k-1,y=avgEstErrnorm, col sep=comma]xhatNorm.csv;
[red,dashed,no markers] table [x expr=k-1,y=xstatenorm, col sep=comma]xhatNorm.csv;

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=3.9cm,
xlabel=normalized time $t$, $\tau=0.1$,
ylabel=error $\lvert|\cdot\rvert|$,
ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=north east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=Proposed algorithm, <cit.> with $m=6$, <cit.> with $m=11$, <cit.> with $m=22$
[red,no markers] table [x expr=k1*(11*0.1+1),y=nostro, col sep=comma]xhatNormlastfigure.csv;
[cyan,mark=+] table [x expr=k1*(20*0.1+1),y=l20, col sep=comma]xhatNormlastfigure.csv;
[blue,densely dotted,no markers] table [x expr=k1*(30*0.1+1),y=l30, col sep=comma]xhatNormlastfigure.csv;
[magenta,mark=Mercedes star] table [x expr=k1*(40*0.1+1),y=l40, col sep=comma]xhatNormlastfigure.csv;

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=3.9cm,
xlabel=normalized time $t$, $\tau=1$,
ylabel=error $\lvert|\cdot\rvert|$,

ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=south east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=Proposed algorithm, <cit.> with $m=6$, <cit.> with $m=11$, <cit.> with $m=22$
[red,no markers] table [x expr=k1*(11*1+1),y=nostro, col sep=comma]xhatNormlastfigure.csv;
[cyan,mark=+] table [x expr=k1*(20*1+1),y=l20, col sep=comma]xhatNormlastfigure.csv;
[blue,densely dotted,no markers] table [x expr=k1*(30*1+1),y=l30, col sep=comma]xhatNormlastfigure.csv;
[magenta,mark=Mercedes star] table [x expr=k1*(40*1+1),y=l40, col sep=comma]xhatNormlastfigure.csv;

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=3.9cm,
xlabel=normalized time $t$, $\tau=10$,
ylabel=error $\lvert|\cdot\rvert|$,
ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
xticklabel style=
/pgf/number format/fixed,
/pgf/number format/precision=1
scaled x ticks=false,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=south east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=Proposed algorithm, <cit.> with $m=6$, <cit.> with $m=11$, <cit.> with $m=22$
[red,no markers] table [x expr=k1*(11*10+1),y=nostro, col sep=comma]xhatNormlastfigure.csv;
[cyan,mark=+] table [x expr=k1*(20*10+1),y=l20, col sep=comma]xhatNormlastfigure.csv;
[blue,densely dotted,no markers] table [x expr=k1*(30*10+1),y=l30, col sep=comma]xhatNormlastfigure.csv;
[magenta,mark=Mercedes star] table [x expr=k1*(40*10+1),y=l40, col sep=comma]xhatNormlastfigure.csv;

Comparison of the estimation error between the proposed approach (solid line, $\overline{m}=11$) and the one in <cit.> when $m\in\{6,11,22\}$, for different communication duration $\tau \in \{0.1, 1, 10\}$.

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=3.9cm,
xlabel=normalized time $t$, $\tau=0.1$,
ylabel=error $\lvert|\cdot\rvert|$,
ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=north east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=Proposed algorithm, <cit.> with $m=6$, <cit.> with $m=11$, <cit.> with $m=22$
[red,no markers] table [x expr=k1*(11*0.1+1),y=nostro, col sep=comma]xhatNormlastfigure.csv;
[cyan,mark=+] table [x expr=k1*(20*0.1+1),y=l20, col sep=comma]xhatNormlastfigure.csv;
[blue,densely dotted,no markers] table [x expr=k1*(30*0.1+1),y=l30, col sep=comma]xhatNormlastfigure.csv;
[magenta,mark=Mercedes star] table [x expr=k1*(40*0.1+1),y=l40, col sep=comma]xhatNormlastfigure.csv;

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=3.9cm,
xlabel=normalized time $t$, $\tau=1$,
ylabel=error $\lvert|\cdot\rvert|$,

ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=south east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=Proposed algorithm, <cit.> with $m=6$, <cit.> with $m=11$, <cit.> with $m=22$
[red,no markers] table [x expr=k1*(11*1+1),y=nostro, col sep=comma]xhatNormlastfigure.csv;
[cyan,mark=+] table [x expr=k1*(20*1+1),y=l20, col sep=comma]xhatNormlastfigure.csv;
[blue,densely dotted,no markers] table [x expr=k1*(30*1+1),y=l30, col sep=comma]xhatNormlastfigure.csv;
[magenta,mark=Mercedes star] table [x expr=k1*(40*1+1),y=l40, col sep=comma]xhatNormlastfigure.csv;

xmode=normal, ymode=log,
tick label style=font=,
label style=font=,
width = 8.4cm, height=3.9cm,
xlabel=normalized time $t$, $\tau=10$,
ylabel=error $\lvert|\cdot\rvert|$,
ytick=0.0000000001,0.00000001,0.000001, 0.0001, 0.01, 1, 100,10000,
xticklabel style=
/pgf/number format/fixed,
/pgf/number format/precision=1
scaled x ticks=false,
enlarge x limits=false,
every axis plot/.append style=semithick,
legend image post style=scale=0.55,
legend pos=south east,
legend style=font=, column sep=1ex,legend columns=1,mark repeat=1,mark phase=3,
legend entries=Proposed algorithm, <cit.> with $m=6$, <cit.> with $m=11$, <cit.> with $m=22$
[red,no markers] table [x expr=k1*(11*10+1),y=nostro, col sep=comma]xhatNormlastfigure.csv;
[cyan,mark=+] table [x expr=k1*(20*10+1),y=l20, col sep=comma]xhatNormlastfigure.csv;
[blue,densely dotted,no markers] table [x expr=k1*(30*10+1),y=l30, col sep=comma]xhatNormlastfigure.csv;
[magenta,mark=Mercedes star] table [x expr=k1*(40*10+1),y=l40, col sep=comma]xhatNormlastfigure.csv;

To conclude, in Fig. <ref> we provide a comparison[
Notice that also <cit.> relies on rounds of distributed averaging; however, such an approach only focuses on estimation, while no control action is considered. For this reason, and since in <cit.> the estimation gains are designed in a way that would not be suitable for our approach (and vice versa), we opted not to compare them.] with the approach in Savas et al. <cit.>, which is based on $m$ repeated rounds of asymptotic consensus in-between state updates.
Following the approach in <cit.>, by normalization of the time axis, we assume that the local computations executed at each estimation-control iteration $k$ are performed in one unit of time, denoted by $t$.
Moreover, we assume that each communication round within the asymptotic or time-varying consensus procedures requires a time equal to $\tau$ (which may be smaller, equal, or greater than 1). In particular, the upper plot of Fig. <ref> considers the case where $\tau=0.1$ (communication is faster than local computation), the middle plot of Fig. <ref> considers the case where $\tau=1$ (communication and computation are equally fast), while the case $\tau=10$ (communication is slower than computation) is reported in the lower plot of Fig. <ref>.
In more detail, the figure considers the problem discussed in the previous example and compare the norm of the average error of our approach with the one in <cit.> relying, for fairness of comparison, on the same control and estimation gains chosen via our distributed initialization algorithm. The gains $W_{ij}$ were computed[In <cit.>, the gains $W_{ij}$ amount to the sum of two terms $W_{ij}^E=p_{ij}A$ and $W_{ij}^C$. In particular, the term $W_{ij}^C$ is computed by solving a centralized optimization problem featuring a positive definiteness constraint. To compute the terms $W_{ij}^E$, we resorted to an approximated solver, namely MIDACO <cit.>. The interested reader is referred to <cit.> for a complete discussion on how to compute the gains $W_{ij}$.] as in <cit.>.
Interestingly, while the proposed approach requires $\overline{m}=11$ communication rounds for each state update, the approach in <cit.>, for the considered instance, exhibits a converging behavior only for $m\geq 6$ asymptotic average consensus rounds. In this view, the figure reports the evolution of the error for the approach in <cit.> considering $m\in\{6,11,22\}$.
According to the figure, in all three considered scenarios for the computation/communication time, the proposed algorithm consistently outperforms the one in <cit.>.
The comparison is particularly favorable to our algorithm when the communication time is comparable or larger than the local computation time, $\tau \in \{1,10\}$.

Interestingly, the normalized time $t$ required for the case where $m=22$ is larger than the one required for $m=11$; in fact, we observe that for these two cases, the performance is comparable in terms of estimation-control iterations $k$, but setting $m=22$ requires twice as much communication rounds as for $m=11$. Hence, in the case of asymptotic average-consensus rounds, increasing $m$ may not correspond to a performance increase.

§ CONCLUSIONS AND FUTURE DIRECTIONS

This paper introduces a novel methodology for distributed LTI system estimation and control in discrete-time. It incorporates a finite-time average consensus mechanism between estimation steps, allowing for arbitrary eigenvalue placement in estimation error dynamics and overcoming the limitations of previous approaches. A novel, fully distributed method for computing control gains enhances the system's self-configuration and resilience. Simulation results demonstrate improved performance over other methods that are based on asymptotic consensus rounds.

Future research could explore: dealing with consensus mechanisms under unmet assumptions (e.g., when Assumption <ref> is not satisfied), addressing communication challenges like delays, packet losses, and varying topologies, developing procedures for simultaneous gain design across nodes, and extending the framework to stochastic linear systems.