Coordination Through Stochastic Channels
Abstract
We consider a stochastic network model consisting of a set of synchronous processes communicating by message passing. In each round, processes send messages directly to each other over a complete communication graph. The processes do not fail, but messages can be lost. Each message is delivered with probability , for a given parameter . We study the following optimization version of approximate agreement in this model. We assume that processes start with binary input values, execute an algorithm for a fixed number of rounds, and decide values in satisfying the usual validity requirement stating that if all processes start with the same input value, then they should all decide that value. We propose deterministic algorithms that minimize the expected discrepancy, namely, the expected maximum distance between the decided values. We also present lower bounds on the expected discrepancy, which demonstrate the optimality of our algorithms for two processes. Finally, we present applications of our algorithms to solve randomized consensus and randomized approximate agreement.
Keywords and phrases:
Approximate agreement, randomized consensus, stochastic models, topologyFunding:
Pierre Fraigniaud: Additional support from ANR projects DUCAT (ANR-20-CE48-0006), ENEDISC (ANR-24-CE48-7768-01), and PREDICTIONS (ANR-23-CE48-0010), and from the InIDEX Project METALG.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Probabilistic computation ; Theory of computation Distributed computing models ; Theory of computation Random network models ; Theory of computation Distributed algorithmsEditor:
Dariusz R. KowalskiSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
We consider a set of synchronous processes communicating by sending messages to each other along the edges of a fully connected graph, i.e., for every two processes and , there is a directed channel from to , and a directed channel from to . The processes do not fail, but the channels may fail to deliver messages. In each round, for every directed channel, the message sent through that channel is delivered with probability , for a given parameter .
This model has been called in the past stochastic (dynamic) network, and also sometimes referred to as evolving or temporal stochastic graph model as, in each round, the set of channels through which the messages have been delivered may define a different directed graph. Such a model has been studied since the 1980s, including variants where the probability of the directed graph at each round my depend on the graphs that occurred during the previous rounds, where the random graph at each round may be undirected, or where a random graph distribution is assumed that guarantees that each instantaneous graph, or the union of a few consecutive graphs, is connected with high probability. We refer to the surveys and recent papers [5, 7, 11, 14, 16] for details and references. The stochastic network model is of theoretical interest (e.g., the directed Erdős-Réni random graph model can be viewed as a specific instance of the model), and also of practical interest, e.g. it has been argued that assuming that every link delivers a message independently with some probability in every round is actually a quite realistic model for uncorrelated transient channel or network interface failures in homogeneous system architectures, e.g., wireless and ad hoc networks [17, 20, 21].
Various problems have been considered before in a stochastic dynamic network, mainly related to broadcast, gossiping, connectivity and routing, as described in the above cited surveys. In this paper we consider the following problem, which can be viewed as an optimization variant of the classic approximate agreement problem [6]. We assume that processes start with binary input values, execute an algorithm for a fixed number of rounds, and decide values in satisfying the standard validity requirement stating that (1) if all processes start with the same input value, then they should all decide that value, and (2) otherwise, each process can decide any value in . The discrepancy of the algorithm in an execution is the largest difference between any two decided values. Since executions are stochastic, the discrepancy is a random variable, and we seek algorithms with smallest expected discrepancy over all input assignments. For instance, in the case of two processes, and letting , the directed graph induced by the correct links (i.e., the channels through which the messages were delivered) is picked from , where the first two graphs are selected with probability each, the third with probability and the fourth with probability .
1.1 Our Results
We describe algorithms minimizing the expected discrepancy, showing several interesting, surprising behaviors.
-
We first study the case of two processes in detail, proving tight upper and lower bounds on the expected discrepancy. In particular, we prove a lemma, referred to as the Integrality Lemma, stating that, for optimal algorithms, it is sufficient to assume that the processes always decide integral values, either or . We present two algorithms, one that is optimal for , and one that is optimal for . Our lower bound technique shows that stochastic settings can be analyzed by following the algebraic topology approach although the latter was initially designed for analyzing protocols in non-stochastic settings [12].
-
When one considers executions conditioned on the event that at least one message is delivered, it is intuitively clear that, when is large, i.e., when the probability of message delivery is high, it should be possible to obtain small expected discrepancy, namely, going down to as gets closer to . We confirm this intuition with our algorithms. However, we additionally show that this is also the case when is large, i.e. when the probability of message loss is high. As gets closer to , the expected discrepancy of our algorithms also goes down to . In particular, when we discuss the application to randomized consensus, we will see that the probability of error goes down to , both when the probability of message loss is either very low or very high (conditioned on the event that at least one message is delivered).
-
We then move on to the case of processes. We show that the Integrality Lemma does not hold anymore, even for three processes. That is, an optimal algorithm must decide fractional values. As for the case of two processes, we show that there are thresholds for the values of such that, depending on whether the value of is smaller or larger than each threshold, a different algorithm minimizes the expected discrepancy. As mentioned above, for two processes, there is a unique threshold , but we show that, for three processes, there are two thresholds and . We provide optimal algorithms for three processes, one for each interval , , and of message delivery probability .
-
For the case of a large number of processes , we design a 1-round algorithm which guarantees an expected discrepancy that goes to when grows to infinity, except for highly unbalanced input configurations, i.e., when the number of 0s is , or when the number of 1s is . We however show how to adapt our 1-round algorithm for handling all possible input configurations, at the mere expense of one additional round.
-
Finally, to support our claim that minimizing the expected discrepancy could be useful in applications where processes must decide values within a small from each other in most executions, and tolerate few executions with large discrepancy – as for clock synchronization, sensor replication, among others (see, e.g. [9]) – we provide some concrete applications. Specifically, we design algorithms solving randomized binary consensus, and randomized approximate agreement, with small error probability. In fact, for two processes, our randomized approximate agreement algorithm also applies to the case of arbitrary inputs in , or even in , and we can also prove corresponding lower bounds.
Alon et al. [1] consider a model similar to ours, from the information theoretic perspective. They assume binary symmetric channels (BSC), i.e each message is a bit that may be flipped with some constant probability . Their concern is computing a function (while ours is computing a task). Roughly, they show that for , any computation over failure-free channels can be emulated, with high probability, over BSC channels with a constant multiplicative overhead. These results are asymptotic and are not applicable to small values, but they inspired our Theorem 15.
Organization
The model is presented in Section 2. Algorithms for the case of two processes are analyzed in Section 3, and corresponding lower bounds in Section 4, where the integrality lemma is proved. In Section 5 we present our results for the case of more than 2 processes. We discuss applications in Section 6. The conclusions are in Section 7. Some proofs and extensions (i.e. message delivery probabilities that may vary between different channels, and in different rounds, and variance analysis) are omitted from this extended abstract.
2 Model
The stochastic dynamic network model involves a set of processes labeled from 1 to . For each ordered pair of distinct integers, there is a directed channel from process to process . Communication proceeds as a sequence of synchronous rounds. At each round , each of the processes can send one message of arbitrary size to each of the other processes. Every message may however fail to reach its destination: it only succeeds with some probability. Specifically, for each round , and for every message sent by process to process ,
where, for every with , and for every , . When a message is not received, which occurs with probability , it is lost. The sender of a message is not informed of whether the message reached its destination or not. The probabilities , for all and , are parameters of the model, and the processes are aware of their values. We concentrate on the uniform case where there exists such that, for every , and every , , and discuss how to generalize our results in the full version. When there are just two processes, they are referred to as players, and called Alice and Bob.
All our algorithms are deterministic. Note however that the outputs of a deterministic algorithm in our stochastic model are random due to the probabilistic nature of the message delivery. We consider one-shot algorithms, i.e., algorithms that execute a fixed number of rounds, and then each process outputs a value.
We study the following optimization version of approximate agreement, that we refer to as the Agreement Optimization problem.
Definition 1 (Agreement Optimization).
Each process starts with a private input , and decides a value subject to the following two conditions:
- Termination:
-
Every process must terminate in a finite number of rounds, .
- Validity:
-
If all processes start with the same input value then all processes must decide .
The objective is to minimize discrepancy defined as .
In stochastic environments, the discrepancy is a random variable. We will concentrate on minimizing the expected discrepancy. In Section 6 we discuss how this implies minimizing probability of error in consensus and approximate agreement.
We will use several times the following consequence of the Validity condition.
Remark 2.
If processes have the same input value, then they all output that value in any execution. Furthermore, if some processes with input value receives the same input value from some set of processes, and nothing from other processes, then it has to decide .
3 Two player algorithms
We assume in this section, without loss of generality, that Alice has input 0 and Bob has input 1. This assumption is solely for the purpose of presenting the algorithms; none of the two players initially know the input of the other player. We consider only initial configurations with different input values due to Remark 2.
We first consider single round algorithms in Section 3.1, and then extend our results to the case of multiple rounds, in Section 3.2.
3.1 Single round algorithms
In a single round, Alice and Bob send one message each, and hence there are four possible executions, according to whether each message was delivered or not. Remark 2 states that a player who did not receive a message must output its input value. So a single-round protocol can be completely characterized by the outputs made by the players as a response to the reception of a message containing a value different than their input (in all other cases, the output must be equal to the input).
Let us denote by the output of Alice (with input 0) after receiving a message with value 1 from Bob, and similarly denote the output of Bob (with input 1) after receiving value 0 from Alice. Each message is delivered with probability , and dropped with probability .
We consider two types of 1-round algorithms, which as we shall prove, are optimal, each one on its own range of .
- Agreed Meeting Point (AMP):
-
The algorithm specifies an arbitrary meeting point , and sets . That is, if a player receives a value different than its input value, then it outputs ; otherwise it outputs its input value.
- Flip Value (FV):
-
The protocol is the following. If a player receives a value different from its input value, then it outputs ; otherwise it outputs its input value.
Figure 3(3(a)) shows the expected discrepancy of the two algorithms as a function of , as stated in the following theorem. If , either AMP or FV can be used, so long as both players use the same algorithm.
Theorem 3.
The expected discrepancy of any single-round algorithm is at least . This discrepancy is achieved by the AMP algorithm whenever , and by the FV algorithm whenever (and by both if .
Proof.
For any algorithm, let , the difference between the output values in an execution. Note that . The adversary selects probabilistically in each round a directed graph representing the correct links from , where the first two graphs are selected with probability each, the second with probability and the fourth with probability . Thus, the expected discrepancy is
| (1) |
The expected discrepancy is thus a piecewise linear function of . In each “piece,” i.e., in each interval of values, attains its smallest value at one of the endpoints of that interval, depending on the sign of . We therefore now differentiate Eq. (1) with respect to after conditioning on whether is positive or not. We obtain:
| (2) |
We proceed by case analysis.
-
If , then , and therefore the minimum discrepancy is in the low end of the region , i.e., at , where by Eq. (1).
-
If , there are two sub-cases, because, by Eq. (2), is positive if and only if .
-
–
If indeed , then the minimum discrepancy is obtained at the smallest possible value of , i.e., when . In this case, by Eq. (1), .
-
–
If , then and the minimum discrepancy is obtained at the high end of the region, i.e., at , which we have already analyzed.
-
–
In summary, we have
| (3) |
In the case that we get that the minimum discrepancy is for any .
To see that these are the values achieved by the algorithms AMD and FV, consider Figure 1 (discussed in more detail in Section 4.1), where the four possible executions are depicted as edges with directions indicating that a message is delivered. A vertex corresponds the the state of each one of the players at the end of the round. Black vertices correspond to Alice and white vertices to Bob, with their decisions on top of the corresponding vertex. For AMP, the undirected edge where no message arrives has discrepancy , while the two edges where exactly one message arrives have discrepancy and , respectively. Thus, the expected discrepancy is which is equal to , independently of the meeting point . For FV, the bi-directed edge where both messages are delivered has discrepancy , while the two other directed edges have discrepancy , thus the expected discrepancy is .
Assuming at least one message is always delivered, namely, the case when the adversary picks the actual communication graph in the set has been considered in the past, but for non-deterministic adversaries. For , our 1-round algorithms have expected discrepancy , which is the optimal discrepancy when the adversary is non-deterministic e.g. [9, 13]. Remarkably, the expected discrepancy improves, both when the probability of message-loss is reduced, and when it is increased, bypassing the lower bound of the non-deterministic case.
We now consider the assumption that it is never the case that no messages arrive in the round. Remarkably, using our algorithms AMP and FV as before, we can see that the expected discrepancy conditioned on the event that at least one message is delivered is at most for any value of , matching the worst case known bound for non-deterministic adversaries e.g. [9, 13], for two processes. Furthermore, the expected discrepancy improves more and more, both as gets smaller and smaller than , and also as it gets larger than , see Figure 2. Formally, we have the following.
Theorem 4.
For any single-round algorithm, the expected discrepancy, conditioned on the event that at least one message is delivered, is at least . This discrepancy is achieved by the AMP algorithm if , and by the FV algorithm if , and by both if , at a maximum expected discrepancy value of .
3.2 Multiple rounds
Consider now an algorithm running for rounds, for any fixed , known by both processes. Given a single-round algorithm, one simple strategy is replication, i.e., sending the 1-round algorithm message times, so as to decrease the probability that the message is not received from to . We shall see that the replication strategy is optimal only for . Instead, we use any of our single-round algorithms recursively. That is, we used the output of round as the input of round . For simplicity, we can force the inputs to always be in , by using algorithm AMP with meeting point either at or at (algorithm FV satisfies the requirement in any case).
To analyze the expected discrepancy of multiple rounds, we note that the discrepancy of round is a random function (because the execution is stochastic) of a random variable, namely, the discrepancy of round . The main part of the argument is stated as follows.
Lemma 5.
Let be a sequence of independently randomized functions, i.e., for every , and every , is a random variable. Suppose that, for every , there exists such that for all . Then . Similarly, if, for every , for all , then .
Theorem 6.
The expected discrepancy of a -round recursive algorithm is at most if by using AMP, and at most if by using FV.
A recursive algorithm for the case where it is assumed that at least one message is delivered in each round can be derived in a similar way, from Theorem 4 and Lemma 5.
Theorem 7.
The expected discrepancy of a -round recursive algorithm conditioned on the event that at least one message is delivered at each round is at most if by using AMP, and at most if by using FV. Thus, the expected discrepancy is at most for any value of .
4 Lower Bound
In this section, we show that the simple two player algorithms consisting of recursively applying AMP or FV as defined in the previous section have the best possible expected discrepancy.
4.1 Protocol Complexes and Algorithms
We already discussed briefly the notion of protocol complex, only for one round, in Figure 1. We explain it in more detail and generalize it to multiple rounds in Section 4.1.1, and then define the notion of an algorithm for a protocol complex in Section 4.1.2.
4.1.1 The Weighted Protocol Complex
We consider the protocol complex representation of all executions after rounds used in the topology perspective of distributed computing [12]. In the case of two players, this simplicial complex is merely an undirected graph, but we stick to the terminology for consistency. Without loss of generality, we assume full information protocols, that is, every player sends its entire local state at each round. The protocol complex is essentially a representation of the local states of the players in all executions, together with a relation stating which executions are indistinguishable to a process. The local state of a player can be represented as a triple , where
-
and are the binary inputs of Alice and Bob, respectively, where a player sets the input of the other player only once it has received a message from the other, otherwise the value is set , and
-
is the view of the player, that is, its local state, including the sequence of messages it received (and marking those that it did not receive).
The initial state of Alice (resp., Bob) is thus (resp. where (resp., ) is the input of Alice (resp., Bob), and is an empty sequence. An initial configuration thus consists of two initial states, one for Alice and one for Bob. The protocol complex after rounds then consists of a graph. Each vertex is a pair , where and is the local state of process after rounds, in some execution of the algorithm. Two states , belong to an edge of the graph, if there is an round execution, where is the state of , and is the state of . Thus the graph is bipartite: each edge connects vertices of different players.
Notice that the protocol complex at round with any fixed pair of input values , consists of a single edge, whose endpoints are the initial states of and with those inputs. Figure 4(4(a)) represent such an edge at round 0. The black vertex represents Alice in initial state , and the white vertex represents Bob in initial state . The protocol complex at round depicted on Figure 4(4(b)) is a path of three edges, plus an edge connecting the endpoints of the path. This latter edge depicted on top of the path corresponds to the execution of the (full information) protocol where no message arrives, denoted by . The path of three edges corresponds to the three scenarios (message from Alice reaches Bob), (both messages arrive), and (message from Bob reaches Alice). In general, the protocol complex at rounds is obtained from the one at rounds by replacing each edge by the round 1 protocol complex. Figure 4(4(c)) represents the protocol complex after two rounds, starting from fixed inputs.
Note that, in each round,
The probability of an edge in the complex corresponding to a multi-round execution is the product of the probabilities of all the successive scenarios leading to this edge. For instance, the probability of the top edge in Figure 4(4(c)) is (all messages failed at both rounds), whereas the probability of the edge in the middle of the path at the bottom of Figure 4(4(c)) is (all messages arrived during both rounds). More generally, the complex that corresponds to the round execution consists of two nodes and a single edge (see Figure 4(a)), which correspond to the two initial states, and the single possible 0-round (vacuous) execution, whose probability is . We denote this complex by . Given a complex , the complex is obtained by transforming each edge to a 4-node, 4-edge “gadget” denoted , as shown in Figure 5 (recall that the protocol complex in an undirected graph).
In our complexes, the edges are weighted: the weight of an edge is the probability of the corresponding execution. Hence the sum of the edge weights must be . In particular, the weight of the single edge in is . Given an edge in with weight , the edges of the gadget corresponding to that edge in have weights as shown in Figure 5. The rationale is that corresponds to the executions starting in with one additional round, in which either both messages are dropped (the edge) with probability , or both messages are delivered (the edge) with probability , or just one message delivered (the edges and ) with probability .
4.1.2 Algorithm for a Protocol Complex
An -round algorithm for approximate agreement is a deterministic decision function that assigns a real value in to each vertex , , of the protocol complex at round , where is the local state of player . We denote the decision of process by . Remark 2 (Validity) requires that , if no message has been received in , or if a message has been received and the input of the other process is also .
Notice that the decision of a player may depend on the name, or , of that player. It is sometime more convenient to write for the decision of player in state . The algorithm is said to be symmetric if is solely a function of the local state , i.e., if the decision functions of the players are equal, . The discrepancy of the execution is , and the expected discrepancy of the algorithm for this input configuration is taken over all possible -round executions.
As discussed previously, one can assume, without loss of generality, that the input configuration is where has input , and has input .
4.2 Integrality of optimal algorithms
In Section 3.1 we analyzed single round algorithms, and showed that there always exists an optimal algorithm whose only possible output values are and . In this section we consider the general case of two player, -rounds algorithms, and show that the same integrality property holds as well. The idea is the following. For every given input assignment, the discrepancy of an approximate agreement algorithm is a random variable which we wish to minimize. We shall formalize the problem as an optimization problem, which we then convert into a linear program. The result will follow from the fact that the optimal solution is at a vertex of the polytope defined by the constraints.
Lemma 8 (Integrality Lemma).
There is an optimal algorithm with optimal expected discrepancy in which every player outputs only or .
Proof.
Given an -round algorithm, each possible execution (specifying which messages are delivered) has a probability , which can be computed from the model parameters. Since the view at a process, along with its local input, determines the output value of that process, we know that given all inputs and local views, all outputs are determined, and therefore the discrepancy is determined as well. Let denote the input assignment. There are 4 possible input assignments. If , validity implies that both players output this value, and the discrepancy is . We hence focus on the case where . Without loss of generality, we assume that and . Given an algorithm, let us denote its outputs by . Let denote the set of all possible -round executions for the given input. Given an execution , let denote the view of process in . Then an algorithm is optimal if its expected discrepancy for the given input has the same value as the solution to the following optimization problem.
| (4) |
subject to
| (5) |
(Abusing notation, we use in Eq. (5) to also denote the set of values in the view.)
The constraints force the output values to be within the range spanned by their input value, and the values they received. We stress that the variables are and . The values of and are fixed, and the probabilities are constants whose values are fixed by the stochastic environment model.
Observe that Eq. (4) and (5) do not specify a linear program, due to the absolute values in Eq. (4) – the min and max operators in Eq. (5) are applied to constants as far as the minimization of is concerned as, for a given player and a given execution , and are constants, and so is the smallest (or largest) input value in .
We get around the non-linearity as follows. Consider an optimal solution to the problem specified by Eq. (4) and (5). Let denote the multiset of all possible values for the given input, one for each party and each execution. Now, let , for an appropriately large , be the sequence of all values in in increasing order. If we knew the order of the values, then we could have replaced the expression with , where and are the larger and the smaller values of , respectively. To complete the transformation of the optimization problem defined by Eq. (4) and (5) into a linear program, we make sure that the variables respect the assumed ordering by adding the constraints
| (6) |
Now, the transformed target function Eq. (4), where a simple subtraction of the values replaces the absolute value expression in each term, and the constraints Eq. (5) and Eq. (6), where the original variables replace their pseudonyms, is a linear program. If the ordering according of the values agrees with an optimal solution, then the additional constraints of Eq. (6) do not change the target value. In other words, there exists an ordering of the values such that the optimal algorithm is a solution to the corresponding linear program.
Finally, as mentioned above, if both inputs are the same, the output equals the input value, and the claim is immediate. Otherwise, consider the polytope defined by Eq. (5) using the variables and Eq. (6). The vertices of this polytope are , when the coordinates are ordered according to the ordering. Since there is always an optimal solution at a vertex, the result follows.
Remark 9.
Note that an optimal solution may actually be attained at multiple vertices, in which case all their convex combinations (whose coordinates need not be 0 or 1) are also optimal solutions.
Lemma 8 narrows down the number of candidates for an optimal solution to a finite number of possible algorithms, so in principle one can enumerate all possible 0/1 output values for all inputs and executions to find an optimal solution. But this is hardly practical: The number of possibilities we need to enumerate for a -round, -player protocol, even in the case of symmetric algorithms, is doubly-exponential.
4.3 The Lower Bound
We have now all the ingredients to prove a lower bound on the expected discrepancy of any -round protocol. To this end, fix an algorithm and a number of rounds . We focus on the instance where Alice gets input , and Bob gets input .
We study the protocol complex of after rounds. In this complex, each edge is associated with some probability (depending on the message deliveries in that execution), and a certain discrepancy (depending on the output values defined by the decision function of the protocol, in the local states at the edge endpoints). By Lemma 8 we may assume w.l.o.g. that the output values are only and . We can therefore partition the vertices of the protocol complex into the set of vertices whose output is 0 and the set of vertices whose output is 1. All edges within a set correspond to executions with discrepancy , and all edges that connect vertices in different sets correspond to executions with discrepancy . The expected discrepancy is therefore simply the sum of the probabilities of the edges that connect the different sets. In graph theoretic terms, if we view the probability of an execution as the weight of the corresponding edge in the protocol complex, the expected discrepancy is the weight of the edges in the cut defined by the output values. Our goal of obtaining a lower bound on the expected discrepancy can be restated as bounding from below the weight of cuts in the protocol complex.
Let denote the two nodes in the 0-round protocol complex (see Figure 4(a)). These nodes correspond to the local states of and , respectively, where no message is ever received. With these local states, by the validity requirement (Remark 2), and are forced to output their input values, namely and , respectively. We are thus interested in bounding from below the weight of - cuts in the -round protocol complex .
Let be a graph with edge weights, and let be two distinct nodes in . Recall that an - cut of , denoted is a partition of into two subsets and where and . The weight of , denoted by , is the sum of weights of edges with one endpoint in and another in .
Recall from Section 4.1.1 that is the protocol complex graph of one round executions starting in .
Lemma 10.
Let be an edge of weight . Then the weight of the min-weight - cut of is .
Proof.
Note that if and if . Also note that unless , that is, unless no message can ever be delivered. We refer to Figure 5 for an illustration. The edge in must be in the cut, contributing weight. Out of the three edge and we take an edge of minimal weight, i.e., if and otherwise either or , adding a weight of . In total, the cut weight is
as claimed.
Lemma 11.
Let . If there exists an - cut of weight in then there exists an - cut in of weight at most , where and are the two nodes of .
Proof.
Let be an - cut of . Let and . Consider the cut of . This cut is well defined because . For each edge that crosses the cut in we have that, in too, and . Therefore some of the edges of cross the cut ) as well. By Lemma 10, min-weight cut that separates the endpoints of in have weight . Since the edges of different gadgets are disjoint, it follows that
and the result follows.
We can now establish that our algorithms have optimal expected discrepancy.
Theorem 12.
For every , every -round algorithm has expected discrepancy at least .
Proof.
It is sufficient to show that if denote the nodes of the protocol complex , then the weight of any - cut in the -round protocol complex is at least . We proceed by contradiction. If there was a cut of with weight , then, by repeated application of Lemma 11, we would infer that there exists an - cut of of weight smaller than , which is impossible, as the only - cut in is , whose weight is by definition.
5 The case of more than two players
In this section we show that having more than 2 players changes the picture in a profound way. We first show that the integrality lemma does not hold, even for 3 players. We also show that when the number of players is large, 0 discrepancy can be achieved with overwhelming probability in two rounds, or in one round if the number of players with each value is slightly larger than a constant.
5.1 Integrality does not hold for more than 2 players
The linear program of Section 4.2 can be extended to any number of players as follows. While the constraints of Eq. (5) must always be maintained, the target function of Eq. (4) changes. In Eq. (4), we are minimizing the expected discrepancy of a single input assignment. This is fine for the two-party case, because there is only one non-trivial input in this case (namely ). However, this is no longer true for more than two players: For example, if there are parties, there are two non-isomorphic nontrivial input assignments: and . This means that our goal is to minimize the maximum of the discrepancies of the different inputs.
To deal with this, we introduce a new variable, say (the goal of the linear program is to minimize ), and a new constraint for each input assignment. Specifically, for each input assignment , let denote the set of all executions with input assignment , and for any execution , let be the discrepancy of the outputs in . Then, for each input assignment , we introduce the constraint (similarly to the expression in the r.h.s. of Eq. (4).) Since the goal is to minimize , the program will find the outputs which minimize the worst-case discrepancy, over all inputs.
However, the new constraints change the polytope and create vertices in non-integral coordinates. Indeed, we have computed the optimal 1-round for 3 players using the linear program formulation. The optimal protocol sometimes decides : see Figure 6 for a specification of the optimal protocol according to the value of . Interestingly, the output value is not used when is small. The expected discrepancy for the three strategies is plotted in Figure 7.
Consider a player with input .
-
: use AMP, with meeting point at . I.e., if received (once or twice), output , otherwise output .
-
: if received twice, output ; if received once, output ; otherwise output .
-
: if received (once or twice) or received nothing, output ; otherwise (received no and at least one ), output .
5.2 Asymptotic Analysis as the Number of Players Grows
We have seen that already for three players the optimal expected discrepancy behaves differently than for two players. At the extreme end of the spectrum we have the case of players, with . It turns out that 2 rounds suffice in this case to guarantee 0 discrepancy with high probability. In fact, 0 discrepancy can also be guaranteed w.h.p. in 1 round, if the minority is not too small.
Let us start with the case of one round. We use AMP with any meeting point. Note that the probability that a process does not receive a value decreases exponentially with the number of times that value is sent. Therefore, when one of the values (say 1) is held by a sublogarithmic number of players, there is non-negligible probability that at least one of the other players (with input 0) does not receive any 1 message. Formally, for any and , let
Theorem 14.
The expected discrepancy of AMP, satisfies , for any meeting point , when .
Proof.
To analyze the behavior of AMP, we use the following shorthand for .
Note that is exactly the probability that in , each of the 0-players received at least one 1 message (from the 1-players).
Note further that for constant , we have that . Therefore, for , i.e., we have that .
Now, for Algorithm AMP, directly from definitions we have
| (7) | ||||
| (8) | ||||
| (9) | ||||
| (10) |
In particular, Eq. (7) implies the probability of consensus approaches when grows and is neither too small nor too large. Regarding discrepancy, Eqs. 7–10 imply that the expected discrepancy of AMP is .
To cover the case of small minority (of size ) we “amplify” its presence with another round of communication. Specifically, we have the following algorithm, biased toward output 1.
Algorithm Boost1
-
1.
Round 1: if the local input is 1, send it to all.
-
2.
Round 2: if the local input or any value received in Round 1 is 1, send 1 to all.
-
3.
If the local value is 1 or any value received is 1, decide 1. Otherwise decide 0.
Theorem 15.
The expected discrepancy of Algorithm Boost1 approaches as the number of players goes to infinity.
Proof.
We prove a stronger statement, namely that the probability that the discrepancy is 0 is , where is the number of players. To see that, note first that if all inputs are 0 the statement is trivial: Boost1 does not send any message in this case, and all processes decide 0. So suppose, without loss of generality, that process 1 has input 1. We show that all other processes decide 1 after 2 rounds, regardless of their initial value. To this end, consider some process . Process does not receive the 1 message if for every process (including and ), either the first round message from process to was dropped, or the send round message from to was dropped. Since this happens with probability at most (considering also ), we have
and hence, by the Union Bound,
The discrepancy therefore satisfies for any constant .
6 Applications
In this section we present some examples about the use of agreement optimization to solve randomized consensus and approximate agreement.
6.1 Randomized consensus
Consensus in the case of synchronous reliable processes when messages can be lost is called coordinated attack since [10] (also two generals’ problem). The randomized coordinated attack [22], or for arbitrary number of processes, randomized consensus, see, e.g., [2, p.66], for a given desired upper bound error probability , is defined by the following conditions, for processes starting with binary input values, and agreeing on binary output values.
Randomized Consensus
- Termination:
-
All processes terminate in a bounded number of rounds, .
- Validity:
-
If all processes start with the same value, that is the only value that can be decided.
- Randomized agreement:
-
The probability that some process decides and some other process decides is at most .
A straightforward application of Markov-like inequality gives the following result, for any number of players.
Theorem 16.
Let be an algorithm for agreement optimization with possible output discrepancy values . If the expected discrepancy of is , then solves randomized consensus with error probability .
Since our 2-party algorithms produce discrepancy either or , we have the following result.
Corollary 17.
For any given , two-player randomized consensus can be solved in rounds with error probability at most . Moreover, no protocol can solve randomized consensus in rounds with probability larger than .
6.2 Approximate Agreement
The usual -approximate agreement problem requires processes to decide values at most apart. Here we define a relaxed version, allowing an error of . Formally, it requires the following to hold.
-Approximate Agreement
- Termination:
-
All processes terminate in a bounded number of rounds, .
- Validity:
-
The value decided by every processor is in the range spanned by all input values.
- Randomized -Agreement:
-
The probability that the discrepancy is larger than is at most .
In the classic version of approximate agreement [6], the input values are arbitrary real numbers. Input values in a bounded region such as , have also been considered e.g. [19]. The number of rounds depends on . In fact, it may depend also on the discrepancy of the input values (the maximal distance between inputs) or even their magnitude, see e.g. [3]. The relative discrepancy agreement optimization can be defined as its discrepancy normalized by the discrepancy of the input values.
We have the following consequence of our lower bound on the expected discrepancy of agreement optimization. It is stated for inputs in (it could be rephrased in terms of the discrepancy of the inputs)
Theorem 18.
Any algorithm for two player -Approximate Agreement that terminates in rounds when the inputs are binary must have probability of error of at least .
We can also derive upper bounds on -Approximate Agreement using agreement optimization, for the case of 2 players with arbitrary real input values, as follows.
First, note that non-binary inputs may be a problem for algorithms such as AMP: where should the meeting point be located? If we fix the location in advance, validity may be violated. And if a process computes it based on the values it has seen, the meeting point may be different at different processes because their views may be different. However, this is easily solvable in the case of two processes. The point is that the agreed meeting point is used only when two values are known, and in the case of two processes, if both their views contain two values, they must contain the same two values, so it is possible to specify a common meeting point.
Specifically, consider the following algorithm for .
Algorithm Scaled AMP (2 players, arbitrary input values in )
-
If no value is received, output the input value.
-
Otherwise, denote the local input and the 4 value by and . Output .
Clearly, scaled AMP is a generalization of AMP to any input values, assuming there are only two players. Since Algorithm FV also works with arbitrary input values, we arrive at the following result.
Theorem 19.
Let . Assume that . Then 2-player -Approximate Agreement can be solved with probability in rounds with relative discrepancy .
We note that we have not attempted to optimize the constants. For the case of , we use the recursive FV algorithm and the following similar statement holds.
Theorem 20.
Let . Assume that . Then 2-player -Approximate Agreement can be solved in rounds with relative discrepancy .
The nice property of scaled AMP is that it allows us to use AMP with in the recursive version, thus obtaining a “continuous” algorithm, i.e., an algorithm in which the discrepancy shrinks (probabilistically) in each round, rather than algorithms in which the discrepancy is either 0 or 1.
Theorem 21.
The optimal relative discrepancy of 2-party approximate agreement by a -round algorithm is , achieved by recursive applications of algorithm FV if of scaled AMP (with any ) for .
7 Conclusion
In this paper we have considered a stochastic dynamic network model consisting of synchronous, reliable processes communicating through channels that may drop messages with a given probability . We defined the agreement optimization problem, where the goal is to minimize the expected discrepancy. For the case of two players, we provided a detailed characterization of the achievable expected discrepancy. To this end we developed the Integrality Lemma, showing that it is sufficient to consider algorithms with outputs in . Going beyond , we showed that the problem becomes much more complicated: this lemma no longer holds, and optimal algorithms may have more different behaviors depending on the parameter , while in the case of two players, there are only two possible behaviors, for either smaller or larger than . We also presented algorithms for large number of processes, whose expected discrepancy goes down to exponentially fast. Finally, we showed the relevance of the agreement optimization problem to obtain algorithms for randomized consensus and randomized approximate agreement, with small probability of error.
We leave many interesting open problems for future work. A main question is to find optimal algorithms for agreement optimization for any number of processes . Our analysis of agreement optimization is mostly under the simplest stochastic assumption, with a single parameter , known to all processes. The full version extends some of our results the case where the parameter may be different in different links or rounds, but there are many other stochastic models that have been considered in the past, as mentioned in the Introduction, for which agreement optimization has not been studied, e.g. a model where the links are unidirectional (and each one fails with probability ).
The analysis of our algorithms was performed by considering a weighted version of the protocol complex of the topology approach to distributed computing, which is, up to our knowledge, new. It would be interesting to extend it to processes.
We have considered binary consensus and -dimensional approximate agreement. It would be interesting to consider multi-valued versions of consensus, e.g., [18], and multi-dimensional versions of approximate agreement [15]. Regarding other tasks, several have already been studied in dynamic networks, such as -consensus [17] and set agreement [4, 8], but not in our stochastic setting.
References
- [1] Noga Alon, Mark Braverman, Klim Efremenko, Ran Gelles, and Bernhard Haeupler. Reliable communication over highly connected noisy networks. Distributed Comput., 32(6):505–515, 2019. doi:10.1007/S00446-017-0303-5.
- [2] James Aspnes. Notes on theory of distributed systems, 2023. arXiv:2001.04235.
- [3] Hagit Attiya and Faith Ellen. The Step Complexity of Multidimensional Approximate Agreement. In Eshcar Hillel, Roberto Palmieri, and Etienne Rivière, editors, 26th International Conference on Principles of Distributed Systems (OPODIS 2022), volume 253 of Leibniz International Proceedings in Informatics (LIPIcs), pages 6:1–6:12, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.OPODIS.2022.6.
- [4] Martin Biely, Peter Robinson, Ulrich Schmid, Manfred Schwarz, and Kyrill Winkler. Gracefully degrading consensus and k-set agreement in directed dynamic networks. Theor. Comput. Sci., 726:41–77, 2018. doi:10.1016/J.TCS.2018.02.019.
- [5] Michael Dinitz, Jeremy Fineman, Seth Gilbert, and Calvin Newport. Smoothed analysis of information spreading in dynamic networks. J. ACM, 71(3), June 2024. doi:10.1145/3661831.
- [6] Danny Dolev, Nancy A. Lynch, Shlomit S. Pinter, Eugene W. Stark, and William E. Weihl. Reaching approximate agreement in the presence of faults. J. ACM, 33(3):499–516, May 1986. doi:10.1145/5925.5931.
- [7] Antoine El-Hayek, Monika Henzinger, and Stefan Schmid. Broadcast and Consensus in Stochastic Dynamic Networks with Byzantine Nodes and Adversarial Edges. In Dan Alistarh, editor, 38th International Symposium on Distributed Computing (DISC 2024), volume 319 of Leibniz International Proceedings in Informatics (LIPIcs), pages 21:1–21:15, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.DISC.2024.21.
- [8] Pierre Fraigniaud, Minh Hang Nguyen, and Ami Paz. A Simple Lower Bound for Set Agreement in Dynamic Networks, pages 253–262. SIAM, 2025. 2025 Symposium on Simplicity in Algorithms (SOSA). doi:10.1137/1.9781611978315.20.
- [9] Matthias Függer, Thomas Nowak, and Manfred Schwarz. Tight bounds for asymptotic and approximate consensus. J. ACM, 68(6), October 2021. doi:10.1145/3485242.
- [10] Jim Gray. Notes on data base operating systems. In Michael J. Flynn, Jim Gray, Anita K. Jones, Klaus Lagally, Holger Opderbeck, Gerald J. Popek, Brian Randell, Jerome H. Saltzer, and Hans-Rüdiger Wiehle, editors, Operating Systems, An Advanced Course, volume 60 of Lecture Notes in Computer Science, pages 393–481. Springer, 1978. doi:10.1007/3-540-08755-9_9.
- [11] Sandra M. Hedetniemi, Stephen T. Hedetniemi, and Arthur L. Liestman. A survey of gossiping and broadcasting in communication networks. Networks, 18(4):319–349, 1988. doi:10.1002/net.3230180406.
- [12] Maurice Herlihy, Dmitry N. Kozlov, and Sergio Rajsbaum. Distributed Computing Through Combinatorial Topology. Morgan Kaufmann, 2013.
- [13] Gunnar Hoest and Nir Shavit. Toward a topological characterization of asynchronous complexity. SIAM J. Comput., 36(2):457–497, 2006. doi:10.1137/S0097539701397412.
- [14] Fabian Kuhn and Rotem Oshman. Dynamic networks: models and algorithms. SIGACT News, 42(1):82–96, 2011. doi:10.1145/1959045.1959064.
- [15] Hammurabi Mendes, Maurice Herlihy, Nitin H. Vaidya, and Vijay K. Garg. Multidimensional agreement in byzantine systems. Distributed Comput., 28(6):423–441, 2015. doi:10.1007/S00446-014-0240-5.
- [16] Othon Michail and Paul G. Spirakis. Elements of the theory of dynamic networks. Commun. ACM, 61(2):72, January 2018. doi:10.1145/3156693.
- [17] Henrique Moniz, Nuno Ferreira Neves, Miguel Correia, and Paulo Veríssimo. Randomization can be a healer: consensus with dynamic omission failures. Distributed Computing, 24(3):165–175, 2011. doi:10.1007/s00446-010-0116-2.
- [18] Achour Mostéfaoui, Michel Raynal, and Frederic Tronel. From binary consensus to multivalued consensus in asynchronous message-passing systems. Inf. Process. Lett., 73(5-6):207–212, 2000. doi:10.1016/S0020-0190(00)00027-2.
- [19] E. Schenk. Faster approximate agreement with multi-writer registers. In Proceedings of IEEE 36th Annual Foundations of Computer Science, pages 714–723, 1995. doi:10.1109/SFCS.1995.492673.
- [20] Ulrich Schmid. Failure model coverage under transient link failures. Technical report, Research Report 2/2004, Technische Universität Wien, Institut für Technische Informatik, 2004, 2008. URL: https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=35b27320d6e1c34ef233f178411d20973d7813f5.
- [21] Ulrich Schmid, Bettina Weiss, and Idit Keidar. Impossibility results and lower bounds for consensus under link failures. SIAM Journal on Computing, 38(5):1912–1951, 2009. doi:10.1137/S009753970443999X.
- [22] George Varghese and Nancy A. Lynch. A tradeoff between safety and liveness for randomized coordinated attack. Information and Computation, 128(1):57–71, 1996. doi:10.1006/inco.1996.0063.
