5.2 Rapid Simulation Model Development: Current Status
5.2.3 Knowledge Based / Artificial Intelligence Approaches
A token-forwarding algorithm for solving the gossip problem is an algorithm that does not manip-ulate the tokens in any way except storing and forwarding them. Specifically, the algorithm must satisfy the following conditions. Letπ πΊπ’(π)denote the message broadcast by node π’in round π, when the algorithm is executed in dynamic graphπΊ= (π, πΈ).
1. π πΊπ’(π)β π― βͺ {β₯}for all roundπand nodesπ’.
2. Nodes can only learn new tokens by receiving them, either in their input or in a message from another node. Formally, letπ πΊπ’(π) :={
π πΊπ£(π)β£ {π’, π£} βπΈ(π)}
denote the set of messages π’receives in roundπ, and let
π΄πΊπ’(π) :=πΌ(π’)βͺ (πβ1
βͺ
πβ²=0
π πΊπ’(πβ²) )
. We require the following.
β π πΊπ’(π)βπ΄πΊπ’(π)βͺ {β₯}for all nodesπ’and roundsπ, and
β If nodeπ’terminates in roundπ, thenπ΄πΊπ’(π) =πΌ.
We omit the superscriptπΊwhen it is obvious from the context.
6.1 Ξ©(πlogπ) Lower Bound for Centralized π-Gossip in 1-Interval Connected Graphs
For this lower bound we assume that in each roundπ, some central authority provides each nodeπ’ with a valueπ‘π’(π)βπ΄π’(π)to broadcast in that round. The centralized algorithm can see the state and history of the entire network, but it does not know which edges will be scheduled in the current round. Centralized algorithms are more powerful than distributed ones, since they have access to more information. To simplify, we begin with each of theπtokens known to exactly one node.
This restriction is not essential. The lower bound holds as long as there is constant fraction of the nodes that still need to learnππΏtokens for some positive constantπΏ.
We observe that while the nodes only know a small number of tokens, it is easy for the algorithm to make progress; for example, in the first round of the algorithm at leastπnodes learn a new token, because connectivity guarantees thatπnodes receive a token that was not in their input. As nodes learn more tokens, it becomes harder for the algorithm to provide them with tokens they do not already know. Accordingly, our strategy is to charge a cost of1/(πβπ)for theπ-th token learned by each node: the first token each node learns comes at a cheap1/π, and the last token learned costs dearly (1). Formally, the potential of the system in roundπ is given by
Ξ¦(π) :=β
π’βπ
β£π΄π’(π)β£β1
β
π=0
1 πβπ.
In the first round we haveΞ¦(0) = 1, becauseπnodes know one token each. If the algorithm terminates in roundπ then we must haveΞ¦(π) =πβ π»π = Ξ(πlogπ), because allπnodes must know all π tokens. We construct an execution in which the potential increase is bounded by a constant in every round; this gives us anΞ©(πlogπ)bound on the number of rounds required.
Theorem 6.1. Any centralized algorithm for π-gossip in 1-interval connected graphs requires Ξ©(πlogπ)rounds to complete in the worst case.
Proof. We construct the communication graph for each roundπin three stages.
Stage I: Adding the free edges. An edge{π’, π£}is said to be free ifπ‘π’(π) βπ΄π£(π)and π‘π£(π)β π΄π’(π); that is, if we connect π’and π£, neither node learns anything new. LetπΉ(π) denote the set of free edges in roundπ; we add all of them to the graph. Let πΆ1, . . . , πΆβ denote the connected components of the graph(π, πΉ(π)). Observe that any two nodesπ’andπ£in different components must send different values, otherwise we would clearly haveπ‘π’(π)βπ΄π£(π)andπ‘π£(π)βπ΄π’(π)and π’andπ£would be in the same component.
We choose representatives π£1 β πΆ1, . . . , π£β β πΆβ from each component arbitrarily. Our task π£ , . . . , π£
thatββ₯6, otherwise we can connect the nodes arbitrarily for a constant cost. Letmissing(π’) :=
πβ β£π΄π’(π)β£denote the number of tokens nodeπ’does not know at the beginning of roundπ.
Stage II: We split the nodes into two sets Top, Bottom according to the number of tokens they know, with nodes that know many tokens βon topβ: Top := {π£πβ£missing(π£π)β€β/6} and consequentlyBottom :={π£πβ£missing(π£π)> β/6}.
Since top nodes know many tokens, connecting to them could be expensive. We will choose our edges in such a way that no top node will learn a new token, and each bottom node will learn at most three new tokens. We begin by bounding the size ofTop.
To that end, notice thatβ
π’βTopmissing(π’)β₯(β£Topβ£
2
): for allπ, πsuch thatπ’, π£ βTop, either π‘π’(π) ββ π΄π£(π) or π‘π£(π) ββ π΄π’(π), otherwise {π’, π£} would be a free edge and π’, π£ would be in the same component; therefore each pairπ’, π£ β Top contributes at least one missing token to the sum. On the other hand, since each node in Top is missing at mostβ/6 tokens, it follows that
β
π’βTopmissing(π’) β€ β£Topβ£ β (β/6). Putting the two facts together we obtainβ£Topβ£ β€β/3 + 1, and consequently alsoβ£Bottomβ£=ββ β£Topβ£ β₯2β/3β1.
Stage III: Connecting the nodes. The bottom nodes are relatively cheap to connect to, so we connect them in an arbitrary line. In addition we want to connect each top node to a bottom node, such that no top node learns something new, and no bottom node is connected to more than one top node (see Fig. 1. That is, we are looking for a matching using only the edges π :=
{{π’, π£} β£π’βTop, π£ βBottom andπ‘π£ βπ΄π’(π)}.
Since each top node is missing at mostβ/6tokens, and each bottom node broadcasts a different value, for each top node there are at leastβ£Bottomβ£ ββ/6edges inπ to choose from. But since we assumeββ₯6,β£Topβ£ β€β/3 + 1β€ β£Bottomβ£ ββ/6; thus, each top node can be connected to a different bottom node usingπ-edges.
What is the total cost of the graph? Top nodes learn no tokens, and bottom nodes learn at most two tokens from other bottom nodes and at most one token from a top node. Thus, the total cost is bounded by
β
π’βBottom
min{3,missing(π’)}
β
π=1
1
missing(π’)β(πβ1) β€ β£Bottomβ£ β 6
β 6
β€ββ 36 β = 36.
6.2 Ξ©(π + π2/π») lower bound against knowledge-based token-forwarding algo-rithms
In this section we describe a lower bound against a restricted class of randomized token-forwarding algorithms. We represent randomness as a random binary string provided to each node at the beginning of the execution. In every round, the nodes may consume a finite number of random bits, and use them to determine their message for that round and their next state. In every execution nodes only use finitely many coin tosses; we use an infinite string when modelling the algorithm in order to avoid
π£π1 π£π2 π£π3 π£π4
π£π5 π£π6 π£π7 π£π8 π£π1 π£π2
missingβ€β/6tokens missing> β/6tokens Top
Bottom
Figure 1: Illustration for the proof of theΞ©(πlogπ)lower bound
A token-forwarding algorithm is said to be knowledge-based if it can be represented as a col-lection of functions{ππ’β£π’β π°} β π«(π―)βΓ {0,1}β β π·(π―), such that in every round π, ifπ is the sequence of coin-tosses for nodeπ’ up to roundπ (inclusive), the distribution according to which nodeπ’decides which token to broadcast is given byππ’(π΄π’(0). . . , π΄π’(π), π ).
We say that two dynamic graphs πΊ = (π, πΈ) and πΊβ² = (πβ², πΈβ²) are equal up to roundπ if π =πβ²and for allπβ² < πwe haveπΈ(πβ²) =πΈβ²(πβ²). Letπ·π’(π)denote the probability distribution for nodeπ’in roundπ. Knowledge-based algorithms have the following property.
Lemma 6.2. LetπΊ, πΊβ² be two dynamic graphs that are equal up to roundπ, and let(π, πΌ)be an instance of gossip. If π’ is a node such thatπ΄πΊπ’(π) = πΌ, then for any round πβ² β₯ 0 and string π β {0,1}πwe haveπ·π’πΊ(πβ², π ) =π·π’πΊβ²(πβ², π ).
Proof. SinceπΊandπΊβ²are equal up to roundπ, the sequencesπ΄πΊπ’(0). . . π΄πΊπ’(π)andπ΄πΊπ’β²(0). . . π΄πΊπ’β²(π) are equal, and in particularπ΄πΊπ’(π) =π΄πΊπ’β²(π) =πΌ.
By definition, for all πβ² β₯ π we have π΄πΊπ’(π) β π΄πΊπ’(πβ²) and π΄πΊπ’β²(π) β π΄πΊπ’β²(πβ²); there-fore, π΄πΊπ’(πβ²) = π΄πΊπ’β²(πβ²) = πΌ for all πβ² β₯ π. Consequently, for all πβ² β₯ 0, the sequences π΄πΊπ’(0). . . π΄πΊπ’(πβ²)andπ΄πΊπ’β²(0). . . π΄πΊπ’β²(πβ²)are equal, and the claim follows.
Theorem 6.3. Any knowledge-based token-forwarding algorithm forπ-input gossip inπ-interval connected graphs overπnodes requiresΞ©(π+ππ/π)rounds to succeed with probability at least 1/2. Further, ifβ£π°β£ = Ξ©(π2π/π), then for sufficiently largeπ, deterministic algorithms require Ξ©(π+ππ/π)rounds even when each node begins with at most one token.
Proof. A lower bound ofΞ©(π)is demonstrated trivially in a static line network where at least one π >1.
Let{ππ’} be an knowledge-based token-forwarding algorithm for π-gossip. We use the UID space as the token domain, and choose nodesπ’1, . . . , π’π: for randomized algorithms we choose the UIDs arbitrarily, but for deterministic algorithms we must choose them carefully (see the last part of the proof). If the algorithm is randomized, we choose an input assignment where some nodeπ’1starts with allπtokens, and all other nodesπ’π β=π’1 start with a setπΌ(π’π) β {π’1, π’π}. For deterministic algorithms, we later show that we can reach this state from some input assignment where each node starts with at most one token. For now let us suppose that we have reached some roundπ0 in whichπ΄π’1(π0) =πΌ and for allπ’π β=π’1we haveπ΄π’π β {π’1, π’π}. In this starting state there areπβ2nodes that do not know each tokenπ‘β=π’1. We abuse notation by usingπΌto denote the set of all tokensπ’1, . . . , π’πas well as the input assignmentπΌ(π’π)to each nodeπ’π.
Letπ1 :=π0+ (πβ2)(πβ2)/(4π). For a tokenπ‘βπΌ, letE [#π‘]denote the expected number of times tokenπ‘is broadcast byπ’between roundsπ0andπ1(exclusive). We have
β
π‘βπΌ
E [#π‘] =β
π‘βπΌ π1β1
β
π=π0+1
Pr [π‘is broadcast in roundπ] =π1βπ0β2<(πβ2)(πβ2)/(4π).
Thus, there are at least two tokens π‘ β= π‘β² such that E [#π‘],E [#π‘β²] < (πβ2)/(4π). Assume w.l.o.g. thatπ‘β=π’1. From Markovβs inequality, nodeπ’1broadcastsπ‘less than(πβ2)/(2π)times with probability at least1/2in any execution fragment starting from roundπ0 and ending before round π1, regardless of the dynamic graph we choose. The idea in the proof is to use π’1 as a buffer between the nodes that have already learnedπ‘and those that have not; sinceπ’1broadcasts π‘ infrequently with high probability, in this manner we can limit the number of nodes that learnπ‘.
We divide the rounds betweenπ0 andπ1 into segments πΌ1, . . . , πΌπ. The graph remains static during each segment, but changes between segments. For each segmentπΌπwe define two sets of nodes,πΆπ andπ·π, whereπΆπβ©π·π ={π’1}. The nodes inπ·π are βcontaminated nodesβ that might know tokenπ‘at the beginning of the segment; we connect them in a clique. The nodes inπΆπare
βcleanβ: initially, except forπ’1, these nodes do not knowπ‘ (some of them might learnπ‘ during the segment). The only way the nodes inπΆπ can learnπ‘is ifπ’1 broadcasts it. In the first segment πΆπ is arranged in a line withπ’1 at one end; in subsequent segments we βcloseβπΆπto form a ring.
Initiallyπ·1 ={π’1, π‘}andπΆ1 =π β {π‘}(recall thatπ‘, in addition to being a token, is also the UID of a node).
There are two types of segments in our construction.
β Quiet segments are ones in whichπ’1does not broadcastπ‘until the last round in the segment.
In the last round of a quiet segment, π’1 broadcasts π‘, and some nodes in the ring become contaminated. The first segmentπΌ1is a quiet segment.
β After every quiet segment there follows one or more active segments, in which we clean up the ring and move contaminated nodes from πΆπ to π·π. We have to do this in a way that preserves π-interval connectivity. Each active segment is triggered byπ’1 broadcastingπ‘in the previous segment; if in some active segmentπ’1 does not broadcastπ‘, the next segment will be quiet.
An active segment lasts exactlyπrounds, and a quiet segment lasts until the first timeπ’1broadcasts π‘(including that round).
Next we define in detail the construction of the communication graph in each segment. We maintain the following property:
(β ) At the beginning of each active segmentπΌπ, of all the nodes inπΆπ, onlyπ’1 and at most π nodes in theπ-neighborhood ofπ’1in the ring know tokenπ‘. Further, all the nodes that know π‘are on the same side ofπ’1. We refer to the side ofπ’1where these nodes are located as the contaminated side ofπ’1.
(β β ) At the beginning of each quiet segmentπΌπ, nodeπ’1is the only node in the ring that knows tokenπ‘.
Letπ£1, . . . , π£πβ2be some ordering of the nodes inπΆ1β {π’1}(nodes that initially do not know π‘). In each segmentπthe nodes inπΆπ will be some contiguous subsetπ£πΏπ, . . . , π£π π, whereπΏπ+1 β₯ πΏπ β₯1andπ π+1 β€π π β€πβ2for allπ. We placeπ’1betweenπ£πΏπ andπ£π π in the ring. Formally, the edges in any roundπβπΌπwhereπ >1are given by
πΈ(π) :=π·(2)π βͺ {{π£π, π£π+1} β£πΏπ β€π < π π} βͺ {{π’1, π£πΏπ},{π’1, π£π π}}.
In the first segment, the edges areπΈ(π) :=π·1(2)βͺ {{π£π, π£π1} β£1β€π < πβ2} βͺ {{π’1, π£1}}(we do not close the ring; this is to ensure that (β ) holds for the first active segment).
IfπΌπ is a quiet segment, then we defineπΆπ+1 := πΆπ (and consequently π·π+1 := π·π); that is, the network does not change betweenπΌπandπΌπ+1(except possibly for the closing of the ring after the first segment). However, ifπΌπ is an active session, thenπ’1 has some neighbors in the ring that knowsπ‘, and they might spreadπ‘to other nodes even whenπ’1does not broadcastπ‘. We divide the nodes inπΆπβ {π’1}into three subsets.
β The red nodesredπcomprise the2π nodes adjacent toπ’1on the contaminated side. The first π of these (the ones closer toπ’1) may knowπ‘at the beginning of the segment; the otherπ may become contaminated if some of the firstπ broadcast tokenπ‘. To be safe, we treat all red nodes as though they knowπ‘by the end of the session.
β The yellow nodes yellowπ comprise theπ nodes adjacent toπ’1on the uncontaminated side.
These nodes may learnπ‘during the segment, but only ifπ’1broadcasts it.
β The green nodesgreenπare all the other nodes in the ring. These nodes cannot become con-taminated during the segment, because their distance from any node that knowsπ‘is greater thanπ.
Our cleanup between segmentsπΌπand πΌπ+1 consists of moving all the red nodes intoπ·π+1. For-mally, ifπ£πΏπ βredπ, then we defineπ£πΏπ+1 :=π£πΏπ+ 2π andπ£π π+1 :=π£π π; otherwise, ifπ£π π βredπ, then we defineπ£π π+1 := π£π π + 2π and π£πΏπ+1 := π£πΏπ. This satisfies (β ) and (β β ): ifπ’1 does not broadcast π‘during segment πΌπ, then only the red nodes can know π‘at the end, and since we re-moved them from the ring, at the beginning ofπΌπ+1no node knowsπ‘exceptπ’1. The next segment will be quiet. Otherwise, ifπ’1does broadcastπ‘duringπΌπ, then at the beginning of the next session (which is active) only the yellow nodesyellowπcan knowπ‘. These nodes then become red nodes in
πΌ π
The cleanup step preservesπ-interval connectivity: assume thatredπ ={π£πΏπ, . . . , π£πΏπ+2π}(the other case is similar). Then the lineπ£πΏπ+2π, π£πΏπ+2πβ1, . . . , π’1, π£π π, π£π π+1, . . . , π£πΏπ+2πβ1 exists throughout both segmentπΌπ and segmentπΌπ+1: in segment πΌπ it exists as part of the ring, and in segment πΌπ+1, after we moved the red nodes into the clique π·π+1, the first part of the line π£πΏπ+2π, π£πΏπ+2πβ1, . . . , π’1 exists in the clique and the second part π’1, π£π π, π£π π+1, . . . , π£πΏπ+2πβ1 exists in the ring. The nodes inπ·πare all connected to each other in both segments; thus, there is a static connected graph that persists throughout both segmentsπΌπ, πΌπ+1, and in particular it exists in anyπrounds that start inπΌπ. (Note thatπΌπ+1may be quiet, and in this case it can be shorter thanπ rounds. But in this case it will be followed by an active segment which has exactly the same edges and lastsπ rounds.)
Notice that the number of uncontaminated nodes at the beginning of every active segment is at most2π less than in the previous active session. Therefore the total number of nodes that knowπ‘ by roundπ1 is at most2π times the number of active sessions, and this in turn is bounded by2π times the number of rounds in whichπ’1broadcastsπ‘. Sinceπ’1broadcastsπ‘less than(πβ2)/(2π) times with probability at least1/2, the algorithm is not finished by round π1 with probability at least1/2.
Deterministic algorithms. If the algorithm is deterministic, we first show that there exists an input assignment in which each node begins with at most one token, from which either
1. the algorithm runs forΞ©(ππ/π)rounds, or
2. we reach a round π0 in which some node π’1 hasπ΄π’1(π0) = πΌ and for all π β= 1 we have π΄π’π(π0)β {π’1, π’π}.
In the case of (2), we then continue with the same proof as for the input assignment where some node starts with all tokens and the rest of the nodes have no tokens (see above). Since we are free to choose the input assignment, we restrict attention to instances in which the inputs toπnodes are their own UIDs, and the inputs to the other tokens areβ .
For deterministic algorithms the functionππ’representing nodeπ’βs behavior must return a distri-bution in which one token has probability 1. We abuse notation slightly by usingππ’(π΄π’(0). . . , π΄π’(πβ
1))to denote this token.
We say that a process π’ β π° fires in roundπ if when processπ’ receives{π’}as its input and hears nothing in the firstπβ1rounds, it will stay silent in those rounds and then spontaneously broadcast its token in roundπ. Formally, processπ’fires in roundπif
1. For allπβ²< πwe haveππ’({β₯}πβ²) =β₯, and 2. ππ’({π’}π) =π’.
If processπ’ does not fire in any roundπβ² β€ π, we say that π’is passive until roundπ. (Note that nodes that receive no tokens in their input have no choice but to broadcast nothing until they receive a token from someone.)
Since β£π°β£ = Ξ©(π2π/π), there exist constants π, π0 such that for allπ β₯ π0 we have β£π°β£ β₯ ππ2π+πβ1. Letπβ₯π0. We divide into two cases.
Case I. There exist π’1, . . . , π’π β π° that are all passive until round πππ/π. In this case we construct the static clique over π’1, . . . , π’π and let the algorithm run. During the first πππ/π rounds, all nodes send onlyβ₯, and no node learns new tokens. Consequently all nodesπ’π have π΄π’π(ππ/π) =in(π’π)β=πΌ, and the algorithm cannot terminate by roundπππ/π.
Case II. All butπβ1processes fire no later than roundπππ/π.
Sinceβ£π°β£ β₯π(π2π/π+πβ1), by the pigeonhole principle there must exist a roundπ0β€πππ/π such that at leastπprocesses fire in roundπ0. Letπ’1, . . . , π’πbeπsuch processes. We choose the instance where each nodeπ’πreceives as input{π’π}ifπβ€π, orβ ifπ > π.
Letπbe the static star withπ’1at the center: π = (π, πΈπ), whereπΈπ(π) ={{π’1, π’π} β£π >1}
for allπ. Because all nodes fire in roundπ0, when the algorithm is executed inπ, the network is silent until roundπ0. In roundπ0all nodes that have a token broadcast it. Following roundπ0we haveπ΄π’1(π0+ 1) =πΌ, and for allπ >1,π΄π’π(π0+ 1) =πΌ(π’π)βͺ {π’1} β {π’1, π’π}. This is the state from which we start the main body of the proof above.
π‘ π’1 π£1 π£2 π£πβ3 π£πβ2
(a) The network at the beginning of the execution. Nodes that may know tokenπ‘are indicated in solid blue.
π‘
π£2π+1 π£2π π£2πβ1
π£2 π£π =π£1
π’1 π£πΏ=π£πβ1
π£πβπ
(b) The network at the beginning of the first phase: the line is closed to form a ring. The dotted line indicates the edge we will add at the end of the phase to re-close the ring after we remove the red nodes; double lines indicate stable edges, along whichπ-interval connec-tivity is preserved between phases.
π’1 π£3π π£2π+2
π£2π+1
π£πβ1
π£πβπ
(c) The network after the end of the first phase: the red nodes are removed from the ring and placed in the clique, and the ring is repaired by connectingπ’1 toπ£2π+1. Double lines indicate stable edges along whichπ-interval connectivity was preserved in the transition between the phases.
π’1 π£3π π£2π+2
π£2π+1
π£πβ1
π£πβπ
(d) Ifπ’1 broadcastπ‘at any point during the first phase, we begin a new phase. The nodes that were yellow in the first phase become red, and the βcleanβ nodes onπ’1βs other side become yel-low. Double lines indicate edges that will be stable through the next two phases.
Figure 2: Illustrations for the proof of theΞ©(π+ππ/π)lower bound,π = 3