Gossiping in chordal rings under the line model
Abstract
The line model assumes long distance calls between non neighboring processors. In this sense, the line model is strongly related to circuit-switched networks, wormhole routing, optical networks supporting wavelength division multiplexing, ATM switching, and networks supporting connected mode routing protocols. Since the chordal rings are competitors of networks as meshes or tori because of theirs short diameter and bounded degree, it is of interest to ask whether they can support intensive communications (typically all-to-all) as efficiently as these networks. We propose polynomial algorithms to derive optimal or near optimal gossip protocols in the chordal ring.
Full text
Gossiping in Chordal Rings under the Line Mo del Lali Barriere Dept. Mat. Aplicada i Telematica Univ. Politecnica de Catalunya c/J. Girona 1{3, 08034 Barcelona (Spain) Johanne Cohen LRI, Univ. Paris-Sud 91405 Orsay cedex (France) Margarida Mitjana y Dept. Matematica Aplicada I Univ. Politecnica de Catalunya c/G. Mara ~non 44{50, 08028 Barcelona (Spain) Abstract This pap er is devoted to the gossip (or all-to-all) problem in the chordal ring under the one-p ort line model . The line mo del assumes long distance calls b etween non neighb oring pro cessors. In this sense, the line mo del is strongly related to circuit-switched networks, wormhole routing, optical networks supp orting wavelength division multiplexing, ATM switching, and networks supp orting connected mo de routing proto cols. Since the chordal rings are comp etitors of networks as meshes or tori b ecause of theirs short diameter and b ounded degree, it is of interest to ask whether they can supp ort intensivecommunications (typically all-to-all) as eciently as these networks. Wepropose p olynomial algorithms to derive optimal or near optimal gossip proto cols in the chordal ring. 1Intro duction In the study of the prop erties of interconnection networks, the problem of dissemination of information is an imp ortant and a very active research area 12, 26]. Indeed, the abilityof an interconnection network to eectively disseminate the information among its pro cessors (e.g., accumulation, broadcast or gossip) is a\p ertinent" measure to determine the best communication structures for parallel and/or distributed computers. Assume that every no de of a network holds a piece of information. Broadcast is the information dissemination problem that consists, for one no de of a network, of sending its piece of information to all the other no des. The accumulation problem can b e considered as the reverse of broadcast problem. In the accumulation problem, every vertex has to send its piece of information to one sp ecic vertex of the network. Finally, gossiping is a simultaneous broadcast from every no de of the network. Due to their complexity, these three communication primitives are often provided at the software level. Most of the communication libraries available on parallel systems (as MPI 24]) provide access to such communication pro cedures. More generally, these three communication patterns are fundamental primitives used in many algorithms for the programming, and for the control Additional supp ort by the DRET of the DGA. y Partial supp ort by UPC-PR-9704. 1
of parallel and distributed systems. For example, they are used for barrier synchronization or cache coherence 28], for parallel search algorithms 7], and for linear algebra algorithms 8]. In 10], Farley intro duced the mo del called Line Model which satises the following: (i) a cal l involves exactly two no des (these two no des can be at distance more than 1), (ii) any two paths corresp onding to simultaneous calls must b e edge-disjoint. Furthermore, Farley assumed that no des satisfy the 1 ; port hyp othesis, that is: (iii) ano de can take part in one call at a time. The vertex-disjoint paths mode can b e dened analogously to the line mo del by replacing hyp othesis (ii) by the following (iv) any two paths corresp onding to simultaneous calls must be vertex-disjoint. The calls are sub ject to dierent p ossible constraints: when two no des are involved in the same call, they can either exchange all the informations they are aware of ( ful l-duplex or 2-way mo de) or alternatively, the information can only owin one direction ( half-duplex or 1-way mo de). A round is the set of all calls carried out simultaneously. The complexityofourcommunication proto cols will b e measured bythenumb er of communication rounds required to complete these proto cols. For agiven graph G = ( V E ), and for any arbitrary no de u in G , we denote by b ( G u ) (resp. a ( G u )) the minimum number of rounds for broadcasting from the source no de u (resp. for accumulation) in the graph G . Similarly, the gossip time of G , denoted by g ( G ), is the minimum number of rounds necessary to p erform a gossip in G . In 10], Farley proved that, in the 1 ; port mo del, broadcast from any no de in any n ; no de network can be p erformed in d log 2 n e rounds. His pro of makes use of routing along the edge of a spanning tree of the network. However, the gossip problem is still op en for arbitrary networks, that is, the complexity of gossiping in the 1 ; p ort line mo del in arbitrary networks is not known. Hromkovic et al. 17] gave alower bound for the gossip problem, and some results have been derived for tree-networks 9] and for planar graphs 16]. Chordal ring networks were intro duced in 6]. They form afamily of generalized lo op networks 3]. The chordal ring of N vertices and chord c , denoted by C ( N c ), is the graph with vertices lab eled in Z N , and adjacencies given by i i 1, i i + c for every even vertex i . The structure of these graphs has b een extensively studied. For example, Arden and Lee 1] studied the problem of the maximization of the number of no des for a given diameter, and Yebra et al. 29] found a relationship between a certain typ e of plane tessellation and the chordal ring. Moreover, due to their simple structure, and their short diameter, chordal ring graphs are attractive top ologies for interconnection networks. Chordal rings can supp ort compact 25] and fault-tolerance 2] routing functions. Finally, Comellas and Hell 5] presented an optimal solution for the broadcast problem in chordal rings under the telephone mo del. As 5], this pap er is devoted to the study of communication problems in chordal rings. In particular, our aim is to nd an algorithm for the gossip problem in the full-duplex edgedisjoint paths mo de since the mo del is appropriate to networks supp orting long distance calls such as wormhole or circuit-switched routing. The next section describ es the metho d to nd the gossip time in the chordal ring. Section 3 deals with some prop erties of the chordal ring and, nally, in Section 4 gossiping algorithms are describ ed in order to give the upp er bound of the gossip time in chordal rings. 2 Basic concepts An interconnection network is mo deled by a connected undirected graph G =( V E ), where the vertices in V corresp ond to the pro cessors, and the edges in E represent the communication links of the network. Our gossip algorithms are based on the so-called 3-phase gossip metho d 15]. For that purp ose, the Section 3 gives a decomp osition of the chordal ring into disjoint cycles.
This decomp osition is the base of all our gossip proto cols of Section 4. In the full-duplex line mo del, Farley has shown the following: Lemma 1 (Farley 10]) Let G be a graph of n nodes. In the 2-way mode line model, b ( G )= a ( G )= d log 2 n e : Moreover, Hromkovicetal. 17] gave alower b ound for the gossip problem: Lemma 2 (Hromkovic et al. 17]) Let G beagraph of N nodes and of edge-bisection width B . In the 2-way mode line model g ( G ) 2 d log 2 N e; log 2 B ; log 2 log 2 N ; 2 : In order to get upp er b ounds, we use the "three{phase algorithm" metho d as in 15]. The three{ phase algorithm is comp osed of an accumulation phase, a gossiping phase, and a broadcasting phase. Algorithm 1 Three-phase gossip algorithm 1 Divide G into r connected comp onents containing exactly one accumulation no de each. These comp onents are called accumulation components . A ( G ) is the set of accumulation no des. = Accumulation phase = 2Eachvertex u 2 A ( G )accumulates the information from the no des of its comp onent. = Gossip phase = 3 Perform a gossip among the set A ( G )ofaccumulation no des. = Broadcast phase = 4Every no de in A ( G ) broadcasts information in its comp onents. To obtain an eective algorithm, we will lo ok for a set of accumulation no des such that the gossip phase can be p erformed as quickly as gossiping in a complete graph, and such that the size of the accumulation comp onents is suciently small in order to minimize the time for the rst and third phases. Moreover, these accumulation comp onents should be connected so that the optimal d log 2 N e -round accumulation and broadcast algorithms describ ed in 10] (see Lemma 1) can be indep endently applied in all the comp onents. For the gossip phase, our algorithms will b e based on the two following algorithms 2 and 3. K N stands for the complete graph of N no des. Algorithm 2 Gossiping in a K N , N even 1 For j :=1 to d log 2 N e do 2 For eachvertex i , i even, do in parallel 3 exchange information b etween no de i and no de i +2 j ; 1(mo d N ) Algorithm 3 Gossiping in a K N , N odd 1 m := b N= 2 c 2 For each no de i ,0 <i<N= 2, do in parallel 3exchange information b etween no de i and no de i + m 4 if m is o dd then n 0 = m +1 else n 0 = m +2 5 Gossip in the complete graph of vertices f 0 ::: n 0 g
6 For each no de i , i<N= 2, do in parallel 7exchange information b etween no de i and no de i + m In the three-phase gossip algorithm, a call b etween vertices i and j is replaced by a call b etween the accumulation no de of the i th comp onent and the accumulation no de of the j th comp onent. For a given call b etween the accumulation no de x i of the i th comp onent and the accumulation no de x j of the j th comp onent, that is for a given path P between x i and x j ,the length of the call is dened as the number of comp onents traversed by P plus one. Let s b e the maximum size of the comp onents, then the accumulation and broadcast phases are done in d log 2 s e rounds each. Moreover, if r is the number of comp onents, the gossiping phase needs d log 2 r e to be completed. Thus, we can conclude that the three-phase gossip algorithm needs 2 d log 2 s e + d log 2 r e rounds to p erform. In order to apply this algorithm to the chordal ring graphs, we will present some prop erties of this family of graphs. 3 Denition of the chordal rings Denition 1 Let N be an even integer and c an odd integer between 1and N= 2 .The chordal ring graph of order N and chord c , C ( N c ) , is the graph of order N ,with vertices labeled in Z N ,and adjacencies given by i i 1 , i i + c for every even vertex i . Chordal ring graphs are connected and 3-regular. They are bipartite, with partition sets V 0 = f 0 2 4 :::N ; 2 g and V 1 = f 1 3 5 :::N ; 1 g . For any two vertices x y ,we dene xy : Z N ! Z N as follows: If x ; y 0 (mo d 2) then xy ( i )= y ; x + i , otherwise xy ( i )= y + x ; i . In b oth cases, xy is an automorphism and it veries xy ( x ) = y .So, C ( N c ) is vertextransitive. For more details on these graphs, see 2]. In this section we present upp er b ounds for the edge bisection width of a chordal ring C ( N c ). The edge bisection width , B ,is the minimum number of edges which separate the graph into two sets of vertices of the same cardinality. Lemma 3 Let C ( N c ) be the chordal ring of order N and chord c . Let B be the edge bisection width of C ( N c ) , then B c +2 . Pro of. First, we observe that the natural order for integer numbers gives a natural partition of the vertices, so we have an immediate b ound for B : Z N =0 N= 2 ; 1] N= 2 N ; 1] where a b ]= f a a +1 :::b g . Let A = f ( i j ) 2 E j i 2 0 N= 2 ; 1] j 2 N= 2 N ; 1] g b e the set of edges b etween 0 N= 2 ; 1] and N= 2 N ; 1]. Clearly, from the denition of the edge bisection width, we have that the number of edges of A is an upp er b ound for B . For N= 2even we have A = f (1 N ; c +1) (3 N ; c +3) ::: ( c ; 2 N ; 2) g f ( N= 2 ; c +1 N= 2+1) ( N= 2 ; c +3 N= 2+3) ::: ( N= 2 ; 2 N= 2+ c ; 2) g f (0 N ; 1) ( N= 2 ; 1 N= 2) g . Thus j A j =( c ; 1) = 2+( c ; 1) = 2+2 = c +1 B . For N= 2odd, we apply the same argument as previously and we get j A j = c +2 B . 2 From Lemmas 3 and 2, we can deduce a lower b ound of the gossip time in chordal rings C ( N c ).
Lemma 4 Let C ( N c ) be a chordal ring of order N and chord c . In the 2-way mode line model g ( G ) 2 d log 2 N e; log 2 ( c +2) ; log 2 log 2 N ; 2 : 3.1 Decomp osition of the chordal rings into cycles Let us intro duce a decomp osition of the chordal ring C ( N c ) of order N and chord c that will b e particularly helpful for the design of our gossip algorithm. Wecandistinguish in C ( N c )a set of a = b N c +1 c disjoint( c + 1)-cycles, C 0 :::C a ; 1 : C i = f i ( c +1) i ( c +1)+1 :::i ( c +1)+ c g : If N = a ( c +1)+ b with 0 b c ; 1even, then the chordal ring C ( N c ) consists of a cycles of length c +1, lab eled from 0 to a ; 1, and a path of b vertices, with some additional edges joining these subgraphs. Given a cycle C i , a vertex is said to be the j th vertex of cycle C i , j = 0 :::c , if its lab el is equal to i ( c +1)+ j . Note that the vertex 0 of C i is adjacenttovertex 1 and c of C i . Moreover, for each i , 0 i < b N c +1 c; 1, cycles C i and C i +1 share ( c +1) = 2 edges. Among these edges, ( c ; 1) = 2edges are of typ e x x + c ] and one edge is of typ e x x +1]. In other words, for any even value j , the j th vertex in C i is adjacent to the j ; 1st vertex in C i +1 by a chordal edge. See the decomp osition of C ( 64 7 ) in Fig. 1. 4 Gossip Algorithm for the chordal ring C ( N c ) In this section, we describ e a p olynomial time algorithm to compute an optimal communication scheme for gossiping in any chordal ring C ( N c ). We consider two cases: N = a ( c +1) and N = a ( c +1)+ b where 2 b c ; 1. For these two cases, we split the graph into a certain number of cumulative comp onents, and we cho ose the accumulation no de in eachcomp onent. Finally, we set the paths corresp onding to calls such that the gossip phase between the accumulation no des p erforms almost as quickly as gossiping in the complete graph. By convention, the integers r and s represent resp ectively the numb er of comp onents, and their maximum size. 4.1 Case N = a ( c +1) Since the graph is comp osed of a cycles of c +1 vertices (see Section 3.1), the comp onents are naturally dened by groups of the cycles C 0 :::C a ; 1 . Actually, there are two typ es of decomp osition according to the parameter a : If a < c +1, then there are a comp onents ( r = a ): each comp onent is a cycle of c +1 vertices ( s = c + 1). If a c + 1, then there are c ; 1 comp onents ( r = c ; 1). More precisely, assuming that a = ( c ; 1) + with 0 < c ; 1, of these comp onents are the union of +1 consecutive cycles of c +1 vertices, and the c ; 1 ; remaining comp onents are the union of consecutive cycles of c +1 vertices ( s ( c +1)( + 1). In fact s = ( c +1) if =0 and s =( c + 1)( + 1) otherwise). We lab el the comp onents between 0 and r ; 1. In the k th comp onent, the cycles are lab eled between 1 and ;, where ; is the number of cycles in the comp onent k . We denote by ( k i j )
the vertex j of the i th cycle in the k th comp onent. The k th comp onenthas ( k 1 R = c ; 1) as accumulation no de. Since each comp onent is connected, the accumulation phase and the broadcast phase can be p erformed using the algorithm in 10]. Now, we fo cus on the gossip phase, and we are interested in a path P i ! i + ` (mo d r ) corresp onding to a call b etween the two accumulation no des of comp onent i and i + ` (mo d r ), i =0 :::r ; 1and ` =1 :::R= 2. For ` c ; 1 2 we dene P i ! i + ` as a union of paths denoted by P ( i 0) P ( i 1) :::P ( i ` )such that P ( i k ) is as follows (let R = c ; 1): 1. if 0 k ` ; 1, then we consider two cases: if the comp onent i + k is comp osed of one cycle of c +1 vertices, then the path P ( i k ) is f ( i + k 1 R ; 2 k ) ( i + k +1 1 R ; 2 k ; 1) ( i + k +1 1 R ; 2 k ; 2) g if the comp onent i + k is comp osed of ; cycles of c +1 vertices, then the path P ( i k ) is f ( i + k R ; 2 k ) ( i + k +1 R ; 2 k ; 1) ( i + k +1 R ; 2 k ) j = 1 ::: ; ; 1 gf ( i + k ; R ; 2 k ) ( i + k +1 1 R ; 2 k ; 1) ( i + k +1 1 R ; 2 k ; 2) g . 2. if k = ` , then the path P ( i ` ) is a path of comp onent i + ` ,from vertex ( i + ` 1 R ; 2 ` ) to ( i + ` 1 R ) passing through vertex ( i + ` 1 0). Note that the condition 2 ` c ; 1 assures that these paths are well dened. Ateach round of the gossip phase, the exchange of information can b e p erformed by using the paths dened ab ove: 1. If the numb er of comp onents is o dd, r =2 r 0 +1, and we are in rst or last round. No des i and i + r 0 , 1 i r 0 , exchange their information by using paths P i ! i + r 0 (mo d r ) , with r 0 c ; 1 2 . 2. If the number of comp onents is odd, r = 2 r 0 +1 but we are neither in the rst nor in the last round, we merge the comp onents n 0 :::r ; 1into a single n 0 -comp onent, with n 0 = r 0 if r 0 is odd and n 0 = r 0 +1 if r 0 is even. After this merging, the number of comp onents is even, and we pro ceed as in the next case. 3. If the numb er of comp onents is even, for some j the accumulation no des of i and i +2 j ; 1 (mo d r ) comp onents exchange their information for all i even. If 2 j ; 1(mo d r ) c ; 1 2 the paths corresp onding to this round are P i ! i + ` (mo d r ) with ` =2 j ; 1, for all i even. When 2 j ; 1 (mo d r ) > c ; 1 2 the paths corresp onding to this round are P i ! i + ` (mo d r ) with ` = r ; (2 j ; 1 (mo d r )) c ; 1 2 , for all i odd. Let us prove that, at each round, the calls are pairwise edge-disjoint. Lemma 5 Let be ` c ; 1 2 . For al l i < j and i + ` (mo d r ) 6 = j ,the paths P i ! i + ` and P j ! j + ` are pairwise edge-disjoint. Pro of. Assume w.l.g. that i =0. If j < k < ` ,the paths P 0 ! ` and P j ! j + ` cross the k -th comp onent. We need only to prove that vertices of the k -th comp onent b elonging to the path P 0 ! ` are dierent to vertices of the k -th comp onent b elonging to the path P j ! j + ` .
The third comp onent of the vertex co ordinates in P (0 k ) is R ; 2 k or R ; 2 k ; 1, while the third comp onent of the vertex co ordinates in P ( j k ; j )is R ; 2 k ; 2 j or R ; 2 k ; 2 j ; 1. Thus, the assertion holds. 2 In Fig. 1 there is an example of the paths P i ! i +3 corresp onding to the round t = 2, in the chordal ring C ( 64 7 ). Since in the decomp osition of this graph all the groups have only one cycle, the vertex j in cycle i is lab eled by ( i 1 j ). C0 C1 C2 C3 C4 C5 C6 C7 07 6=R 54 3 2 1 (1,1,5) (2,1,2) (3,1,1) (3,1,0) (3,1,7) (3,1,R) (2,1,3) (1,1,4) Figure 1: The chordal ring C ( 64 7 ). Therefore, we conclude that the decomp osition in cycles as dened in Section 3.1 allows a gossip among accumulation no des that p erforms as quickly as gossiping in the complete graph. 4.2 The upp er b ound in case N = a ( c +1) Since the gossip algorithm p erforms in 2 d log 2 s e + d log 2 r e = 2 d log 2 N e;d log 2 r e + O (1), the calculation of the number of rounds gives: a c +1, then r = c ; 1 and s =( +1)( c + 1). g ( C ( N c )) 2 d log 2 N e;d log 2 c e + O (1) a<c +1, then r = a and s = c +1. g ( C ( N c )) 2 d log 2 N e;d log 2 a e + O (1) 4.3 The general case: N = a ( c +1)+ b , 0 < b < c . Note that, since N and c +1 are even, b is necessarily even. We consider two cases: a b= 2 and a<b= 2.
4.3.1 Case 1. a b= 2 A graph of typ e A is a subgraph of the chordal ring that contains c +3 consecutive vertices on the ring, two chordal edges of typ e x x + c ], and c +2 edges of typ e x x + 1]. If i is the smallest lab el of no des of a subgraph H of typ e A ,then the vertex of lab el i + j is called the j th vertex of H (the vertex 0of H is incident to vertices 1and c in H ). There are two typ es of decomp osition, according to the parameter a .In b oth cases, we split the graph in a ; b= 2 cycles of c +1 vertices and in b= 2 graphs of typ e A . If a<c +1, then there are a comp onents. If 0 i b= 2 ; 1, then the comp onent i is a subgraph of typ e A , A i ,andif b= 2 i a ; 1, then the comp onent i is a cycle of length c +1, C i . The graph is the union of consecutive subgraphs A 0 A 1 :::A b= 2 ; 1 C b= 2 :::C a ; 1 And for any i ,0 i a ; 1, the subgraph of index i of this sequence is connected to the subgraphs of index i ; 1and i + 1, mo dulo a , by ( c +1) = 2 edges. If a c +1, then we dene c ; 1 comp onents, each of them containing at most one subgraph of typ e A and p ossibly many cycles, as follows. Assuming that a = ( c ; 1) + , with 0 < c ; 1, then the rst comp onents are constituted by +1 consecutive subgraphs, and the c ; 1 ; remainig comp onents are constituted by consecutive subgraphs. Moreover, only the rst subgraph in the rst b= 2 comp onents is a subgraph of typ e A . More precisely, the comp onent i , 0 i b= 2 ; 1, is the union of consecutive subgraphs A i C i 1 :::C i ; i ,andthecomponent i , b= 2 i<c ; 1, is the union of consecutive cycles of length c +1, C i 0 C i 1 :::C i ; i , where A i is a subgraph of typ e A , C ij is a cycle of length c + 1, and the value of ; i is if i ; 1, and ; 1 otherwise. The graph can be describ ed by the following sequence: A 0 C 0 1 :::C 0 ; 0 |{z } comp onent 0 A 1 C 1 1 :::C 1 ; 1 | {z } comp onent 1 :::A b= 2 ; 1 C b= 2 ; 1 1 :::C b= 2 ; 1 ; b= 2 ; 1 | {z } comp onent b= 2 ; 1 C b= 2 0 C b= 2 1 :::C b= 2 ; b= 2 | {z } comp onent b= 2 :::C c ; 2 0 C c ; 2 1 :::C c ; 2 ; c ; 2 | {z } comp onent c ; 2 In each comp onent, the subgraph of typ e A is lab eled 1, and the remaining cycles are lab eled 2 3 ::: The comp onent k has ( k 1 c ; 1) as its accumulation no de if comp onent k do es not contain a subgraph of typ e A , and ( k 1 c +1) otherwise. We set R = c ; 1. The accumulation phase and the broadcast phase can b e p erformed using the algorithm in 10] since each comp onent is connected. Now, we fo cus on the gossip phase, and we are interested in the call P 0 i ! i + ` between the two accumulation no des of the comp onent i and the comp onent i + ` . As in the previous case, for ` c ; 1 2 we dene P 0 i ! i + ` as the union of paths denoted by P 0 ( i 0) P 0 ( i 1) :::P 0 ( i ` )such that P 0 ( i k ), 0 k ` ,is as follows: 1. if the i + k +1 comp onent do es not contain a graph of typ e A or k = ` ,then P 0 ( i k )= P ( i k ) 1 1 dened in Section 4.1
2. if k 6 = ` and the comp onent i + k +1 contains a graph of typ e A ,then we consider four cases: if the comp onent i + k contains only one graph of typ e A ,then the path P 0 ( i k ) is f ( i + k 1 R ; 2 k +2) ( i + k +1 1 R ; 2 k ; 1) ( i + k +1 1 R ; 2 k ) g if the comp onent i + k contains only a cycle of c +1 vertices, then the path P 0 ( i k ) is f ( i + k 1 R ; 2 k ) ( i + k +1 1 R ; 2 k ; 1) ( i + k +1 1 R ; 2 k ) g if the comp onent i + k is comp osed of one graph of typ e A and ; ; 1 cycles of c +1 vertices, then the path P 0 ( i k )is f ( i + k 1 R ; 2 k +2) ( i + k 2 R ; 2 k ; 1) ( i + k 2 R ; 2 k ) gf ( i + k R ; 2 k ) ( i + k +1 R ; 2 k ; 1) ( i + k +1 R ; 2 k ) j = 2 ::: ; ; 1 gf ( i + k ; R ; 2 k ) ( i + k +1 1 R ; 2 k ; 1) ( i + k +1 1 R ; 2 k ; 2) g . if the comp onent i + k is comp osed of ; cycles of c +1 vertices, then the path P 0 ( i k ) is f ( i + k R ; 2 k ) ( i + k +1 R ; 2 k ; 1) ( i + k +1 R ; 2 k ) j = 1 ::: ; ; 1 gf ( i + k ; R ; 2 k ) ( i + k +1 1 R ; 2 k ; 1) ( i + k +1 1 R ; 2 k ; 2) g . It is easy to see that at each round of the gossip phase, the exchange of information can be p erformed by using the paths dened ab ove. And the next lemma holds. Lemma 6 Let be ` c ; 1 2 . For al l i < j and i + ` (mo d r ) 6 = j ,the paths P 0 i ! i + ` and P 0 j ! j + ` are pairwise edge-disjoint. The pro of is analogous to the pro of of Lemma 5. 4.3.2 Case 2. a<b= 2 Since b < c +1, it implies that a < ( c +1) = 2. By using the cycle decomp osition, we split the graph into r = a + 1 comp onents. The comp onents 1 :::a contain one c + 1{cycle and the comp onent 0 is a path of b vertices. The vertex j of the b {path in comp onent 0 has lab el (0 1 j ) and the vertices in the other comp onents are lab eled as in Section 4.1. We take( k 1 R = b ; 2), k = 0 :::a ,as accumulation vertices (in Section 4.1, R = c ; 1). Let us notice that there are b= 2+1 edges connecting comp onent r ; 1 with comp onent0. This decomp osition allows us to dene an algorithm as in Section 4.1. 4.4 The upp er b ound in case N = a ( c +1)+ b Since the gossip algorithm p erforms in 2 d log 2 s e + d log 2 r e , the calculation of the number of rounds gives: a b= 2: a c +1, then r = c ; 1 and s =( +1)( c + 3). g ( C ( N c )) 2 d log 2 N e;d log 2 c e + O (1) a<c + 1, then r = a and s = c +3. g ( C ( N c )) 2 d log 2 N e;d log 2 a e + O (1) a<b= 2 < ( c +1) = 2, then r = b a= 2 c +1 and s =2( c + 1): g ( C ( N c )) 2 d log 2 N e;d log 2 a e + O (1)