Distributed protocol for determining when averaging consensus is reached Vikas Yadav, and Murti V Salapaka Abstract— Distributed averaging over a large network is a well studied problem that converges asymptotically; however, existing protocols does not provide a way for each node to distributively detect the occurrence of convergence. In this paper a method is developed to distributively determine when the consensus has reached within a given error margin. In absence of such a method all nodes in the network keep running the required computation and communication even if the consensus value are within acceptable tolerance, which is not preferable as in large-scale distributed networks resources like power are limited. Furthermore, this extra communication can cause signal interference with other critical information. This distributed detection takes finite time and occurs at each node simultaneously. I. I NTRODUCTION Consensus or agreement in a large network of agents refers to the event in which each agent has same information. It is assumed that each node is sharing information with its neighbors. Averaging consensus is a special case where the each node starts with some initial node-value and as a result of agreement it obtains a value which is an average of initial node-values of all the nodes in the network. Averaging consensus protocol refers to the action to be performed on the received information. In this paper, the focus is on the linear averaging protocol presented in [10] where each node takes an average of the information received from neighboring nodes. [10] provides a necessary and sufficient condition that underlying network is strongly connected and balanced which leads to an asymptotic convergence in absence of any malicious user. It is shown in [12] that the requirement for balanced graph can be dropped by using weighted integrators in the protocol. A faster linear averaging protocol similar to [10] is proposed in [13]. In [2] a condition on functions that can be computed distributively is provided. A good survey of consensus problems is provided in [11], [9]. In [8] authors provide convergence analysis for the angular interaction among agents using a switched linear model. This model also assumes that over every finite period of time the particles are jointly connected for the length of the entire interval. Similar agrement problem over random graphs is addressed in [7] for graphs having binomial distribution. Most of these works assume some kind of connectivity in the network. In [3] work is done towards maintaining the connectivity of network by controlling the algebraic connectivity (also known as the second smallest eigenvalue of Laplacian of graph) of the network. In [6] authors address agreement problem over geometric random graphs with noisy Email: {vikasy, murti}@iastate.edu communication. They showed the convergence in presence of a modified update rule where the nearest neighbor value is scaled by a special time varying step size. A malicious or faulty node is one which is not following the consensus protocol. In presence of such nodes, the averaging protocol becomes unstable, i.e. it fails to converge. In [1] authors provide results on stabilizing consensus protocol in presence of faults by assuming that node-values are binary. In large sensor networks, each node has limited power for its computational and communication need. In all consensus protocols, convergence takes place in asymptotic sense and there is no distributed way for each individual node to know if the convergence has reached within desired error margin. If each node can detect the consensus occurrence, then they can stop doing computation and communication required by the consensus protocol, and thus saving on the limited power supply. In this paper, a distributed algorithm is presented which facilitates each node to detect the occurrence of consensus within desired bounds in finite time. This algo- rithm requires implementation of maximum and minimum consensus protocols, which have finite convergence time bounded by the diameter of the network. The paper is organized as follows: In Section 2 a mathe- matical setup for the problem is presented with an overview of different protocols. In Section 3 the main scheme to achieve finite time convergence is presented. In Section 4 some examples are presented. Finally conclusion of the paper and discussion on future research directions is presented in Section 5. II. PROBLEM SETUP Consider a system of N nodes or agents connected with each other in an arbitrary manner via communication links. Each node is sensing its local information e.g. local temper- ature or chemical concentration and is trying to compute the average of that local information over the whole network. The system is modelled as a graph G := (V,E) consisting of a set V := {1, 2, ..., N } of elements called vertices or nodes or agents, and a set E of node pairs called edges, with E ⊆ E c := {(i, j )|i, j ∈ V }. If E = E c i.e. each node is connected to rest of n − 1 nodes, it is called a complete graph. A graph is called undirected if for every pair of distinct nodes i and j both (i, j ) and (j, i) are in E. Otherwise, it is called a directed graph or a digraph. A simple graph is a graph with no self loops, i.e. (i, j ) ∈ E if i = j . A graph is connected if it has a path between each pair of distinct nodes i and j , where by a path between nodes i and j we mean a sequence of distinct edges of G of the