HAL Id: hal-00720687
https://hal.inria.fr/hal-00720687v2
Submitted on 1 Aug 2012
HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or
L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires
Consensus
Mahmoud El Chamie, Giovanni Neglia, Konstantin Avrachenkov
To cite this version:
Mahmoud El Chamie, Giovanni Neglia, Konstantin Avrachenkov. Reducing Communication Overhead
for Average Consensus. [Research Report] RR-8025, INRIA. 2012, pp.22. �hal-00720687v2�
0 2 4 9 -6 3 9 9 IS R N IN R IA /R R -- 8 0 2 5 -- F R + E N G
RESEARCH REPORT N° 8025
July 2012
Reducing
Communication
Overhead for Average Consensus
Mahmoud El Chamie, Giovanni Neglia, Konstantin Avrachenkov
RESEARCH CENTRE
SOPHIA ANTIPOLIS – MÉDITERRANÉE
MahmoudEl Chamie
∗
, Giovanni Neglia
†
, Konstantin
Avrahenkov
‡
Projet-Teams Maestro
Researh Report n°8025July201222pages
Abstrat: Averageonsensus isaniterativeprotoolwhere nodesina network, eah havingan
initialsalar valuealled estimate,performa distributedalgorithm toalulatetheaverageofall
estimatespresentedinthenetworkbyusingonlyloalommuniation. Witheveryiteration,nodes
reeive theestimates from theirneighbors, and theyupdate their own estimateby theweighted
average of the reeived ones. Whilethe average onsensus protool onverges asymptotially to
onsensus,implementingaterminationalgorithmishallengingwhennodesarenotawareofsome
globalinformation (e.g. thediameter ofthe network or the number ofnodes presented). Inthis
report,weareinterestedindereasingtherateofthemessagessentinthenetworkastheestimates
areloser to onsensus. Wepropose a totally distributed algorithm foraverageonsensus where
nodessendmoremessageswhenthenodeshavelargedierenesintheirestimates,andreduetheir
rateof sending messages when theonsensus is almost reahed. The onvergene of the system
is guaranteed to be within a predened margin
ǫ
from the trueaverage and theommuniation overheadislargelyredued.Key-words: averageonsensus, energyredution,termination protool,distributed algorithms
∗
InriaSophiaAntipolis,Frane,Mahmoud.El_Chamieinria.fr
†
InriaSophiaAntipolis,Frane,Giovanni.Negliainria.fr
‡
InriaSophiaAntipolis,Frane,K.Avrahenkovsophia.inria.fr
Résumé : Le onsensus de moyenne est un protoole itératif où les n÷uds d'un réseau,
ayanthaununeestimationinitiale,exéutentunalgorithmedistribuépouralulerlamoyenne
de es estimations en utilisant uniquement les ommuniation loales. A haque itération, les
n÷udséhangent leursestimationsaveleursvoisins. Ces estimationsserontremplaéesparla
moyennepondéréede ellesreçues. Laonvergeneduonsensusdemoyenneest asymptotique
etlamiseen÷uvre d'unprotooledeterminaison estdiile lorsquelesn÷udsneonnaissent
pas l'estimation global (par exemple, le diamètre du réseau ou le nombre de n÷uds). Dans
e rapport, nous intéressons à larédution du taux de messages envoyés dansle réseau quand
lesestimations deviennent prohe du onsensus. Nous présentons un algorithmede onsensus
demoyenne totalementdistribué, oùlesn÷uds envoientplusde messages lorsque ladiérene
entre leurs estimationsest grande et moins demessages lorsque lesystème est à peuprèson-
vergeant. La onvergene dusystèmeest garantied'être prohedela vraiemoyenneet le oût
desommuniations estfortementréduit.
Mots-lés: onsensusdemoyenne,rédutiondel'énergie,protooledeterminaison,algorithme
distribué
1 Introdution
Average onsensusprotools areusedto ndtheaverageaross initialmeasurementspresented
at nodesin a network ina distributed manner havingno entralentity toontrol and monitor
thenetwork. Thisproblem isgaining interestnowadaysdueto itswidedomain ofappliations
as in ooperative robot motions [1 ℄, resoure alloation [2 ℄, and environmental monitoring [3℄,
in addition to the existeneof large networks suh as wireless sensor networks for whih suh
onsensusalgorithmsareneessary[4 ℄. Underthisdeentralizedapproah,nodesseletaweight
fortheestimate ofevery neighbor andperforma weightedaverageofthevaluesin theirlosed
neighborhood. Byonsideringspeialonditionsontheseletedweights,theprotoolisguaran-
teedtoonvergeasymptotiallytotheaverageonsensus. Aftereverylineariteration,eahnode
must send its newvalueto its neighbors so that theyan use it in the next iteration. For an
extensiveliteratureonaverageonsensus protool andits appliations,hekthesurveys[5 , 6 ℄
andthereferenestherein.
To speed up the onvergene, some approahes have foused on seleting the weights so
that theonvergene beomesfaster. Xiao and Boyd in [7 ℄ have formulated theproblem as a
SemiDenite Program that an beeientlyand globally solved. However,speeding upthe
onvergene does not redue the number of messages that are sent in the network even when
usingtheoptimalweights. Thereasonisthattheonvergeneisreahedonlyasymptotially,and
even ifnodes' estimatesare very lose tothe average, nodes keep onperformingtheaveraging
andsendingmessages totheirneighbors.
Thereportisorganizedasfollows: Setion2givesthenotationusedandaformulationofthe
problem. Setion3givesthepreviousworkontheterminationoftheaverageonsensusprotool.
Setion4motivatestheworkbyanimpossibilityresultfornitetimetermination. Setion5gives
theproposedalgorithm, itsanalysis, andthesimulationsofthe algorithm. Setion 6 onludes
thereport.
2 Problem Formulation
Consider a network of
n
nodes that an exhange messages betweeneah other through om-muniation links. Every node in this network has a ertain measurement (e.g. pressure or
temperature),andweneedeahnodetoknowtheaverageoftheinitialmeasurementsbyfollow-
ing a distributed linear iterationapproah. The networkof nodes an bemodelledas a graph
G = (V, E)
whereV
isthesetofverties(|V | = n
)andE
istheset ofedgessuhthe{i, j} ∈ E
if nodes
i
andj
are onnetedand an ommuniate (they are neighbors). LetalsoN i
betheneighborhood set of node
i
. Letx i (0) ∈ R
be the initial value at nodei
. We are interestedin omputing theaverage
x ave = (1/n) P n
i=1 x i (0)
, in a deentralized manner with nodesonly ommuniatingwiththeirneighbors. Ournetworkmodelwillbetheaveragingdoneona xednetworkwithasynhronizationlok. Whentheloktiks,allnodesinthesystemperformthe
iterationoftheaveragingprotoolatthesametime(thisisthesynhronousupdateassumption).
Atiteration
k + 1
,nodei
updatesitsstatevaluex i
:x i (k + 1) = w ii x i (k) + X
j ∈ N i
w ij x j (k)
(1)where
w ij
is the weight seleted by nodei
for the value sent by its neighborj
andw ii
is theweightseletedbynode
i
foritownvalue. Thematrixformequationis:x (k + 1) = W x (k)
(2)where
x (k)
isthestatevetorofthesystemandW
istheweightmatrix.Under some onditions on the weight matrix
W
given in [8 ℄, the system is guaranteed toonverge to theaverage. Inthis report, we onsider
W
to bea doubly stohasti matrixthatsatises these onditions and is onstruted loally, some methods foronstruting theweight
W
using onlyloal information an befound is[9 ℄. Let1
bethe vetor havingthe value1
ineveryentry,theonvergene oftheaverageonsensusgivenaboveis ingeneralasymptoti:
k lim →∞
x (k) = x ave 1 .
(3)Theaveragingworksasfollows: afterseletingtheweightsfortheirneighbors, alineariteration
phasestarts. Eah nodealulates its newvalue depending on theweightsand theneighbors'
values,andthenitbroadaststhenewvaluetoallitsneighbors beforethegloballoktiksfor
thenextiteration. Sinethelimitin(3 )istypiallyreahedatinnity,thenodeswillbealways
busysendingmessages. Let
M (k)
bethenumberofnodestransmittingatiterationk
,sowithouta termination protool all nodesare transmitting at iteration
k
,M (k) = M = n
, independent from theonvergene of estimates. So how an nodes knowthat theyare lose enough to theaverageandthusstop sendingmessagestotheirneighborsandsavebandwidthandenergy? We
propose in this report an algorithm that redues ommuniation overhead aused by sending
messagesatevery iteration.
3 Related Work
Somework onsiders protools foraverageonsensus protoolto terminate in nite time. One
approah is that estimates of nodes performing suh a protool reahes the exat average, as
in [10 ℄, their solution is based on the onept of the minimal polynomial of the matrix
W
,wheretheyshowedthatanodeusingoeientsofthispolynomial anuseitsestimateover
K
suessiveiterationstoalulatetheaverage,butnodesmustalsohavehighmemoryapabilities
to storethe
n × n
matrix, andhigh proessing apabilities to solvethen
linearlyindependent equationsto nd the oeientsof theminimal polynomial. Anotherapproah for nite timetermination,isgivenin [11 ℄,but insteadof exataverage,guaranteed tobewithin apredened
thresholdfromtheaverage. Thisapproahrunsthreeonsensusprotoolsatthesametime: the
maximumandtheminimumonsensusrestartedevery
U
iterationswhereU
isanupper boundof thediameter of the network, and average onsensus. The dierene betweenthe maximum
andminimumonsensusprovidesastoppingriteriafornodes.
Inadierenttimesettingforaverageonsensus,usingtheasynhronousrandomizedgossip-
ing,theauthorsin[12 ℄proposedanalgorithmthatleadstotheterminationofaverageonsensus
in nite timewith high probability. In theirapproah, eah nodehas a ounter
c i
that ountshowmanytimesthedierenebetweenthenewestimateandtheoldonewaslessthanaertain
threshold
τ
, when the ounter reahes a ertainvalue, sayC
, the nodewill stop initiatingthealgorithm. They proved that by a orret hoie of
C
andτ
(depending on some parametersas the maximum degree in the network, the number of nodes, and the number of edges) the
terminationiswithhighprobability.
However,amajordrawbakofthesealgorithms(withouttakingintoonsiderationthemem-
oryapabilitiestheyassumednodestohaveor therobustness ofthesystem)theassumptionof
knowledge of some global variables at eah nodes whih violates the deentralized senario of
averageonsensus. Designingadeentralizedalgorithmforaverageonsensusthatterminatesin
nitetimewithoutusing anyglobalestimate(as thediameterofthenetwork orthenumber of
nodes)inthealgorithmisstillanopenproblem.
Figure1: Line graph
G
with3
nodes.4 Motivation
Weaddresstheproblemoftermination ofaverageonsensus inthisreport. Wewill startbyan
impossibilityresultforterminationoftheaverageonsensusprotoolinnitetimewithoutusing
of a global estimate (mainly an upper bound on the diameter) and by only using the history
estimatesofthenode.
Theorem 1. In the average onsensus protool on axedgraph(no link failure), wherenodes
perform synhronous iterations as in (1 ) to onverge to the average of initial estimates, it is
impossible to reate a deterministi distributed algorithm that terminates in nite time to give
theaverage ofinitialestimatesoranyboundedapproximateoftheaverage usingonlythe history
of the node'sestimate.
Proof. Consider aline graph
G
ofthree nodes,a
,b
,andc
as inFig.1,wheretheweightmatrixis real doubly stohasti matrix that satises the onvergene onditions (as a result we an
assume
w aa , w cc > 0
). Suppose thereexists atermination algorithmforaverageonsensus that terminates in nite time, then applying this algorithm on this graph implies that their existsan iteration
K > 0
andǫ > 0
where nodea
deides to terminate and this algorithm usesonly the history of estimates of node
a
:x a (0), x a (1), x a (2), ..., x a (K)
, to deide to stop and|x a (K) − x ave | < ǫ
, wherex ave = α = x a (0)+x b 3 (0)+x c (0)
. We will dene the extended mirrorgraphof
G
tobealine graphof6
nodesa 1 , a 2 , b 1 , b 2 , c 1 ,
andc 2
,formedbytwoidentialgraphsas
G
butadding a{c 1 , c 2 }
edge. Theinitial estimatesarethesame forallnodes(e.g. fornodea
wehavex a 1 (0) = x a 2 (0) = x a (0)
),weightmatrixisalso thesame exeptforc 1
andc 2
,wherew c 1 c 1 = w c 2 c 2 = w c 1 c 2 = w 2 cc
(see Fig. 2). Notie that on the new generated graph and theold one,
x a 1 (k) = x a (k) ∀k ≤ K
, so nodea 1
on thenew graph will deideto terminate afterexatly
K
iterations. Notie now that we an ontinue doing this proedure of graph mirror extension till wehave a line graph wheren > K
, all this graphH
.a 1
in graphH
still havethesame estimatesduring theiterations
k ≤ K
, so itwill alwaysterminateafterK
iterations.However,if weadd a newnodeto
H
at theend of theline, havingan estimateβ >> nα
,theeet would only reah
a 1
after a number of iterationsk > K
. Therefore, on this graph (thegraphwhereweaddedonenodeattheendofthelinegraph
H
),thenodea 1
willterminatewith|x a 1 (K) − α| < ǫ
,but itis notpossible toguaranteeit islose totheaverage beausethenewaveragenowis
x ave = α + β − n α >> x a 1 (K)
.Theaboveproofanbeextendedtoinlude anygraph
G
, notjustlinegraphs, byusingthesame tehniqueof generatingtheextendedmirrors graphs of
G
to showthat weannotsimplyapplytheterminationprotoolonanykindof networksnotjustthelinegraph.
Thetermtermination in this deentralized senario must referto themessages sentbythe
nodes in the network but not to the exeution of the algorithm at the level of nodes. The
algorithms touse mustallownodes torefrain fromsending theirestimateas messages in some
iterations and send it in another. The termination ours when the number of messages sent
in thenetwork disappears, even if thenodesare still running the algorithm internally, but no
Figure2: Extendedmirrorgraphof
G
with6
nodes.more messages are sent in the network. In a less restritive objetive, we an also dene the
asymptotiterminationwhentherateofsending messagesinthenetworkisvanishing,i.e.:
t lim →∞
P t
k=1 M (k)
t = 0.
(4)Inotherwords,therateofmessagesinthenetworkmustgiveusanideaabouttheonvergeneof
nodes,soifwemonitorthenetworkforanintervalofiterationsandsawthatnotmanymessages
are generated, we should beableto onlude that the nodesare almost onvergedto thetrue
averageor toanapproximatewhih isbounded byathresholdfromthetrueaverage.
5 Our Approah
5.1 Centralized Termination
5.1.1 Introdution
Even if thenodeswill not terminate in nite time, we areinterested in dereasing the rate of
themessages sentinthenetworkin suha waytoberelatedtotheamountofimprovementwe
aregaining in terms ofthe onsensus. For example, ifthe nodeshavewide rangeof dierene
in their estimates, sending messages an beeient to derease the error in the network and
reah onsensus. However, when the nodes are almost onverged, sending a lot of messages
will not be eient, as the improvement is just a user perspetive. So from an engineering
perspetive, our network must send more messages when the nodes have large dierenes in
their estimates, and lessmessages when the system is almost onverging. This subsetion on
entralized termination just provides basis and intuition for the more pratial deentralized
terminationalgorithmproposedinthisreport.
5.1.2 Overview
Inthis setion, wedisuss a simpleentralizedalgorithm for termination of averageonsensus
protools. Weallitaentralizedprotoolsineinthisprotool,eahnodeansendabroadast
signaltothenetworktoperformaniteration. Atanyiteration,ifanyofthenodesinthenetwork
sent this signal, all the nodes will respond by sending the new estimates to their neighbors
aordingtotheaveraging equation:
x (t + 1) = W x (t),
(5)where
t
isthetimewhenabroadastsignalissentinthenetwork. Ontheontrary,weseethatifnosignalissent,thenodeswillpreservethesame estimate:
x (t + 1) = x (t),
(6)where
t
is the iterationwhere nobroadast message was sent. In thefollowing,wewill give asimplealgorithmwherethefrequenyofsendingabroadastsignalwillbedereasing(onverging
tozeroi.e. nonodeina networkwillbesendingsuhamessage), sothemessages foraveraging
will alsobesentlessoftenas nodes onverges tothe average. This algorithmisan intuitionto
howthedeentralizedterminationprotoolworks.
5.1.3 Analysisand Convergene
Let us deneformally the method. Let
e(t)
bean inreasingsalar visible by all thenodes inthe network suh that
e(0) = 0
and0 ≤ e(t) < ǫ(t)
, whereǫ(t)
is a boundarythresholdwhihis alsoan inreasingsalar suhthat
ǫ(0) = ǫ = constant
. LetW
bethe weight matrixofthenetwork satisfyingonvergene onditions of averageonsensus and
x (t)
bethestate vetor ofthesystematiteration
t
. Wedenea logialexpressionL t
asaBooleanvariable(eithertrueorfalse)denedatevery iteration
t
ofthefollowingexpression:L t : e(t − 1) + ||W x (t − 1) − x (t − 1)|| ∞ < ǫ(t − 1),
(7)with
L 0 = F alse
. Aordingto thisondition,ationsaretakeniniterationt
. Ifthis onditionwasfalse, a broadast signal issentin thenetwork andall nodeswill performan iteration;we
have
x (t −1)
hanges,ǫ(t −1)
alsoisinreasedbyavalueofǫ/m 2
,wherem
isaounterindiatinghowmanytimesthevalueof
ǫ
hasinrementedin thepast,buttheothersalare(t − 1)
iskeptthesame. On theontrary, if
L t
is true,then there isnosignal in the network, and thenodeskeepthesameestimateas theprevious iteration,theboundarythresholdisalsokeptthesame,
but
e(t − 1)
is inreasedbyy(t − 1) = ||W x (t − 1) − x (t − 1)|| ∞
. Inpartiular,thehangestothenetworkvariablesdueto
L t
aregiveninthefollowingequation:e(t) =
( e(t − 1) + y(t − 1)
ifL t = T rue,
e(t − 1)
ifL t = F alse,
(8)x (t) =
( x (t − 1)
ifL t = T rue,
W x (t − 1)
ifL t = F alse,
(9)ǫ(t) =
( ǫ(t − 1)
ifL t = T rue,
ǫ(t − 1) + ǫ/k 2
ifL t = F alse,
(10)where
k
isaounter indiatinghowmanytimesthevalueofǫ(t)
hasinrementedin thepast.When
L t
istrue,weallt
asilentiterationbeausethenodeshavethesame estimateastheprevious iteration (i.e.
x i (t) = x i (t − 1)
) and there is no need to exhange messages of theseestimates in the network. On the other hand, when
L t
is false, we allt
as a busy iterationbeause nodes will perform an averaging (i.e.
x (t) = W x (t − 1)
) and the estimates must beexhangedin thenetwork. Letusdene
T
astheset ofbusyperiod:T = {t | L t = F alse}.
(11)Let
t k
wherek = 1, 2, ...
betheinreasingsequeneoftheelementsofthesetT
. Letα k
bethenumberofsilentiterationsbetween
t k
andt k+1
. Weanseethatt k+1 = α k +t k + 1
. Wesaythatthealgorithm isterminatingasymptotiallyifthesilentperiodisdiverging,i.e. wehavethat:
t→∞ lim α k = ∞.
(12)First,it is not diultto see that if
t → ∞
, thenk → ∞
too,beause anupper bound onk
impliesanupperboundon
t
. Therefore,itissuienttoprovethatlim k →∞ α k = ∞
.Let
z (k) = W x (t k ) − x (t k )
,weanseethat aordingtothisalgorithm,α k = ⌊ ǫ(t k ) − e(t k )
|| z (k)|| ∞
⌋
≥ ǫ(t k − 1) + ǫ/k 2 − e(t k − 1)
|| z (k)|| ∞
− 1
≥ ǫ
k 2 || z (k)|| 2
− 1.
(13)Moreover,
z (k)
evolveaording tothefollowingequation:z (k) = (W − G) z (k − 1) = (W − G) k z (0),
(14)where
G = 1/n 11 T
. Finally,|| z (k)|| 2 ≤ Cρ k (W − G),
(15)where
C = || z (0)||
andρ(W − G)
isthespetralradiusofthematrixW − G
,so0 < ρ < 1
sineW
satises theondition ofa onvergingmatrix(see [8 ℄). Puttingeverything together, wegetnallythat:
α k ≥ ǫ
Ck 2 ρ k − 1,
(16)and hene
α k → ∞
ask → ∞
. Consequently, the rate of messages sent in the network is vanishing,namelyt lim →∞
P t i=1 M (i)
t = lim
t →∞
M k t = lim
t →∞
M k k + P k −1
i=1 α i
= 0.
(17)5.2 Deentralized Environment
5.2.1 Introdution
Inadeentralizedalgorithm,eahnodeworksindependently,thenodesonlyagreeonsynhronous
timestepstodotheiteration. Thesilentperiodona nodeisjustloal, soanodean besilent,
whileits neighbor is not. In thissenario, we seethat within aniteration, some nodes willbe
transmitting and others will be silent. This an ause instability in the network beause the
average with every iterationis not now onserved, and the salar
e(k)
dened in theprevioussubsetionisnowavetor
e (k)
wheree i (k)
isloaltoeverynode. Toonservetheaverageinthedeentralized setting, this salar must take part in the stateequation as wewill showin what
follows.
5.2.2 System Equation
In ourapproah, weonsider a more generalframework foraverageonsensus where westudy
theonvergene ofthefollowingequation:
x (k + 1) + e (k + 1) = W x (k) + e (k).
(18)Someworkhavestudied,thefollowingequationasaperturbedaverageonsensusandonsidered
e (k)
to bezero mean noise with vanishing variane (see [13 , 14℄). However, in ourmodel, weonsider
e
as a deterministi part of the state of the system and not a random variable. We onsidersuientonditions forthesystemtoonverge,andweusetheseonditionsto giveanalgorithmthat anreduethenumber ofmessagessentinthenetwork.
Inthestandardonsensus algorithms, thestateofthesystemisdened bythestatevetor
x
,but inthemodiedsystem,thestateequationisdenedbytheouple{ x , e }
.Theorem 2. Let
e (k + 1) = e (k) − F(k) x (k)
, andA(k) = W + F (k)
. Assume the followingonditions onthe matrix
A(k)
:(a)
a ij (k) ≥ 0
foralli
,j
,andk
,andP n
j=1 a ij (k) = 1
foralli
andk
.(b) Lowerboundon positiveoeients: thereexistssome
α > 0
suhthat ifa ij (k) > 0
,thena ij (k) ≥ α
,foralli
,j
,andk
.() Positivediagonaloeients:
a ii (k) ≥ α
,foralli
,k
.(d) Cut-balane: forany
i
witha ij (k) > 0
,wehavej
witha ji (k) > 0
.(e)
lim k →∞ x (k) = x ⋆ ⇒ lim k →∞ F (k) x (k) = 0
.Then
lim k →∞ x (k) = x ′ ave 1
,wherewehavethatx ′ ave ∈ [min j x j (0), max j x j (0)]
iffurthermore wehavee (0) = 0
ande i (k) < ǫ
,then|x ave − x ′ ave | < ǫ
.Proof. Letus rstprovethat
x (k)
onverges. Bysubstituting theequationofe (k + 1)
in(18 ) ,weobtain:
x (k + 1) = A(k) x (k),
(19)where
A(k) = W + F (k)
. From theonditions (a),(b),(), and(d) onA(k)
, wehavefrom [ 15 ℄that
x
onverges, i.e.lim k →∞ x (k) = x ⋆
. Sine the systemis onverging, then from equation (18 ) ,weanseethat:x ⋆ + lim
k→∞ ( e (k + 1) − e (k)) = W x ⋆ ,
so,
x ⋆ = W x ⋆ .
(20)Therefore,
x ⋆
isan eigenvetor orresponding to the highesteigenvalue(λ 1 = 1
) ofW
. Sowean onludethat
x ⋆ = x ′ ave 1
wherex ′ ave
isasalar(Perron-Frobeniustheorem).Theondition
1 T W = 1 T
onthe matrixW
in equation(2 ) leads tothepreservation ofthe averagein the network,1 T x (k) = nx ave ∀k
. This onditionis notneessary satised byA(k)
,soletusprovenowthatthesystempreservestheaverage
x ave
:1 ⊤ ( x (k + 1) + e (k + 1)) = 1 ⊤ (W x (k) + e (k))
(21)= 1 ⊤ ( x (k) + e (k)).
(22)Thelastequalityomesfromthefat that
W
issumpreservingsine1 ⊤ W = 1 ⊤
.Finally by a simple reursion we have that
1 ⊤ ( x (k) + e (k)) = 1 ⊤ x (0) = nx ave
, and theaverageisonserved. Moreover,sine
|e i (k)| ≤ ǫ ∀k
,so wehave:|(1/n) 1 ⊤ x (k) − x ave | ≤ ǫ ∀k.
(23)Butwe justproved that
lim k →∞ x (k) = x ′ ave 1
, so this onsensus is withinǫ
from the desiredx ave
:|x ′ ave − x ave | ≤ ǫ.
(24)Thisendstheproof.
5.3 Message Reduing Algorithm
Wetry to solve the termination problem through a fully deentralized approah. We onsider
large-sale networks where nodes have limited resoures (in terms of power, proessing, and
memory), do notuse any global estimate(e.g. diameter of the network or number of nodes),
keeponlyoneiterationhistory,andanonlyommuniatewiththeirneighbors. Ourmaingoalis
thatthenumberofmessagesin thenetworkisaetedbyhowlosethenodesaretoonsensus.
Namely, the loser they are to onsensus, the less nodes transmit messages at eah iteration.
Thealgorithmmust guaranteethat thesystemreahesa onsensus within aertainpredened
marginfrom theaverage.
Themain ideais thata node,say
i
forexample,willompareitsnewalulatedvaluewiththeoldone. Aordingto the hange in theestimate,
i
will deideeither to broadast itsnewvalueor not to doso. Wedivide an iterationinto two parts, in the rstpart ofthe iteration,
onlynodeswithsignianthangein theirestimatesareallowedto sendmessages. However,in
theseondpart of theiteration,onlynodespolledbytheirneighbors from phase1are allowed
to send an update. As a node approahes the onsensus, the hange in its estimate beomes
smaller, and more nodes will stop sending messages during an iterationof the algorithm, and
themessagesinthesystemwilldisappearasymptotially. Duringthesilentperiodofeahnode,
itaumulates anerrorausedbytheabseneof itsmessages. Whenthesilentnodetransmits
again,it an alwaysredue theaumulatederror by redistributingit in thenetworkand thus
savingmessages whilepreservingtheaverage.
Before starting the linear iterative equation, nodes will selet weights as in the standard
onsensus algorithm. The weight matrixonsidered here must be doubly stohasti with
0 <
α < w ii < 1 − α < 1
forsome onstantα
. Eah nodei
inthenetworkkeepstwostatevaluesatiteration
k
:
x i (k)
: theestimateofnodei
usedin theiterativeequationsbytheothernodes.
e i (k)
: a real value that monitors the shift from the average due to the iterations wherenode
i
didnotsendamessage toitsneighbors. Itisinitiallyset tozero,e i (0) = 0
.Eahnodealsokeeps itsownboundarythreshold
ǫ i (k)
whereǫ i (1) = ǫ 2 = constant ∀i
. Notethatthisepsilonisinreasedaftereverytransmissionasintheentralizedase,butthedierene
hereisthat itisloaltoevery node.
Eahiterationisdividedintotwophases:
Intherstphase,anode
i
an bein oneofthetwo followingstates: Transmit: Theset ofnodesorrespondingtothisstateis
T k
,wherethesubindexk
orre-spondsto the fat that theset an hangewith every iteration
k
. Thenodes inT k
sendtheirnewalulatedestimatetotheirneighbors. Theyalsopollthenodeshavingmaximum
andminimumestimatesintheirneighborhood totransmitinphase2.
Algorithm 1TerminationAlgorithm-node
i
-Phase11:
{x i (k), e i (k)}
are the state values of nodei
at iterationk
,0 < α < w ii < 1 − α < 1
,counter i = 1
istheounterforthenumberoftransmissionssofar.ǫ i (1) = ǫ/2 ∈ R
,
T k
issetof
T ransmit
state.W k
set orrespondingtoW ait
state. Initially we haveT k = W k = ∅
. Every nodei
followsthefollowingalgorithmatiterationk
.2:
y i (k + 1) ← w ii x i (k) + P
j∈N i w ij x j (k)
3:
d i ← y i (k + 1) − x i (k) + e i (k)
4: if
|d i | < ǫ i (counter i )
then5:
i
hangestoa Wait state.\ \ i ∈ W k
6: else
7:
counter i = counter i + 1
8:
ǫ i (counter i ) = ǫ i (counter i − 1) + ǫ i (1)/counter i 2
9:
c i ← (1 − α w
ii )
³ y i (k + 1) − x i (k) ´
10: if
|c i | ≤ |e i (k)|
then11:
x i (k + 1) ← y i (k + 1) +
sign(c i .e i (k))c i
12:
e i (k + 1) ← e i (k) −
sign(c i .e i (k))c i
13: else
14:
x i (k + 1) ← y i (k + 1) + e i (k)
15:
e i (k + 1) ← 0
16: endif
17:
i
hangestoa Transmit state.\ \ i ∈ T k
18: Notify theneighbors havingmaximumand minimumvalues.
19: endif
20: GotoPhase2
Wait: Thesetofnodesorrespondingtothisstateis
W k
. Thenode'sdeisionwillbetakenin the seond phaseof theiteration based on the ation of nodes in the Transmit state
(dependingiftheywerepolledbyanyoftheirneighbors).
Intheseondpartoftheiteration,nodesthatarein
W k
willbelassied asfollows: Silent: Theset of nodesorresponding to this stateis
S k
. Theseare thenodesthat willremainsilentwith nomessagesentfromtheirpart in thenetwork. Thenodesin
S k
havethatnonoftheirneighborssendingthemanypollmessage.
Cut-Balane: Theset of nodesorrespondingto this stateis
B k
. They arealledCut − Balance
beause they insure the ut-balane ondition (d) of theorem2
. They are thenodesin
W k
that havebeenpolledbyatleastoneneighbor inT k
.The two phases of the termination protool implemented at eah node are desribed by
pseudoodeinAlgorithm1and2. Nodesinthe
T k
set(thesetofnodesthatareinaT ransmit
state)willbroadasttheirestimatetotheirneighborsattheendoftherstphase,whilenodesin
W k
set(orW ait
state)willpostponetheirdeisiontosendornottillthenextphase. Nodesthatdonotreeiveamessage fromtheirneighbors ata ertainiteration,usesthelast seenestimate
fromthespeiedneighbors(note: abseneofmessagesfromaneighborduringaniterationdoes
not meanthe failureof link,it meansthat theneighbor is broadasting thesame oldestimate
as before, so we may dierentiate the link failure by a keep alive message sentfrequently to
maintainonnetivityand set ofneighbors). Theinput forthealgorithm are theestimatesof
the neighbor of
i
, the weights seleted forthese neighbors, and thestate values{x i (k), e i (k)}
.Algorithm 2TerminationAlgorithm-Phase 2
1:
{x i (k), e i (k)}
arethestatevalues ofnodei
atiterationk
.2: for allnodes
i
havingWait statedo3:
y i (k + 1) ← w ii x i (k) + P
j ∈ N i w ij x j (k)
4: if
i
reeiveda pollmessagefrom anyneighborthen5:
z i (k + 1) ← (w ii + P
j∈N i ∩W k w ij )x i (k) + P
j∈N i ∩T k w ij x j (k)
6:
x i (k + 1) ← z i (k + 1)
7:
e i (k + 1) ← y i (k + 1) − z i (k + 1) + e i (k)
8:
i
hangesto aCut − Balance
state.\ \ i ∈ B k
9: else
10:
x i (k + 1) ← x i (k)
11:
e i (k + 1) ← y i (k + 1) − x i (k) + e i (k)
12:
i
hangesto aSilent state.\ \ i ∈ S k
13: endif
14: endfor
15:
k + 1 ← k
Theoutputoftherstphaseisthenewstatevalues
{x i (k + 1), e i (k + 1)}
fornodesinT k
andtheoutput of theseond phase is thenew statevalues
{x i (k + 1), e i (k + 1)}
for nodes inW k
.Let us go through the lines of the algorithm. In phase 1,
y i (k + 1)
of line2
is the weightedaverage oftheestimates reeivedby node
i
; withoutthe terminationprotoolthis valuewould be sent to all itsneighbors. The protool evaluateshowmuhy i (k + 1)
diersfrom thestatevalue
x i (k)
. Thisdiereneaumulatesind i
inline3
. Ifthisshiftislessthanagiventhresholdǫ i
,the nodewill wait fornextphaseto take deision. Ifthe onditionin line4
isnotsatised,thatmeansthenodewillsenda newvalueto itsneighbors. Lines
7 − 8
onernstheextendingofthe boundarythreshold
ǫ i (k)
after every transmission. Note that bythis extensionmethod, wehaveǫ i (k) < ǫ ∀i, k
sinek lim →∞ ǫ i (k) = ǫ i (1)(
∞
X
i=1
1/k 2 )
< ǫ i (1) × 2
= ǫ.
(25)Weintrodueinline
9
anewsalarc i
usedfordeidingwhihportionofe i (k)
thenodewillsendinthenetwork. Inlines
11 − 12
and14 − 15
,thealgorithmsatisestheequation(18 ). Thenthenewstatevalue
x i (k + 1)
issenttotheneighborsande i (k + 1)
isupdatedaordingly. InPhase2
of the algorithm (Algorithm2), nodes initially in the wait statewill deide either to send aut-balanemassageortoremainsilent,theutbalanemessagesaresentwhenanodereeives
apollmessagefromanyofitsneighbors.
5.4 Convergene study
Theonvergeneofthepreviousalgorithmismainlyduetothefatthattheproposedalgorithm
satisestheonditionsofonvergenegivenin5.2.2. Infat,thealgorithmisdesignedtosatisfy
alltheseonditions thatguaranteeonvergene. Startingwiththestateequation,weannotie
fromthealgorithm1giventhatwhatevertheonditionthenodesfae,itisalwaystruethatthe
sumofthenewgeneratedstatevalues
{x i (k + 1), e i (k + 1)}
isas follows:x i (k + 1) + e i (k + 1) = y i (k + 1) + e i (k),
where
y i (k + 1) = w ii x i (k) + P
j ∈ N i w ij x j (k)
. Asaresultthesystemequationistheonestudiedin setion5.2.2(equation(18)).
Before going through the dierent onditions in the theorem
2
, we should also show thate (k + 1) = e (k) − F(k) x (k)
for some matrixF (k)
suh thatF(k) 1 = 0
. Aording to the algorithmwean write,e i (k + 1) = e i (k) − v i (k),
(26)where
v i (k)
diersaording to thestateofthe nodei
, but itonlydepends ontheestimateofnode
i
anditsneighbors:v i (k) =
± (1 − α w
ii )
³ y i (k + 1) − x i (k) ´
if
i ∈ T k − (1),
± (1 − αγ w
ii )
³ y i (k + 1) − x i (k) ´
if
i ∈ T k − (2), x i (k) − y i (k + 1)
ifi ∈ S k , z i (k + 1) − y i (k + 1)
ifi ∈ B k ,
(27)
where
T k − (1)
is theset of nodes subset inT k
where|c i | ≤ |e i (k)|
, andT k − (2)
set of nodeswhere
|c i | > |e i (k)|
. In thelatterase,e i (k + 1) = 0
, but wean always ndγ < 1
suh thate i (k + 1) = e i (k) − γ(
sign(c i .e i (k)c i ) = 0
wherec i = (1 − α w
ii ) (y i (k + 1) − x i (k))
.y i (k + 1)
andz i (k + 1)
areas indiatedinthealgorithmandarea linearombinationoftheelementsofx (k)
.From theequation of
v i (k)
, wean also see that it is a linear ombination of the elements ofx (k)
,suhthattheoeientssumto0
. Arowi
inF (k)
willbetheoeientsoftheestimatesx (k)
inv i (k)
,soF (k) 1 = 0
.Nowweanstudytheonditionsmentionedinthetheorem
2
onthematrixA(k) = W +F (k)
.Lemma 1.
A(k)
isastohastimatrixthat satisesonditions(a),(b),and() ofTheorem2
.Proof. First,weanseethat
A(k) 1 = 1
sineW 1 = 1
andF(k) 1 = 0
. Itremainstoprovethat allentries inthematrixA(k)
arenonnegative.Wewillprovethisby onsideringeah row
i
ofA(k)
aording to theationtakenbynodei
. Weandistinguishfourases:1. Node
i ∈ T k
-ondition1:|c i | ≤ |e i (k)|
a ii = w ii − 1 − α w
ii × (1 − w ii ) = w ii − α > 0
sinew ii > α
and
a ij = w ij + 1 − α w
ii × w ij ≥ w ij > 0 ∀j ∈ N i
.or
a ii = w ii + 1 − α w
ii × (1 − w ii ) > α
sinew ii > α
and
a ij = w ij − 1 − α w
ii × w ij > 0 ∀j ∈ N i
sineα < w ii < 1 − α
.2. Node
i ∈ T k
-ondition2:|c i | > |e i (k)|
sine
|c i | > |e i (k)|
,weanalwaysndpositiveγ < 1
,suhthata ii = w ii − 1 − γα w
ii × (1 − w ii ) = w ii − γα > 0
sinew ii > α
and
a ij = w ij + 1− γα w
ii × w ij ≥ w ij > 0 ∀j ∈ N i
.or
a ii = w ii + (1− γα w ii ) × (1 − w ii ) > α
sinew ii > α
and
a ij = w ij − 1 − γα w
ii × w ij > (1 − α α )w ij > 0 ∀j ∈ N i
.3. Node
i ∈ S k
:then
a ii = w ii + (1 − w ii ) = 1
and
a ij = 0 ∀j 6= i
.4. Node
i ∈ B k
:then
a ii ≥ w ii > 0
and
a ij ∈ {w ij , 0} ∀j 6= i
.Therefore,
A(k)
isstohastiateveryiterationk
.Denition1. Twomatries,AandB,aresaidtobeequivalentwithrespettoavetor
v
ifand onlyifA v = B v
.Notiethat
A(k)
satisesonditions(a),(b), and()of Theorem2
,but possiblynottheutbalaneondition(d)beausefor anode
i ∈ T k
that transmits,a ij (k) > 0 ∀ j ∈ N i
, butitanbethat
∃j ∈ N i
suh thata ji = 0
ifj
was silentatthat iteration(j ∈ S k
). However,thenexttheoremshowsthatthereisamatrix
B(k)
equivalenttoA(k)
withrespettox (k)
thatsatisesalltheonditions.
Lemma 2. For all
k
, there exists amatrixB(k)
equivalent toA(k)
with respet tox (k)
suhthat
B(k)
satisesthe onditions(a),(b),(),and(d)of Theorem2
.Proof. Let
m(k) = argmin j ∈ N i x j (k)
andM (k) = argmax j ∈ N i x j (k)
,wewillprooftheexisteneof
B(k)
bymodifyingA(k)
insuhawaytopreservetheproperties(a)to()andtoaddthenewproperty(d). For simpliity ofnotationwewill drop
k
from thevariablessine thisis trueforevery
k
. Noterstthat theondition(d)isnotsatisedinA
onlyfortherowswherei
belongsto
T k
, leta i
denotethe rowi
ofA
andb i
denotetherowi
ofB
. Sine anynodei
inT k
mustpollthenodes
m
andM
totransmitinPhase 2,thenwearesurethattheolumni
hasatleastthreenonzeroelements(
a ii , a mi ,
anda M i
). LetC i = {j | a ji > 0 , i 6= j}
, soweare surethatC i
ontainsatleasttwo elementsm
andM
. Theutbalaneonditionrequiresthat therowofi
mustonlyhavepositivevalues attheindexwheretheolumnispositive. Wean writethata i x (k) = a ii x i (k) + X
j ∈ N i
a ij x j (k)
= a ii x i (k) + X
j ∈ C i
a ij x j (k) + X
j ∈ N i − C i
a ij x j (k)
= a ii x i (k) + X
j∈C i
a ij x j (k) + hx M (k) + f x m (k),
(28)where
h =
P
j∈ Ni − Ci a ij (x j − x m ) x M − x m
,
f =
P
j∈ Ni − Ci a ij (x M − x j ) x M − x m
. Sine
h ≥ 0
,f ≥ 0
andf + h = P
j ∈ N i − C i a ij
,weandenetherowvetorb i
tobe:b i :=
b ij = a ij
ifj = i, b ij = a ij + f
ifj = m, b ij = a ij + h
ifj = M,
b ij = a ij
ifj ∈ C i − m − M, b ij = 0
ifj ∈ N i − C i .
(29)
Finally,
b i x (k) = a i x (k)
and itsatises theonditions (a) to (), so∀i ∈ T k
, wereplaea i
byb i
andwegetthenewmatrixB
whihisequivalenttoA
withrespettox (k)
.Lemma3. Themessageredutionalgorithm(Phases1,2)satisesondition(e)ofTheorem
2
.Proof. Wewill proveit byontradition. Suppose
lim k →∞ x (k) = x ⋆
, butlim k →∞ F (k) x (k) 6=
0
, then there exists a nodei
suh thatlim k →∞ x i (k) = x ⋆ i
andlim k →∞ y i (k + 1) = w ii x ⋆ i + P
j ∈ N i w ij x ⋆ j = y ⋆ i
, buty ⋆ i − x ⋆ i = δ ⋆ > 0
. From Algorithm 1 , we an see that the node willenteratransmitstateinnitelyoften(beause
d i
inreases linearlywithδ ∗
anditwillreahthethreshold
ǫ i
). Then, thenodei
willupdateitsestimateaordingtotheequationx i (k + 1) = y i (k + 1) + α
1 − w ii
(y i (k + 1) − x i (k)).
Letting
k → ∞
yields(1 + α
1 − w ii )δ ⋆ = 0.
Thus,
δ ⋆ = 0
whihisaontradition,andthealgorithmsatisesondition(e)ofTheorem2.Thealgorithmalsoprovidesthat
|e i (k)| ≤ ǫ i (k) ∀k, i
andǫ i (k) < ǫ ∀i, k
,as intherstphasethisonditionissatisedbyonstrution,andfortheseond phaseoftheiteration,nodesfrom
Phase
1
an hek forworst aseanalysis and theyonly enter into Wait stateifthey aresurethat theonditionanbesatisedinthenextphaseiteration.
Nowwearereadytostatethemain Theoreminthissetion:
Theorem 3. The nodes applying the message reduing algorithm given in pseudoode by Al-
gorithm 1 and 2, have estimates onverging to a onsensus within a margin
ǫ
fromx ave
, i.e.lim k →∞ x (k) = x ′ ave 1
and|x ′ ave − x ave | ≤ ǫ.
Proof. Thetheorem isdue to thefat that theLemmasgiven in thissubsetion show thatthe
algorithmsatisesalltheonvergeneonditions ofTheorem
2
.5.5 Asymptoti Termination
Wehaveprovedintheprevioussetionthatthealgorithmproposedisonvergingtoaonsensus.
We will usethis to show that any node
i
an inreasetheboundarythresholdǫ i (k)
at ertaintimes
k s , s = 0, 1, 2, ...
(i.e.ǫ i (k s ) = ǫ i (k s −1 ) + ǫ(0)/s 2
)suhthat thesilentperiod ofthisnode(
α i (s)
,theonseutivenumberofiterationsthatanodei
didnotsendanymessage)isgrowingtoinnity. Thesystemequationwehadfollowingourmessage savingalgorithmisasfollows:
x (k + 1) = A(k) x (k),
(30)whereA(k)was astohastimatrix.
LetusdeneforamatrixAtheproperoeientofergodiity
τ(A)
tostudytheonvergenerateofthesystem(formoreinformationonproper oeientsofergodiitysee[16 ℄),
τ(A) = 1 2 max
i,j n
X
s=1
|a is − a js |.
(31)Letalso
U p,r
bether
-stepbakwardprodutofthematrixA(k):U p,r = A(p + r)...A(p + 2)A(p + 1).
(32)Theorem 4. Ergodiity of bakwards produts
U p,r
formedfrom agiven sequeneA(k), k ≥ 1
,obtainsifandonlyifthereisastritlyinreasingsequeneofpositiveintegers
{k s }, s = 0, 1, 2, ...
suhthat
∞
X
s=0
{1 − τ (U k s ,k s+1 − k s )} = ∞.
(33)Proof. [16 ,p.155℄.
Sineoursystemisergodi(onverges)asweprovedinprevioussetion,thistheoremimplies
that foranypositiveonstant
δ < 1
wehave a stritly inreasingsequene ofpositiveintegers{k s }, s = 0, 1, 2, ...
suhthatτ(U k s ,k s+1 − k s ) ≤ δ.
(34)By theinrementofthethreshold
ǫ i (k)
atinstanesk s
,wehavethat thesilentperiodα i (s)
ofa node
i
isthe number ofiterationsnodei
is silent after itslast inrement at timek s
. Thesilentperiod satisesthefollowingequation:
α i (s) ≥ ǫ
s 2 ¡
W x (k s ) − x (k s ) ¢
i
,
(35)let
α(s)
betheminimumaross allloalα i (s)
,wehave:α(s) ≥ ǫ
s 2 ||W x (k s ) − x (k s )|| ∞
.
(36)Sine
W
isastohastimatrix,thenallthevaluesofthevetorW x (k s )
belongtotheinterval[min i x i (k s ), max i x i (k s )]
,sowehave,||W x (k s ) − x (k s )|| ∞ ≤ max
i,j |x i (k s ) − x j (k s )|,
(37)butfromthedenition oftheoeientofergodiitywehavethat
max i,j |x i (k s ) − x j (k s )| ≤ τ(U k s−1 ,k s − k s−1 )×
{max i,j |x i (k s − 1 ) − x j (k s − 1 )|},
(38)andweanonlude thatthesilentperiod isgrowingexponentiallyin
s
:α(s) ≥ ǫ
Cs 2 δ s ,
(39)where
C
isjusta onstantdependsontheinitialstatevetorx (0)
.Andtheasymptotiterminationisobtained:
s lim →∞ α(s) = ∞.
(40)Eventhoughnodesarenotawareofthesetime
k s
wheretheyhavetoinrementthethreshold,withaninrementation
ǫ i (m)
attimesm
,the systemisvery robustis thesense that nodesdonothavetobesynhronizedanderrorsin wrongtimeinrementation analsobetolerated and
donotaet theonvergeneas longas
m 2 = o(δ s )
,whereo(.)
isthesmall-ohnotation(inthestudyofonvergene
m
wasequaltos
). Inthesimulationsandasshowninthealgorithm1,we inrementedm
(counter i
in thealgorithm)whenever anodeis goingto transmitat phaseone,andtheresultsaresatisfatory.
5.6 Simulations
To simulate the asymptoti termination of the algorithm desribed above, we onsidered two
typesof graphs with
n = 50
, the Random Geometri Graphs(RGG) with onnetivity radiusr = 0.234
, and the Erdos Renyi (ER) with average degree4
. All the graphs onsidered are0 1000 2000 3000 4000 5000
−6
−5
−4
−3
−2
−1 0
iteration number
log(normalized error)
RGG n=50 r=0.234
0 1000 2000 3000 4000 5000
−5
−4.5
−4
−3.5
−3
−2.5
−2
−1.5
−1
−0.5 0
iteration number
log(normalized error)
ER n=50 average degree=4
Figure3: Normalized erroronRGG andERgraphs.
0 1000 2000 3000 4000 5000 0
5 10 15 20 25 30 35 40 45 50
iteration number
number of nodes transmiting
RGG n=50 r=0.234
0 1000 2000 3000 4000 5000
0 5 10 15 20 25 30 35 40 45 50
iteration number
number of nodes transmitting
ER n=50 average degree=4
Figure4: Messagessentwithevery iteration.