## 5 Applied Research Methodology  
In this section, we draw our attention to the methodology applied in our research and the metrics used to evaluate the performance of the algorithms chosen for an examination. As mentioned above we carry out two extensive experiments differing from each other in the way to bound the algorithms:  
_Scenario 1_: In this scenario, the value of the current inner states is relevant in the decision about whether or not to stop an algorithm at the current time instance. This stopping criterion is defined in (10), meaning that an algorithm is stopped at the time instance when (10) is met for the first time. Figure 6: Comparison of gossip Push-Sum protocol with deterministic Max-Degree weights algorithm over three runs—evolution of arithmetic mean estimates. Figure 7: Comparison of gossip Push-Sum protocol with deterministic Max-Degree weights algorithm—distribution of convergence rate over 100,000 runs. _Scenario 2_: In the case of applying the other applied stopping criterion, the values of the current network size estimates are checked instead of the inner states. In this scenario, the consensus is considered to be achieved when (11) is met. The time instance when (10) or (11) is met for the first time is labeled as \(k_{l}\). Once the conditions (10) and (11) are met, the agents forming MAS are said to have achieved consensus. Thus, the algorithms are completed. \[\mid max\{\mathbf{x}(k)\}-min\{\mathbf{x}(k)\}\mid<P \tag{10}\]  
\[\mid max\{\mathbf{NSE}(k)\}-min\{\mathbf{NSE}(k)\}\mid<P \tag{11}\]  
Here, \(P\) is the parameter determining when to stop an algorithm. Its higher values mean that the difference between the inner states/the network size estimates is greater after the consensus is achieved. In our experiments, it takes the following values: {0.1, 0.01, 0.001, 0.0001}. In this paragraph, we justify why we choose these two scenarios for evaluation. In Scenario 1, the arithmetic mean is estimated, and then network size estimates are determined by applying (2). Thus, the consensus achievement among the agents is conditioned by the arithmetic mean estimates. In this scenario, the consensus among the agents is achieved, provided that the difference in the absolute value between the maximum and the minimum from all the current arithmetic mean estimates is smaller than the parameter \(P\). Unlike this scenario, consensus achievement is conditioned by the current network size estimates in Scenario 2. Therefore, in this case, consensus among the agents is achieved if the difference in the absolute value between the maximum and the minimum from all the current network size estimates is smaller than the parameter \(P\). In Figures 8 and 9, we compare \(RG\) in both scenarios. The figures show that the algorithm is faster in Scenario 1, but the precision of the final estimates of the network size (the network size is 5 in this case) is lower than in Scenario 2. Figure 8: Comparison of evolution of arithmetic mean estimates with evolution of network size estimates—pairwise gossip algorithm is applied. Figure 9: Comparison of final network size estimates in both examined scenarios—pairwise gossip algorithm is applied. As shown in [50], where distributed deterministic consensus algorithms are analyzed, the selection of the leader can affect the performance of algorithms for the network size estimation. Thus, we carry out two analyses in order to examine the impact of the leader selection on the performance of the examined algorithms:  
\(\square\) _The best-connected agent is the leader._  
\(\square\) _The worst-connected agent is the leader._  
To evaluate the performance of the chosen algorithms, we apply two metrics, namely the number of sent messages required for consensus achievement and the median deviation of the final estimates from the real value of the network size. We do not apply the frequently applied metric--the number of time instances for consensus--as the number of sent messages per time instance differs for various algorithms.