Consensus-based clustering and data aggregation in decentralized network of multi-agent systems

Multi-agent systems are promising for applications in various fields. However, they require optimization algorithms that can handle large number of agents and heterogeneously connected networks in clustered environments. Planning algorithms performed in the decentralized communication model and clustered environment require precise knowledge about cluster information by compensating noise from other clusters. This article proposes a decentralized data aggregation algorithm using consensus method to perform COUNT and SUM aggregation in a clustered environment. The proposed algorithm introduces a trust value to perform accurate aggregation on cluster level. The correction parameter is used to adjust the accuracy of the solution and the computation time. The proposed algorithm is evaluated in simulations with large and sparse networks and small bandwidth. The results show that the proposed algorithm can achieve convergence on the aggregated data with reasonable accuracy and convergence time. In the future, the proposed tools will be useful for developing a robust decentralized task assignment algorithm in a heterogeneous multi-agent multi-task environment.


INTRODUCTION
The field of multi-agent systems has gained increasing interest in recent years, particularly in the area of decentralized control (Xie & Liu, 2017).Although traditional centralized control systems are simple and robust (Oh, Park & Ahn, 2015), they have faced challenges in managing large numbers of agents and ensuring efficient performance (Ishaq et al., 2022).Thus, researchers have shifted their focus towards decentralized control methods which aim to distribute the computational and decision-making responsibilities among the agents in a local environment (Ponda et al., 2010).Applications of decentralized systems using multi-agent systems include air delivery systems (Oh et al., 2018;Damanik & Choi, 2021), search and rescue (Tomic et al., 2012), urban air mobility (Kim, Jeong & Choi, 2021), energy load management (Rasheed et al., 2019), surveillance (Samad, Bay & Godbole, 2007), and emergency relief systems (Bupe, Haddad & Rios-Gutierrez, 2015).
In addition to several advantages, decentralized control systems have one main challenge: communication between agents to perform coordination (Kwon & Hwang, 2020).Consensus (Choi, Brunet & How, 2009) may be one of the solutions to this.The subgradient method using consensus as proposed in Nedic & Ozdaglar (2009) is used to solve an optimization problem in a decentralized network of multi-agent systems.This algorithm implements the information evolution model proposed in Tsitsiklis (1984), which combines information from local neighbors using a weight rule.With this algorithm, the information from one agent is made available to every agent connected through communication links, either directly or indirectly, as illustrated in Fig. 1.
Based on the sub-gradient method, a decentralized clustering algorithm was proposed in Khawatmi, Zoubir & Sayed (2015), Khawatmi, Sayed & Zoubir (2017).This algorithm assumes that agents have no knowledge of the number of clusters and their respective information.Using a pairwise function, an agent determines the cluster in which it belongs and propagates its knowledge towards the consensus value of the cluster.This algorithm successfully performs clustering even in partially connected networks with few data exchanges and is comparable with centralized algorithms, including KMeans (MacQueen, 1967).
Decentralized local optimization, including decentralized multi-agent mission planning (Bertsekas, 1988;Choi, Brunet & How, 2009;Luo, Chakraborty & Sycara, 2014;Johnson, Choi & How, 2016) may require local knowledge to perform mission assignments in a decentralized network.However, highly complex tasks necessitating constraints, including coupled constraints as proposed in Whitten et al. ( 2011) and complex optimization objectives, including min-max tours as proposed in Prasad, Choi & Sundaram (2020) and Damanik & Choi (2021), require certain knowledge about the neighborhood which is difficult to acquire with conventional consensus in a partially connected network.To address this, data aggregation methods can be used.The aim of data aggregation methods is to understand the data sensed by nodes and extract important information from it.Additionally, the system must be able to tackle various network restrictions.For example, in a partially connected network some data may be missing.The system must be capable of reconstructing the missing data using consensus between the agents.In a low energy network with limited bandwidth, data exchange must be executed efficiently to allow convergence to occur in a minimum number of inter-agent communications, without sacrificing the accuracy of the situational awareness.All of this must be possible without a substantial dependence on the central controller.
There are three types of data aggregation available: MIN/MAX aggregations, AVERAGE aggregations, and COUNT/SUM aggregations.MIN/MAX and AVERAGE aggregations are straightforward and various robust algorithms are available to execute these types of aggregation (Jesus, Baquero & Almeida, 2015;Fraser et al., 2012).Comparatively, COUNT/SUM aggregation is more challenging due to its sensitivity to duplicates, noise, and security attacks.
Several COUNT/SUM aggregation algorithms have been developed in order to solve the challenges posed, but each algorithm has its strengths and limitations.Token circulation, proposed in Dolev, Schiller & Welch (2006) and improved in Saha, Marshall & Reina (2019), is one approach for COUNT/SUM aggregation which implicates passing a token among the nodes and incrementing a counter every time the token is received.Probability density-based methods, such as probabilistic polling proposed in Friedman & Towsley (1999), Kalman-filter based polling in Alouf, Altman & Nain (2002), and maximum likelihood estimation in Baquero et al. (2012), require larger amounts of communication bandwidth to transmit probability density estimates between the nodes, limiting scalability.
Random walk-based algorithms, like Random-tour in Massoulié et al. (2006), Sample & Collide in Ganesh et al. (2007), and Capture-Recapture in Mane et al. (2005), have also been proposed for COUNT/SUM aggregation.These approaches involve nodes moving randomly through the network and incrementing a counter as they pass other nodes.However, these approaches are known to have low accuracy, particularly for larger numbers of nodes.
Recently, several gossip-based and consensus-based algorithms have been presented in order to overcome the limitations of previous methods.These approaches involve each node communicating with its neighbors, exchanging information and aggregating it over multiple rounds.Gossip-based algorithms such as Hop-sampling and interval density, proposed in Kostoulas et al. (2005) and Kostoulas et al. (2007) respectively, are examples of such algorithms.Consensus-based algorithms like Shames et al. (2012) and Lee et al. (2018) are other options.These algorithms do not require considerable bandwidth, produce accurate results, and converge in few iterations.However, no existing algorithm has been proposed for COUNT/SUM aggregation in a clustered network, which is common with large scale systems.
In order to tackle this limitation, this article presents a COUNT/SUM data aggregation in a clustered network of multi-agent systems.This algorithm takes into account the clustered network topology by using a notion of trust value, which reflects the trustworthiness of each node's count value.The proposed algorithm requires relatively little communication and can achieve accurate results with few iterations, as proven through simulations and sensitivity analysis.
The rest of the article is organized as follows.'Proposed Algorithm' proposes an algorithm that solves both clustering and data aggregation in a decentralized network.'Simulation' details the simulation that was built and shows the simulation results.Finally, 'Conclusion' presents the concluding remarks.

PROPOSED ALGORITHM
In this section, we will explore the consensus-based data aggregation technique for multiagent systems working in a clustered network environment.The goal of the algorithm is to perform COUNT or SUM calculations of a global information with only the available local information.By leveraging consensus on the aggregation variable and two supporting variables with neighboring agents, we can perform counting or summing of a variable from all connected members in a cluster.Additionally, the algorithm can perform an accurate data aggregation even in heterogeneous networks, wherein agents can be connected with members belonging to different clusters.Despite the noise, the algorithm can selectively filter the data and achieve convergence to the cluster aggregate value quickly.
The algorithm relies on the consensus of three important variables: 1) The (approximate cluster) centroid vector (x i ).The centroid vector is the prediction on the centroid of an agent's cluster.During the consensus, an agent compares the predicted centroid of both itself and its neighbor to find out if they are in the same cluster.
2) The aggregation contribution vector (f i ).The aggregation contribution variable is a measure of each agent's contribution to the aggregation dynamics of the cluster, and it plays a critical role in determining the overall behavior of the system by ensuring that each agent's contribution is properly accounted for.
3) The aggregate value (w i ).On the other hand, the aggregate variable is the COUNT or SUM of the data being aggregated.This variable symbolizes the final result of the aggregation process, providing a comprehensive summary of the data collected and processed by the agents.
The multi-agent system is modeled as a graph G ¼ ðV; EÞ, where V is the set of vertices or nodes representing agents, and E is the set of edges that signify the interactions between the agents.Each edge e 2 E is a tuple ðu; vÞ, where u and v are nodes in V, indicating that agents represented by u and v are interacting.The graph can be weighted or unweighted, relying on whether or not the edges have a specific value or weight associated with them, which can represent the strength or significance of the interaction between the agents.
Each node i 2 V in the environment belongs to a cluster c i from the cluster set C ¼ f1; . . .; mg in one-to-one relationships.Each cluster c is identified with its centroid w c 2 R k , with k being the number of centroid's dimensions.In this article, we assume that the network is heterogeneous, wherein there are edges between agents in different clusters.
Let N i denote the set of i's adjacent nodes, wherein node j 2 N i can belong to any cluster, it does not have to be in the same cluster with i (Fig. 2).
It is also assumed that there must be a set of edges that can connect every pair of agents in the cluster.This implies that communication between two agents in the same cluster is always possible, either directly or through several hops between agents in the cluster as illustrated in Fig. 3.
In cooperative multi-agent systems, it is assumed that the system minimizes the total cost of the entire system, which is the sum of each agent's cost.Specifically, this optimization problem can be expressed as min i2V f i ðxÞ where f i ðxÞ is the individual cost function of each agent.
In a decentralized network, the global knowledge of the environment's state x is not always available, thus agents must generate an estimate of the environment status, denoted as x i .Assuming that the agent updates its estimate in a discrete time domain, every time step an agent updates its estimate using the relation where a i ¼ ½a i1 ; . . .; a in is a weight vector used to calculate the average estimates from agent i's neighbors.The weight vector must comply with the weight rules as follows where g j is any scalar between 0 and 1 (0 , g j , 1; 8j 2 V).

Consensus on centroid vector
In decentralized systems, agents do not know the exact values of cluster centroids and members of the clusters.Instead, they conduct consensus on an estimated centroid value and compare it with their neighbors to establish whether they belong to the same cluster.Let x i 2 R k be agent i's state used for the basis of clustering, and x i 2 R k be the predicted centroid vector of its cluster c i .Then, we can define a variable called trust value, denoted as The trust function can be employed to identify whether an agent j is in the same cluster as agent i or not.We can define a scalar e as a boundary.Agents i and j are said to be within the same cluster if v ij .e.We can utilize any convex function to define the trust function as long as it satisfies Eq. ( 4).v ij ðtÞ ¼ gðx i ðtÞ; x j ðtÞ; tÞ At the initial stage, each agent sets the centroid vector to its state x i ð0Þ ¼ x i .For each time iteration t ¼ 1; 2; . .., every agent performs consensus on the centroid vector x i with their neighbors N i and updates the vector iteratively using the following equation.

Consensus on aggregation contribution vector
The data aggregation model proposed in this article is based on the network counting system proposed in Lee et al. (2018), using blended dynamics (Eq.( 7)): Using the steady-state theorem, it is easy to prove that lim t!1 sðtÞ ¼ n.Developing the consensus model based on this dynamics leads to convergence to the number of members in a cluster.In this article, we extended this model in three ways: 1) In the original article, the counting mechanism requires a leader to generate dynamic feedback in order to reach convergence.In this article, we allow every member of the cluster to contribute a fraction of the dynamic feedback, thus removing the need for a cluster leader.2) We extended the model to allow summing by introducing a state constant y 2 R on the right-hand side of the dynamics in Eq. ( 7).
3) The original model assumes a homogeneous network, where no cluster notation is defined.In this article, we extended the blended model to work with heterogeneous networks with multiple clusters by implementing trust values into the consensus models.
First, to determine the fraction of contribution of each node on the blended dynamics, we introduce a contribution vector The vector f i is initially decided by each agent i using Eq. ( 9) and then updated using the consensus rule based on the structure of the network.The idea is to generate a trust value that is proportional to the degree of the node.At the initial stage, each agent decides a vector such that And then, at every time step, agents perform consensus with their neighbors using Eq. ( 10) below.
The consensus of the contribution vector might require a slightly higher bandwidth, as an entire vector f i must be exchanged between agents and their neighbors.However, by ensuring that the centroid vectors are converged, where the prediction distance between agents in a cluster is very small, the consensus on contribution vectors can reach convergence very quickly.

Consensus on the aggregation value
The consensus on the aggregation value is a critical aspect in many decentralized systems.The objective is to collect and sum the state variables of all agents in a cluster and arrive at a single value.The state variable of each agent to be aggregated is represented by y i , and the sum of all agents' states in a cluster c 2 C is represented by Y c , as defined in Eq. ( 11): Given f i as the contribution vector known by agent i, the agent decides its ratio of contribution feedback to the aggregation dynamics (Eq.( 7)) as f ii .At every time step t ¼ 1; 2 . .., the agents generate an addition to the consensus value.
To determine the contribution of each agent to the aggregation process, a contribution vector f i is used.This vector represents the ratio of contribution feedback from each agent to the aggregation dynamics.At every time step, each agent generates an addition to the consensus value by taking the ratio value of the agent i as f ii .
Each agent calculates the prediction value of Y c as w i , which represents the approximate value of the sum of y j for all agents in the cluster C i .During the iteration process, agents exchange their prediction data using Eq. ( 12).This equation ensures that each agent has an updated and accurate prediction value of Y c .
Equation ( 12) represents the aggregation of the prediction value of each agent during the iteration process.Here, w i ðt þ 1Þ is the prediction value of the sum of all agents' states y i in the cluster c 2 C at the ðt þ 1Þ-th time step.The equation computes the new prediction value based on the previous prediction values of the neighboring agents and the local state of the agent.
The term The term eðy i À f ii ðtÞw i ðtÞÞ represents the correction term that the agent applies to its previous prediction value based on its own local state y i .f ii ðtÞ is the ratio of contribution feedback to the aggregation dynamics, and e is a small positive constant that determines the magnitude of the correction term.
Equation ( 12) is calculated for every agent i 2 V, where V is the set of all agents in the network.The iteration process continues until the prediction values of all agents converge to the same value, which represents the consensus on the sum of all agents' states y i .
The complete algorithm is shown in Algorithm 1.

SIMULATION
The simulation environment was designed to emulate the proposed algorithm in a clustered network of multi-agent systems and to test the algorithms under various conditions.The results obtained from the simulations provide valuable insights into the efficiency and scalability of the algorithms and help to validate the theoretical findings presented in the article.This section will provide a detailed description of the simulation setup, the conditions tested, and the results obtained.
The simulation first generates sample data of 100 agents with locations in 2D domains using the make_blobs function from the sklearn.datasetsmodule.A network with 100 agents is considered large and the algorithm can solve the data aggregation in a reasonable number of iterations.The sample data is sorted based on its cluster labels and stored in a state matrix X of size 100 Â 2 and a cluster label vector c of size 100 Â 1.
Next, a graph G is created with 100 nodes with X as the location of nodes (Fig. 4A).The edges in the graph are determined based on the distances between nodes.To generate strong connections within a cluster, the NearestNeighbors class from the sklearn.neighborsmodule is used to find the nearest neighbors for each node and we connect each agent with their 10 nearest neighbors.The graph is also augmented with random edges with a Algorithm 1 Decentralized data aggregation in clustered network for each agent i Require: 26: probability of 0.1% to increase its inter-cluster connectivity.The adjacency matrix of the graph is shown in Fig. 4B.The code then initializes the cluster centroid prediction x, contribution matrix f, and aggregate matrix w.These matrices are updated in each iteration of the data aggregation process using Eqs.( 6), (10), and (12).The data to be aggregated is stored in a vector y 2 R n with initial value equal to ID of each node, y i ¼ i; 8i.The real aggregate of the data is calculated and stored in a vector Y i ¼ P i2C i y i ; 8i for error reference.The trust value v ij is calculated using three different convex functions (Fig. 5A): Gaussian (Eq.( 13)), triangular (Eq.( 14)), and rectangular (Eq.( 15)).

Gaussian function
; if kx i Àx j jj 2 2r 0; otherwise The data aggregation process is repeated for a maximum number of iterations, specified by MAX_ITER.The code checks if the contribution vectors has converged by comparing the updated values with the previous values, and if the difference is within a given tolerance, the process terminates.After the convergence, the simulation skips the consensus on the contribution vector, and continues the consensus for the aggregate value until convergence.Figure 6 shows the cluster centroid predictions of all agents, over the course of the iterations.Figure 5B shows the convergence rate of the centroid cluster prediction using three different trust functions, and Fig. 7 shows the contribution vector of all agents at convergence.
The simulation also calculates the mean squared error between the real aggregate value and the predicted aggregate value, which is a measure of the difference between the two.Figure 8B shows the mean squared error for each iteration.13)), triangle (Eq.( 14)), and rectangle (Eq.( 14)) functions.The convergence rate of cluster centroid prediction is shown in (B).
Full-size  DOI: 10.7717/peerj-cs.1445/fig-5 Figure 6 (A and B) The prediction of cluster centroid by all nodes.In initial, the centroid is defined to each node's state (x i ¼ x i ).Using consensus rule on Eq. ( 6), the centroid prediction converged to mean value of each member's state of the cluster.We also provide sensitivity analysis of our proposed algorithm.Sensitivity analysis is a crucial step in evaluating the performance of the proposed algorithms for decentralized data aggregation in clustered networks of multi-agent systems.In this study, sensitivity analysis was performed to investigate the effect of various parameters on the accuracy of data aggregation.The parameters considered in the sensitivity analysis include the value of epsilon (a threshold value used in the algorithm), the number of connected neighbors, the probability of random edge generation, and the number of sample nodes.
A sensitivity analysis was conducted to evaluate the performance of the proposed algorithm.The parameters considered in the analysis were: e (data aggregation step), the number of connected neighbors (jjN i jj), the number of sample nodes (n), and the probability of random edge generation (p rand ).The results of the sensitivity analysis showed that the data aggregation error was sensitive to all of these parameters, as shown in Table 1.In particular, as the value of e increased, the convergence time reduced  significantly while increasing the convergence error (Fig. 9A).The sensitivity analysis also showed that various numbers of connected neighbors (Fig. 9B), probabilities of random edge generation (Fig. 9C), and number of sample nodes (Fig. 9D) still led to similar convergence values, demonstrating the robustness of the algorithm in heterogeneous networks.

CONCLUDING REMARKS
This article proposed an algorithm to perform data clustering and aggregation in a decentralized network of multi-agent systems, using consensus methods on three key variables: approximate cluster centroid vectors, aggregation contribution vectors, and aggregate values.The trust value used in the consensus rules enables data aggregation in a heterogeneously connected clustered network.Thus, data aggregation is performed in the cluster scale while still allowing inter-cluster communication.
The accuracy and convergence rate of the algorithm are dependent on the data aggregation step size constant e.A bigger value of e results in faster convergence time, but with higher aggregation errors, and vice versa.The main advantages of the proposed algorithm include the fact that it does not require many data transfers between its neighbors and that the data aggregation can reach convergence in a reasonable number of iterations, even in heterogeneous networks.These advantages allow both clustering and data aggregation in a decentralized network with limited bandwidth.
Future work includes extending the proposed algorithm to work in switching networks and improving the accuracy and convergence time by modifying the consensus rules for data aggregation.Furthermore, there are various applications which will benefit from this algorithm, such as decentralized task allocation algorithms and coordination algorithms in multi-agent systems.

Figure 1 A
Figure 1 A problem of identifying objects in a decentralized network of multi-agent systems.Data aggregation enables agent 1 to recognize objects beyond its sensor range.Full-size  DOI: 10.7717/peerj-cs.1445/fig-1

Figure 2
Figure 2 Heterogeneous network model allows for the communication between agents in different clusters.Full-size  DOI: 10.7717/peerj-cs.1445/fig-2

Figure 3
Figure3For a feasible network, all nodes in the cluster must be connected with at least one member of the same cluster, making the group of agents on the right unfeasible.Full-size  DOI: 10.7717/peerj-cs.1445/fig-3 ðtÞw j ðtÞ represents a weighted average of the prediction values of the neighboring agents and the current agent.The weight v ij ðtÞ determines the influence of the prediction value of each neighboring agent on the new prediction value of the current agent.

Figure 4
Figure 4 Network graph G consisting of 4 clusters with 25 nodes each.Each node has edges with its nearest 10 neighbors and 10% probability with any random nodes as shown in (A).The resulting adjacency matrix is shown in (B).Full-size  DOI: 10.7717/peerj-cs.1445/fig-4

Figure 7 (Figure 8 18 Figure 9
Figure 7 (A and B) Contribution vector value at convergence fð1Þ.For every agents in the same cluster the contribution vector converge to the same value.Full-size  DOI: 10.7717/peerj-cs.1445/fig-7

Table 1 Sensitivity
analysis is performed to measure the convergence time of contribution vector (f) and data aggregation value (w) with various value of data aggregation step size e, number of neighbors (kN i k), number of nodes (n), and probability of random edge generation (p rand ).Damanik et al. (2023), PeerJ Comput.Sci., DOI 10.7717/peerj-cs.1445