izing (or minimizing) consensus algorithms are simply based on that each node updates its state to the maximal (minimal) state among its neighbors [@max1; @max2]. Asymptotic convergence is common in the study of averaging consensus algorithms [@caoming1; @ren; @tsi11; @jad03], while it has been shown that maximizing algorithms converge in general in finite time [@max1; @max2]. Finite-time convergence of averaging algorithms was investigated in [@cortes] for a continuous-time model, and recently finite-time consensus in discrete time was discussed in [@it] for a special case of gossiping [@boyd].

In this paper, we make the simple observation that averaging and maximizing algorithms can be viewed as instances of a more general distributed processing model. Using this model the transition of the consensus convergence can be studied for the two classes of distributed algorithms in a unified way. Each node iteratively updates its state as a weighted average of its own state together with the minimum and maximum states of its neighbors. By special cases for the weight parameters, averaging and maximizing algorithms can be analyzed. Under this uniform model, we prove for averaging that finite-time consensus is impossible in general, and asymptotical consensus is possible only when the node self-confidence satisfies a divergence condition. Both time-dependent and state-dependent graphs are considered, and various necessary and/or sufficient conditions are presented on the consensus convergence. For time-dependent graphs, we show that quasi-strong connectivity (existence of a spanning tree) is critical for averaging, as is strong connectivity for maximizing. We use a $\mu$-nearest-neighbor rule to generate state-dependent graphs, in which each node interacts with its $\mu$ nearest smaller neighbors ($\mu$ neighbors with smaller state values), and the nearest $\mu$ larger neighbors. This model is motivated from recent studies of collective bird behavior [@pnas]. For averaging algorithms without node self-confidence under such state-dependent graphs, we show that $\mu+1$ is a critical value for the total number of nodes: finite-time consensus is achieved globally if the number of nodes is no larger than $\mu+1$, and finite-time consensus fails for almost all initial conditions if the number of nodes is larger than $\mu+1$. Moreover, it is shown that this critical number of nodes is instead $2\mu$ if each node chooses to connect only to neighbors with distinct values in the neighbor rule.

The rest
izing (or minimizing) consensus algorithms are simply based on that each lymph node update its state to the maximal (minimal) state among its neighbor [ @max1; @max2 ]. Asymptotic overlap is common in the study of averaging consensus algorithm [ @caoming1; @ren; @tsi11; @jad03 ], while it has been show that maximizing algorithm converge in cosmopolitan in finite time [ @max1; @max2 ]. Finite - time overlap of averaging algorithms was investigate in [ @cortes ] for a continuous - meter model, and recently finite - time consensus in discrete time was discussed in [ @it ] for a special event of gossiping [ @boyd ]. 

 In this paper, we make the dim-witted observation that averaging and maximizing algorithms can be see as instances of a more general distributed processing model. Using this exemplar the transition of the consensus convergence can be studied for the two classes of distributed algorithms in a unified way. Each node iteratively updates its state as a weighted average of its own state together with the minimum and maximum states of its neighbor. By special cases for the weight unit argument, averaging and maximizing algorithms can be analyze. Under this uniform model, we prove for averaging that finite - meter consensus is impossible in general, and asymptotical consensus is possible only when the node self - confidence satisfies a divergence circumstance. Both time - dependent and state - dependent graphs are considered, and various necessary and/or sufficient condition are give on the consensus convergence. For time - dependent graph, we show that quasi - strong connectivity (existence of a spanning tree) is critical for averaging, as is strong connectivity for maximizing. We use a $ \mu$-nearest - neighbor rule to generate country - dependent graphs, in which each lymph node interacts with its $ \mu$ nearest smaller neighbors ($ \mu$ neighbor with smaller department of state values), and the nearest $ \mu$ bombastic neighbors. This mannequin is motivated from recent studies of collective bird behavior [ @pnas ]. For averaging algorithms without node self - assurance under such state - dependent graph, we show that $ \mu+1 $ is a critical value for the total number of nodes: finite - prison term consensus is achieved globally if the number of nodes is no big than $ \mu+1 $, and finite - time consensus fails for almost all initial conditions if the number of nodes is bigger than $ \mu+1$. furthermore, it is shown that this critical number of nodes is instead $ 2\mu$ if each node chooses to connect only to neighbor with distinct values in the neighbor rule. 

 The respite
izijg (or minimizing) consensms algorithms arg wimply based on that each node updates its state ti the maximal (minimal) state among itd neighbirs [@nqx1; @max2]. Asymptotic gjnvednence ms common in thg study of aeeraging consetsjs algorithms [@caoming1; @ren; @tsi11; @jad03], whije it hss been shown thwt msvimiapnn algorithms converge in general in finpte time [@max1; @max2]. Ginite-time convergence of wverwging algorithms wws investigqted un [@cortes] fof a continlmus-time mosel, and recently finite-time conrensux in discrgcw tlke was discnssed pn [@it] for a sivcial cdse of bossiping [@boyd].

Ln thms pqper, we make the simpne observation thaj averaginc cnd maximizing algorirhns cat be viedwd xs jnxtznces lf e more genedal distribyted processing modtl. Twing this modsl the twansition of the consensus convergence ban ge studied for the two xlasses of distributef algoritrms in a unified way. Each node iteratively updatev its rtaue as a qelghted average of its own state together with fht mpnimum and maximui states of ihs geighbors. By rpecial czses for the weighh paramgters, qveraging and maximizing algorithms can ve analyzed. Lndee this uniform modzl, we prove yor avgraginb that finite-time conseusus ia impossiblf in genedxl, and asymptotizal cmnsensus is possible only rhen the iode xelf-conwidemce saeisfies a fivernance condition. Botj timg-depengent and shate-dependent graphs are considxced, and varioos tecvssary anb/or sunficient condityons are preseuted on che covsensus cohvergenre. For time-dqpendent grapvd, we show thet quasi-seront cobnectivkgy (existence og a spannpny tree) is critical for averegine, as is strong cinntcrivity for maxomixind. Ae ufa a $\mu$-nearesd-neiehbut ruld to generabe rtatr-dependent graphs, in whidh each node interscbs with ijs $\mu$ neawest smaller meighbors ($\mu$ neighhors xith soallet sjate values), and the nearest $\mu$ marger nelghnors. This modql iw motivated yrom recent studies of collective bird bxhavior [@pnas]. For averagung algorithms withpmt node self-ronfidqnce undes such state-dependenr graphs, we show uhat $\mu+1$ is a critical vzlue fmr thf total number of nodes: finite-time consensus is achieved globally if the bumber of nodes is no kargeg tkan $\mu+1$, anq fiiive-time consensus gails for almost all initial coiditions ix che number of nodes is larger tfan $\mu+1$. Moreovgr, it is shown that this cditical mumber of nodes is instead $2\mu$ ig each node chooses to cpnnect obly tk neighborr with distinct vakues iu the beighboe rupe.

The rest
izing (or minimizing) consensus algorithms are simply that node updates state to the neighbors @max2]. Asymptotic convergence common in the of averaging consensus algorithms [@caoming1; @ren; @jad03], while it has been shown that maximizing algorithms converge in general in time [@max1; @max2]. Finite-time convergence of averaging algorithms was investigated in [@cortes] for continuous-time and finite-time in discrete time was discussed in [@it] for a special case of gossiping [@boyd]. In this we make the simple observation that averaging and algorithms can be viewed instances of a more general processing Using this the of consensus convergence can studied for the two classes of distributed algorithms in a unified way. Each node iteratively updates its as a of its state with minimum and maximum its neighbors. By special cases for averaging and maximizing algorithms can be analyzed. Under uniform model, prove for averaging that finite-time consensus impossible in general, and asymptotical consensus is possible when the node self-confidence satisfies a divergence condition. Both time-dependent and state-dependent graphs are considered, necessary and/or sufficient conditions presented on the convergence. time-dependent we that quasi-strong (existence of a spanning tree) is critical for averaging, as is connectivity for maximizing. We use a $\mu$-nearest-neighbor rule to generate in each node interacts its $\mu$ nearest smaller ($\mu$ with smaller state values), nearest larger is from studies of collective bird [@pnas]. For averaging algorithms without self-confidence under such state-dependent is a critical value for the total number nodes: finite-time consensus is achieved globally if number of nodes is no larger than $\mu+1$, and finite-time consensus fails almost all if the number of nodes is larger than Moreover, it is shown this critical number of nodes is instead $2\mu$ if node to connect to neighbors with values in the rule. The rest
izing (or minimizing) consensuS algorithmS are sImpLy bAsEd on That Each node updateS Its sTate to the maximal (minimaL) statE aMOng iTS nEighbOrs [@max1; @mAX2]. ASYMptOtIc ConVeRGeNce is ComMon in thE study of avEraGiNg consensus aLGoRithms [@caomIng1; @Ren; @tsi11; @jad03], whiLe iT has beEn ShoWN that MaxImiziNg algoRIthms cOnverge in GeNEral in FInite tiME [@MaX1; @max2]. finite-time convergENcE Of averaging algOrithmS wAS iNVEstIgaTed in [@corteS] fOr a coNTinuous-TImE MODel, ANd recently finIte-time consENsuS in disCrEte TIme was DiscuSsED in [@It] for a speciAl caSe of gossiPing [@boYD].

In this PAper, we mAke the SimPle ObseRVaTiOn tHaT AveRAgIng ANd mAximizinG aLgOrithMs caN BE VIeweD as InstAnces Of a more generaL diStriBUteD procEssinG modEl. using This moDel thE tRansition of the cOnseNsus conveRgeNcE caN bE studIEd for tHe tWo cLasses oF distriBUteD aLGORiThms in a unified way. EAcH NOdE iteratiVely upDAtEs ITs state aS a WeiGhteD AVeragE of iTS oWn state tOgetheR WiTh The miniMuM and maXiMum StaTes of ITs neIghborS. By speciAl casES for the weight pARameters, averaGInG ANd MAximIziNg algorithmS can BE anaLyzeD. unDer THis unIform MoDEl, WE prove for averaging tHaT finitE-time Consensus is imPossible in GENEral, and aSympTOtICal consensus is PossiBle only wheN The node sElf-coNfidence Satisfies A DIvergencE coNdiTioN. BoTH TiMe-dependent anD STate-DePendent GraPhs are cOnsIdeRed, And VaRious neceSsary and/Or SuFfIcIenT condITions are PrEseNtEd oN the cONsensuS convErgeNcE. FOR tiMe-depenDEnT GRaphS, wE sHow tHat QuAsi-stRong COnnEctivitY (existencE of A SpanNiNg Tree) is cRitical for aveRaGing, as is stRoNg cOnnectIVIty for maXimizing. We use a $\mu$-nearest-NEighbor RulE to geNeraTe state-dePenDent grAphS, In whicH each nOde inTeRacTS With iTS $\Mu$ NeaReSt smaller nEIGhbOrs ($\mu$ NeIghbOrs with Smaller state values), ANd tHe nearest $\mu$ laRgeR neiGHBoRs. THIs MOdeL iS MotIVAted from recent sTudies of coLlECtIve bird behAVioR [@pNas]. For aVeraginG algoRIthms wiThout node Self-confiDeNce uNDEr sUch state-dePendent gRaphs, we shOW that $\MU+1$ iS a criTicAl valuE fOr tHe totAl numbER of Nodes: Finite-TiMe consEnsus Is Achieved Globally if the number of noDes is nO largEr tHan $\mu+1$, and fIniTE-tiMe consensUs faIls for almoSt aLl iNitiaL coNDitioNs if THe NumBEr of nOdes IS larger thAN $\mU+1$. MoREOvEr, it is shown THAT thIs criTicAL numbeR of nOdes is instead $2\mu$ if EAch node chooses To coNNEct OnlY To neIgHbors with distiNct VaLUEs in the nEiGhbor rule.

ThE rest
izing (or minimizing) cons ensus algo rithm s a resi mply  bas ed on that eac h  nod e updates its state to  thema x imal (m inima l) stat e  a m o ngit snei gh b or s [@m ax1 ; @max2 ]. Asympto tic  c onvergence i s  c ommon in t hestudy of ave rag ing co ns ens u s alg ori thms[@caom i ng1; @ ren; @tsi 11 ;  @jad0 3 ], whil e it  has  been shown thatm ax i mizing algorit hms co nv e rg e ingen eral in fi ni te ti m e [@max 1 ;@ m a x2] .  Finite-timeconvergence ofaverag in g a l gorith ms wa si nve stigated in  [@c ortes] fo r a co n tinuous - time mo del, a ndrec entl y  f in ite -t i mec on sen s usin discr et etimewasd i s c usse d i n [@ it] f or a specialcas e of gos sipin g [@b oyd] .
In t his pa per,we  make the simpl e ob servation  th at  av er aging and ma xim izi ng algo rithmsc anbe v i ew ed as instances of  a m or e genera l dist r ib ut e d proces si ngmode l .  Usin g th i smodel th e tran s it io n of th econsen su s c onv ergen c e ca n be s tudied f or th e  two classes o f  distributeda lg o r it h ms i n a  unified wa y. E a ch n odei te rat i velyupdat es it s  state as a weighte daverag e ofits own state  togetherw i t h the mi nimu m  a n d maximum stat es of  its neigh b ors. Byspeci al cases  for thew e ight par ame ter s,ave r a gi ng and maximi z i ng a lg orithms  ca n be an aly zed . U nde rthis unif orm mode l,  w epr ove  fora veraging  t hat  f ini te-ti m e cons ensus  isim po s sib le in g e ne r a l, a nd  a symp tot ic al co nsen s usis poss ible only  wh e n th eno de self -confidence s at isfies a d iv erg ence c o n dition.Both time-dependent and state-d epe ndent  gra phs are c ons idered , a n d vari ous ne cessa ry  an d / or su f f ic ien tconditions a represe nt ed o n the c onsensus convergen c e.For time-depe nde nt g r a ph s,w es how  t h atq u asi-strong conn ectivity ( ex i st ence of as pan ni ng tree ) is cr itica l  for av eraging,as is str on g co n n ect ivity formaximizi ng. We us e  a $\ m u$ -near est -neigh bo r r ule t o gene r ate  stat e-depe nd ent gr aphs,  i n whicheach node interacts wit h its$\mu$  ne arest sma lle r  ne ighbors ( $\mu $ neighbor s w ith  smal ler state  val u es ),a nd th e ne a rest $\mu $  l arg e r  n eighbors. T h i s  mo del i s m o tivate d fr om recent studies of collectivebird b eha vio r  [@p na s]. For averag ing  a l g orithmswi thout nodeself-con fi d enceundersuch s tate-de p e nd e nt gra phs,  we  show tha t $ \m u +1$ isacr i ticalvalu efor th e tota l  num b e r of nodes: fini te-ti m e  cons e nsu s isac hievedg loba lly if the  number ofnodesis n o lar ger tha n$\mu+1 $,an d finite-t i me consen sus f ails fo ralmo stall in itia l condi tion sifthe numbe r of no de s  is  lar ger t ha n $\ mu+1$. Mo r eover, i t i s  shownth att h is cri t ic a l  number of  no des i s instead $2 \ mu$i fe ach n ode ch oosesto conn e cton ly to n eig h b ors withdistinctv alu es  inthe neig hb or r ul e.
T he rest
izing (or_minimizing) consensus_algorithms are simply based_on that_each_node updates_its_state to the_maximal (minimal) state_among its neighbors [@max1;_@max2]. Asymptotic convergence_is_common in the study of averaging consensus algorithms [@caoming1; @ren; @tsi11; @jad03], while it_has_been shown_that_maximizing_algorithms converge in general in_finite time [@max1; @max2]. Finite-time_convergence of_averaging algorithms was investigated in [@cortes] for a_continuous-time_model, and recently_finite-time consensus in discrete time was discussed in [@it]_for a special case of gossiping_[@boyd].

In this paper,_we_make_the simple observation that_averaging and maximizing algorithms can be_viewed as instances of a more_general distributed processing model. Using this model_the transition of the consensus convergence_can be studied for the_two classes_of distributed algorithms in a_unified way. Each_node iteratively_updates its state_as a weighted average of its_own state together_with the minimum and maximum states_of_its neighbors. By_special_cases_for the_weight parameters, averaging_and_maximizing algorithms_can_be analyzed. Under this uniform model,_we_prove for averaging that finite-time consensus is_impossible in general, and_asymptotical_consensus is possible only_when the node self-confidence satisfies_a divergence condition. Both time-dependent and_state-dependent graphs_are considered,_and various necessary and/or sufficient conditions are presented on the consensus_convergence. For time-dependent graphs, we show_that quasi-strong connectivity (existence_of a_spanning_tree) is critical_for_averaging, as_is strong connectivity for maximizing. We use_a $\mu$-nearest-neighbor_rule to generate state-dependent graphs, in_which each node interacts_with_its $\mu$ nearest smaller neighbors ($\mu$_neighbors with smaller state values), and_the nearest $\mu$ larger neighbors._This_model_is motivated from recent studies_of collective bird behavior [@pnas]. For_averaging algorithms without_node self-confidence under such state-dependent graphs, we_show_that $\mu+1$ is a critical value_for_the total number of nodes: finite-time_consensus_is_achieved globally if the number_of nodes is no larger than_$\mu+1$, and finite-time consensus fails for almost all initial_conditions if the_number of nodes is larger_than_$\mu+1$._Moreover, it is shown that this critical number of nodes_is instead_$2\mu$ if each_node chooses to connect only to neighbors with distinct values_in the neighbor rule.

The rest