Skip to main content
Springer logoLink to Springer
. 2021 Dec 24;84(4):1007–1029. doi: 10.1007/s00453-021-00905-9

Dynamic Averaging Load Balancing on Cycles

Dan Alistarh 1, Giorgi Nadiradze 1,, Amirmojtaba Sabour 1
PMCID: PMC8927032  PMID: 35330618

Abstract

We consider the following dynamic load-balancing process: given an underlying graph G with n nodes, in each step t0, a random edge is chosen, one unit of load is created, and placed at one of the endpoints. In the same step, assuming that loads are arbitrarily divisible, the two nodes balance their loads by averaging them. We are interested in the expected gap between the minimum and maximum loads at nodes as the process progresses, and its dependence on n and on the graph structure. Peres et al. (Random Struct Algorithms 47(4):760–775, 2015) studied the variant of this process, where the unit of load is placed in the least loaded endpoint of the chosen edge, and the averaging is not performed. In the case of dynamic load balancing on the cycle of length n the only known upper bound on the expected gap is of order O(nlogn), following from the majorization argument due to the same work. In this paper, we leverage the power of averaging and provide an improved upper bound of O(nlogn). We introduce a new potential analysis technique, which enables us to bound the difference in load between k-hop neighbors on the cycle, for any kn/2. We complement this with a “gap covering” argument, which bounds the maximum value of the gap by bounding its value across all possible subsets of a certain structure, and recursively bounding the gaps within each subset. We also show that our analysis can be extended to the specific instance of Harary graphs. On the other hand, we prove that the expected second moment of the gap is lower bounded by Ω(n). Additionally, we provide experimental evidence that our upper bound on the gap is tight up to a logarithmic factor.

Keywords: Algorithms, Load balancing

Introduction

This paper considers balls-into-bins processes where a sequence of m weights are placed into n bins via some randomized procedure, with the goal of minimizing the load imbalance between the most loaded and the least loaded bin. This family of randomized processes has been used to model several practical allocation problems, such as load-balancing [3, 14, 20], hashing [9], or even relaxed data structures [1, 2].

The classic formulation of this problem is known as d-choice process, in each step, a new weight is generated, and is placed in the least loaded of d randomly chosen bins. If d=1, then we have the uniform random choice scheme, whose properties are well understood, e.g. [18]. In particular, if we place m=n unit weights into the bins, then it is known that the most loaded bin will have expected Θ(logn/loglogn) load, whereas if m=Ω(nlogn) we have that the expected maximum load is m/n+Θ(mlogn/n). Seminal work by Azar et al. [3] showed that, if we place n unit weights into n bins by the d-choice process with d2, then, surprisingly, the maximum load is reduced to Θ(loglogn/logd). A technical tour-de-force by Berenbrink, Czumaj, Steger, and Vöcking [4] extended this result to the “heavily-loaded” case where mn, showing that in this case the maximum load is m/n+loglogn/logd+O(1) with failure probability at most 1/polyn. An elegant alternative proof for a slightly weaker version of this result was later provided by Talwar and Wieder [23].

More recently, Peres et al. [17] considered the graphical version of this process, where the bins are the vertices of a graph, an edge is chosen at every step, and the weight is placed at the less loaded endpoint of the edge, breaking ties arbitrarily. (The reader will notice that the classic 2-choice process corresponds to the case where the graph is a clique.) The authors focus on the evolution of the gap between the highest and lowest loaded bins, showing that, for graphs of β-edge-expansion [17], this gap is O(logn/β), with probability 1-1/polyn.

Another closely related line of work considers static load-balancing processes, where each node in a graph starts with an arbitrary initial load, and the endpoints average their current loads at each step. Note that load balancing schemes which are commonly used in this setting are usually more involved than simply averaging the loads of the endpoints of the randomly chosen node, but the tools used in their analysis are still applicable to the static version of our process. To analyze such processes, it is common to map the process to a Markov chain and analyse its convergence [6, 10, 12], or derive an upper bound on a potential function which captures the discrepancy between the loads [5]. In both cases, the gap between the highest and lowest loaded bins can be characterized by the spectral gap of the graph [7, 11, 19, 21, 22].

By contrast to these two lines of previous work, in this paper we consider a graphical load balancing in the dynamic case, where weights arrive at each step rather than being statically allocated initially, but we allow balancing via continuous averaging, i.e. the resulting weights after the balancing step equal the average of the sum of the weights of the two nodes prior to balancing. Thus, our averaging step is more powerful relative to d-choice or static averaging, but it is applied in the more challenging dynamic scenario.

We will focus on the gap in the dynamic case on graphs of low expansion, specifically on cycles. In [17], it is shown that, in this case (but without averaging), the gap is O(nlogn) both in expectation and with high probability. The techniques used in [17] imply that the averaging of the loads does not worsen the gap in expectation, our aim is to show that it actually helps to reduce it. Also, directly applying the tools from the static process to the dynamic one results in the upper bound which is larger than O(nlogn). Upper bounding the gap for cycle graphs is known to be a challenging open problem [16]. As suggested in [17], to deal with the cycle case, there is a need for a new approach, which takes the structure of the load balancing graph into account.

Contribution

In this paper, we address this question for the case where averaging is performed on a cycle graph. Let Gap(t) be a difference between highest and lowest loads of the nodes at time step t. We provide the upper bound on the gap in the dynamic, heavily-loaded case, via a new potential argument. More formally, for any t>0, we show that for a cycle graph with n vertices:

E[Gap(t)]=O(nlog(n)). 1

We show that our technique can be used to upper bound the gap for the 4-connected Harary Graph. We complement this result with a lower bound of Ω(n) on E[(Gap(t))2]. Further, we provide experimental evidence that the gap is of order Θ(n), making our upper bound accurate up to a logn factor. Our results extend to the case where the load generated at each node is weighted according to some distribution whose second moment is bounded. Formally, we allow our input to come from any distribution W, such that E[W2]M2, for some M>0.

Technical Overview

Our upper bound result is based on two main ideas. The first introduces a new parametrized hop-potential function, which measures the squared difference in load between any k-hop neighbors on the graph, where k1 is a fixed hop parameter. Let G=(V,E) be our input graph, where V={1,2,,n}. Throughout the paper, for any 1in we assume that the nodes i+n and i-n are the same as the node i. Let xi(t) be the load of node i at step t. Then, we define the k-hop potential as:

ϕk(t)=i=1n(xi(t)-xi+k(t))2.

The first technical step in the proof is to understand the expected (“steady-state”) value of the k-hop potential. We show that, in expectation, the k-hop potential has a recursive structure. While the expected values of k-hop potentials cannot be computed precisely, we can isolate upper and lower bounds on their values for cycles. In particular, for the k-hop potential on an n-cycle, we prove the following bound:

E[ϕk(t)]k(n-k)-1,k1. 2

In the second technical step, we shift gears, aiming to bound the maximum possible value of the gap between any two nodes, leveraging the fact that we understand the hop potential for any k1. We achieve this via a “gap covering” technique, which characterizes the maximum value of the gap across all possible subsets of a certain type.

More precisely, in the case of a cycle of length n=2m, for each node i and hop count k, we define the set family Aki to be formed of nodes {i,i+2m-k,i+2×2m-k,i+3×2m-k,} (since we are on a cycle, i=i+2m-k2k). Then for any 1km, we will have

i=1nGapAki(t)i=1nGapAk-1i(t)+n2m-kϕ2m-k(t), 3

where GapX(t) is the maximal gap inside the set X at time t. Intuitively, this result allows us recursively characterize the gap value at various “resolutions” across the graph.

Finally, we notice that we can “cover” the gap between any two nodes by carefully unwinding the recursion in the above inequality, considering all possible subsets of a well-chosen structure, and recursively bounding the gaps within each subset (this step is particularly delicate in the case where n is not a power of two, please see Sect. 5). We obtain that

E[Gap(t)]=O(nlog(n)), 4

as claimed. The logarithmic slack is caused by the second term on the right-hand-side of (2). We note that this technique extends to the case where inserted items are weighted, where the weights are coming from some distribution of bounded second moment.

Lower Bound

It is interesting to ask whether this upper bound is tight. To examine this question, we revisit the recursive structure of the k-hop potential, which we used to obtain the upper bound in Eq. (3). We can leverage this structure to obtain a lower bound on the expected k-hop potential as well. Starting from this lower bound, we can turn the upper bound argument “inside out,” to obtain a linear lower bound on the expected squared gap:

E[Gap(t)2]=Ω(n). 5

We conjecture that both upper and lower bounds on the expected gap are of order O(n) (given that E[W2] is constant), and examine this claim empirically in Sect. 6.

Extensions and Discussion

We believe that the analysis template we described above is general, and can be extended to other graph families, such as regular expanders. Here, we focus on obtaining tight bounds on the gap for cycles, which is technically non-trivial, and leave the extensions for other graph families as future work. To substantiate our generality claim, we exhibit an application of our analysis technique to the specific instance of Harary graphs [13] in Sect. 7. More precisely, we provide the upper bound on a gap for a graph on n vertices, where each vertex i is connected with edges to vertices i-2,i-1,i+1 and i+2.

We discuss the relation between our results and bounds for the graphical power-of-two process on a cycle [17] in Sect. 8.

Related Work

As we have already discussed broad background, we will now mainly focus on the technical differences from previous work. As stated, we are the first to specifically consider the dynamic case for continuous averaging on cycles. The static case has been studied both with continuous averaging [57, 1012, 19, 22] and discrete averaging [21]. However, their techniques would not apply (or would result in a worse bound) in our case, since we consider that weights would be introduced dynamically, during the processes’ execution.

To our knowledge, the only non-trivial upper bound on the gap of the process we consider which would follow from previous work is of O(nlogn), by the potential analysis of [17]: they consider 2-choice load balancing, and one can re-do their potential analysis for (continuous) averaging load balancing, yielding the same bounds. (Specifically, one can use the same definition of the potential Γ(t) as in this reference, and will obtain the same upper bounds, since the pairwise load balancing we consider has slightly stronger guarantees.) However, as our bounds show, the resulting analysis is quite loose in the case of cycle graphs, yielding an Ω(n) gap between the bounds yielded by these techniques. Technically, this is a consequence of the majorization technique used in [17], which links dynamic averaging on the cycle with a very weak form of averaging on the clique. Reference [8] studies the performance differences between various load-balancing techniques; specifically, it shows that continuous averaging cannot improve the bound on the gap relative to d-choice on the clique. Unfortunately, this result does not seem to extend to arbitrary graphs.

Our potential analysis is substantially different from that of [17], as they track a sum of exponential potentials across the entire graph. By contrast, our analysis tracks the squared load differences between k-hop neighbors, establishing recurrences between these potentials. We note that this is also different from the usual square potentials used for analyzing averaging load balancing, e.g. [15], which usually compare against the global mean, as opposed to pairwise potential differences. Our approach is also different from the classic analyses of e.g. [3], which perform probabilistic induction on the number of bins at a given load, assuming a clique.

Generally, our technique can be seen as performing the induction needed to bound the gap not on the bin loads, as is common in previous work, e.g. [3], but over the topology of the graph. This approach is natural, since we wish to obtain tight, topology-specific bounds, but we believe we are the first to propose and analyze it successfully.

Averaging on the Cycle: Upper Bounding the Gap

Preliminaries

We consider a cycle graph G=(V,E) where V={1,2,,n}, such that each node i is connected to its left and right neighbors, i-1 and i+1 (recall that for any 1in the nodes i+n and i-n are the same as the node i).

We consider a stochastic process following real time t0, in which, at each step t+1, a ball of weight w(t)0 is generated from a same distribution W. We associate a real-valued load xi(t) with each node i (xi(t) is the value after t steps). Initially, we have that xi(0)=0 for every node i. At step t+1, an edge (i,i+1) is chosen uniformly at random, and the two endpoint nodes update their weights as follows:

xi(t+1)=xi+1(t+1)=xi(t)+xi+1(t)+w(t)2.

We will assume that the second moment of the distribution W is bounded. That is: E[W2]M2, for some M>0. For simplicity, we will assume that weights are normalized by M. This gives us that E[W2]1.

Let X(t)=(x1(t),x2(t),,xn(t)) be the vector of the bin weights after step t. First, we define the following potential functions:

k{1,2,,n-1}:ϕk(t):=i=1n(xi(t)-xi+k(t))2.

Notice that for every 1in, we have that ϕi(t)=ϕn-i(t). We want to analyze what is the value of these functions in expectation after an additional ball is thrown, for a given load vector X(t).

We start with ϕ1(t+1):

E[ϕ1(t+1)|X(t),w(t)]=i=1n1n((xi(t)+xi+1(t)+w(t)2-xi+2(t))2+(xi(t)+xi+1(t)+w(t)2-xi-1(t))2+ji-1,i,i+1(xj(t)-xj+1(t))2). 6

Notice that:

i=1nji-1,i,i+1(xj(t)-xj+1(t))2=(n-3)ϕ1(t). 7

Hence we need to bound the remaining terms:

i=1n((xi(t)+xi+1(t)+w(t)2-xi+2(t))2+(xi(t)+xi+1(t)+w(t)2-xi-1(t))2)=i=1n(2xi(t)2+2xi+1(t)2+2w(t)2+4xi(t)xi+1(t)4+xi+2(t)2+xi-1(t)2-(xi(t)+xi+1(t))(xi-1(t)+xi+2(t))).

where we used the fact that terms, which are linear in w(t), cancel out.

The right side of the above equation can be rewritten as:

i=1nxi(t)22+i=1nxi+1(t)22+i=1nxi+2(t)2+i=1nxi-1(t)2+i=1nxi(t)xi+1(t)-i=1nxi(t)xi-1(t)-i=1nxi+1(t)xi+2(t)-i=1nxi(t)xi+2(t)-i=1nxi+1(t)xi-1(t)+nw(t)22=3i=1nxi(t)2-i=1nxi(t)xi+1(t)-2i=1nxi(t)xi+2(t)+nw(t)22=i=1n(xi(t)-xi+1(t))22+i=1n(xi(t)-xi+2(t))2+nw(t)22=ϕ1(t)2+ϕ2(t)+nw(t)22.

By using the above equation and Eq. (7) in Eq. (6) we get that

E[ϕ1(t+1)|X(t),w(t)]=n-2nϕ1(t)+12(w(t)2-ϕ1(t)n)+ϕ2(t)n.

Now, we proceed with calculating the expected value of ϕk(t+1),

for 2kn/2:

E[ϕk(t+1)|X(t),w(t)]=i=1n1n((xi(t)+xi+1(t)+w(t)2-xi-k(t))2+(xi(t)+xi+1(t)+w(t)2-xi+1-k(t))2+(xi(t)+xi+1(t)+w(t)2-xi+k(t))2+(xi(t)+xi+1(t)+w(t)2-xi+1+k(t))2+ji-k,i+1,i,i+1(xj(t)-xj+k(t))2).

Notice that:

1ni=1nji-k,i+1-k,i+k,i+1+k(xj(t)-xj+k(t))2=n-4nϕk(t).

In the similar way as for ϕ1(t) the remaining terms can be rewritten as:

i=1n1n(xi(t)2+xi+1(t)2+w(t)2+2xi(t)xi+1(t)+4xi2(t)-(xi(t)+xi+1(t))(xi+k(t)+xi+k+1(t)+xi-k(t)+xi-k+1(t)))=1n(nw(t)2+6i=1nxi(t)2+2i=1nxi(t)xi+1(t)-4i=1nxi(t)xi+k(t)-2i=1nxi(t)xi+k+1(t)-2i=1nxi(t)xi+k-1(t))=2nϕk(t)+(w(t)2-ϕ1(t)n)+ϕk+1(t)n+ϕk-1(t)n.

Hence, we get that:

E[ϕk(t+1)|X(t),w(t)]=n-2nϕk(t)+(w(t)2-ϕ1(t)n)+ϕk+1(t)n+ϕk-1(t)n.

If we remove conditioning on w(t) (note that E[w(t)2]=E[W2]) and express these equations for

ϕ1(t+1),ϕ2(t+1),,ϕn-1(t+1) (recall that ϕk(t)=ϕn-k(t)), we get:

E[ϕ1(t+1)|X(t)]=(n-2n)ϕ1(t)+12(E[W2]-ϕ1(t)n)+ϕ2(t)n.E[ϕ2(t+1)|X(t)]=(n-2n)ϕ2(t)+(E[W2]-ϕ1(t)n)+ϕ1(t)n+ϕ3(t)n.E[ϕn2(t+1)|X(t)]=(n-2n)ϕn2(t)+(E[W2]-ϕ1(t)n)+ϕn2-1(t)n+ϕn2+1(t)n.E[ϕn-2(t+1)|X(t)]=(n-2n)ϕn-2(t)+(E[W2]-ϕ1(t)n)+ϕn-3(t)n+ϕn-1(t)n.E[ϕn-1(t+1)|X(t)]=(n-2n)ϕn-1(t)+12(E[W2]-ϕ1(t)n)+ϕn-2(t)n. 8

Using the above equations we can prove the following:

Lemma 1

For every t0 and 1kn-1, we have that

E[ϕk(t)](k(n-k)-1)E[W2]k(n-k)-1. 9

Proof

Let Φ(t)=(ϕ1(t),ϕ2(t),,ϕn-1(t)) be the vector of values of our potentials at time step t and let Y=(y1,y2,,yn-1), be the vector containing our desired upper bounds for each potential. That is: for each 1in-1, we have that yi=(i(n-i)-1)E[W2].

An interesting and easily checkable thing about the vector Y is that

E[Φ(t+1)|Φ(t)=Y]=Y. 10

Next, consider the vector Z(t)=(z1(t),z2(t),zn-1(t))=Y-Φ(t). Our goal is to show that for every step t and coordinate i, E[zi(t)]0.

We have that

E[z1(t+1)|X(t)]=y1-E[ϕ1(t+1)|X(t)]=(n-2n)y1+12(E[W2]-y1n)+y2n-((n-2n)ϕ1(t)+12(E[W2]-ϕ1(t)n)+ϕ2(t)n)=(n-2n)z1(t)-z1(t)2n+z2(t)n.

and for 2in2, we have that

E[zi(t+1)|X(t)]=(n-2n)zi(t)-z1(t)n+zi+1(t)n+zi-1(t)n.

Hence we get the following equations (recall that zi(t)=zn-i(t)):

n×E[z1(t+1)|X(t)]=(n-2-12)z1(t)+z2(t).n×E[z2(t+1)|X(t)]=-z1(t)+z1(t)+(n-2)z2(t)+z3(t).n×E[z3(t+1)|X(t)]=-z1(t)+z2(t)+(n-2)z3(t)+z4(t).n×E[zn2(t+1)|X(t)]=-z1(t)+zn2-1(t)+(n-2)zn2(t)+zn2+1(t). 11

Next, using induction on t, we show that for every t0

0E[z1(t)]E[z2(t)]E[zn2(t)]. 12

The base case holds trivially since Z(0)=Y. For the induction step, assume that

0E[z1(t)]E[z2(t)]E[zn2(t)]. First, we have that

nE[z1(t+1)]=nEX(t)[E[z1(t+1)|X(t)]]=(n-2-12)E[z1(t)]+E[z2(t)]0.

Additionally, we have that:

nE[z1(t+1)]=(n-2-12)E[z1(t)]+E[z2(t)](n-2)E[z1(t)]+E[z2(t)](n-2)E[z2(t)]+E[z3(t)]=nE[z2(t+1)].

For 2in2-2, we have that

nE[zi(t+1)]=-E[z1(t)]+E[zi-1(t)]+(n-2)E[zi(t)]+E[zi+1(t)]-E[z1(t)]+E[zi(t)]+(n-2)E[zi+1(t)]+E[zi+2(t)]=nE[zi+1(t+1)].

Next, observe that by our assumption:

E[zn2+1(t)]=E[zn2-1(t)]E[zn2-2(t)]. Finally, by using this observation we get that

nE[zn2-1(t+1)]=-E[z1(t)]+E[zn2-2(t)]+(n-2)E[zn2-1(t)]+E[zn2(t)]-E[z1(t)]+E[zn2+1(t)]+E[zn2-1(t)]+(n-3)E[zn2-1(t)]+E[zn2(t)]-E[z1(t)]+E[zn2+1(t)]+E[zn2-1(t)]+(n-2)E[zn2(t)]=nE[zn2(t+1)].

This completes the proof of the lemma.

Upper Bound on the Gap for n=2m

In this section we upper bound a gap in expectation for the case when n=2m. is quite technical but not necessarily more interesting, and is provided in the Sect. 5.

We begin with some definitions. For a set A{1,2,,n}, let

GapA(t)=maxiAxi(t)-miniAxi(t).

Also, let Aki be {i,i+2m-k,i+2×2m-k,i+3×2m-k,} (Notice that i=i+2m-k2k). Our proof works as follows: for each 1in and 1km, we look at the vertices given by the sets Ak-1i and Ak-1i+2m-k and try to characterise the gap after we merge those sets (note that this will give us the gap for the set Aki=Ak-1iAk-1i+2m-k). Using this result, we are able to show that i=1nGapAki(t) is upper bounded by i=1nGapAk-1i(t) plus n times maximum load difference between vertices at hop distance 2m-k. Next, we use 2m-k hop distance potential ϕ2m-k(t) to upper bound maximum load difference between the vertices at hop distance 2m-k. By summing up the derived inequality for k=1 to m, we are able to upper bound i=1nGapAmi(t) in terms of i=1nGapA0i(t) and k=1mϕ2m-k(t). Notice that by our definitions, for each i, GapA0i(t)=0 (A0i contains only vertex i) and GapAmi(t)=Gap(t) (Ami contains all vertices). Hence, what is left is to use the upper bounds for the hop distance potentials, which we derived in the previous section.

We start by proving the following useful lemma.

Lemma 2

For any 1in and 1km, we have that

2GapAki(t)2maxjAki|xj(t)-xj+2m-k(t)|+GapAk-1i+2m-k(t)+GapAk-1i(t). 13

Proof

Fix vertex i. Recall that Aki=Ak-1iAk-1i+2m-k.

Let u=argmaxjAkixj(t) and let v=argminjAkixj(t). We consider several cases on the membership of nodes u and v, and bound the gap in each one:

Case 1 uAk-1i and vAk-1i. Then GapAki(t)=GapAk-1i(t) and we have that

GapAki(t)=|xu(t)-xv(t)||xu+2m-k(t)-xu(t)|+|xv+2m-k(t)-xv(t)|+|xu+2m-k(t)-xv+2m-k(t)||xu+2m-k(t)-xu(t)|+|xv+2m-k(t)-xv(t)|+GapAk-1i+2m-k(t)2maxjAki|xj(t)-xj+2m-k(t)|+GapAk-1i+2m-k(t),

where we used the fact that both u+2m-k and v+2m-k belong to Ak-1i+2m-k. This gives us that

2GapAki(t)2maxjAki|xj(t)-xj+2m-k(t)|+GapAk-1i+2m-k(t)+GapAk-1i(t). 14

Case 2 uAk-1i and vAk-1i+2m-k. Then we have that:

GapAki(t)=|xu(t)-xv(t)||xu(t)-xv+2m-k(t)|+|xv+2m-k(t)-xv(t)|GapAk-1i(t)+maxjAki(|xj(t)-xj+2m-k(t)|)

and

GapAki(t)=|xu(t)-xv(t)||xu(t)-xu+2m-k(t)|+|xu+2m-k(t)-xv(t)|GapAk-1i+2m-k(t)+maxjAki(|xj(t)-xj+2m-k(t)|),

where we used v+2m-kAk-1i and u+2m-kAk-1i+2m-k. Hence, we again get that

2GapAki(t)2maxjAki|xj(t)-xj+2m-k(t)|+GapAk-1i+2m-k(t)+GapAk-1i(t). 15

Case 3 uAk-1i+2m-k and vAk-1i+2m-k, is similar to Case 1.

Case 4 vAk-1i and uAk-1i+2m-k, is similar to Case 2.

Next, we upper bound the quantity i=1nmaxjAki|xj(t)-xj+2m-k(t)|.

Lemma 3

For any 1km:

i=1nmaxjAki|xj(t)-xj+2m-k(t)|n2m-kϕ2m-k(t). 16

Proof

Notice that for any i and iAki, we have that Aki=Aki,

hence maxjAki|xj(t)-xj+2m-k(t)|=maxjAki|xj(t)-xj+2m-k(t)| and this means that

i=1nmaxjAki|xj(t)-xj+2m-k(t)|=n2m-ki=12m-kmaxjAki|xj(t)-xj+2m-k(t)|Cauchy-Schwarzn2m-k2m-ki=12m-kmaxjAki|xj(t)-xj+2m-k(t)|2n2m-k2m-kj=1n|xj(t)-xj+2m-k(t)|2=n2m-kϕ2m-k(t),

where in the last inequality we used a fact that sets Ak1,Ak2,,Ak2m-k are disjoint.

Finally, using the above lemmas we can upper bound the expected gap at step t:

Theorem 1

For every t0, we have that

E[Gap(t)]=O(nlog(n)).

Proof

From Lemma 2 we have that

i=1n2GapAki(t)i=1nGapAk-1i(t)+i=1nGapAk-1i+2m-k(t)+i=1n2maxjAki|xj(t)-xj+2m-k(t)|=2i=1nGapAk-1i(t)+2i=1nmaxjAki|xj(t)-xj+2m-k(t)|.

After dividing the above inequality by 2 and applying Lemma 3 we get that:

i=1nGapAki(t)i=1nGapAk-1i(t)+n2m-kϕ2m-k(t).

Next, we sum up the above inequality for k=1 to m:

k=1mi=1nGapAki(t)k=1mi=1nGapAk-1i(t)+k=1mn2m-kϕ2m-k(t).

Recall that i=1nGapAmi(t)=nGap(t) and i=1nGapA0i(t)=0. Hence, we get that

nGap(t)k=1mn2m-kϕ2m-k(t).

Next, we apply Jensen’s inequality and Lemma 1:

nE[Gap(t)]k=1mn2m-kEϕ2m-k(t)k=1mn2m-kE[ϕ2m-k(t)]k=1mn2m-k2m-k(n-2m-k)mnn=n(logn)n.

This gives us the proof of the theorem.

Gap Lower Bound

Next we prove the following theorem, which lower bounds the second moment of the gap in expectation.

Theorem 2

The following limit holds:

limtE[Gap(t)2]=Ω(nE[W2])).

Proof

In this case we want to prove that not only does vector Z(t) have positive coordinates in expectation, but also E[zn2] converges to 0. This will give us that ϕn2 approaches its upper bound (n2n2-1)E[W2] in expectation. Then, we can show that there exist two nodes (at distance n2) such that the expected square of difference between their loads is Ω(nE[w2]).

Recall from Eq. (11) that

nE[zn2(t+1)]=-E[z1(t)]+E[zn2+1(t)]+E[zn2-1(t)]+(n-2)E[zn2(t)].

We also know that Inequalities (12) hold for every t, hence we get that

E[zn2(t+1)]E[zn2(t)]-E[z1(t)]n.

The above inequality in combination with Inequalities (12) means that

E[zn2(t+n2+1)]E[zn2(t+1)]-i=tt+n2E[z1(i)]nE[zn2(t+1)]-E[z1(t+n2)]n 17

Again by using Eq. (11) and Inequalities (12), we can show that for every 1in2-1:

E[zi(t+1)]E[zi+1(t)]n.

This gives us that:

E[z1(t+n2)](1n)E[z2(t+n2-1)](1n)2E[z3(t+n2-2)](1n)n2-1E[zn2(t+n2-(n2-1))]=(1n)n2-1E[zn2(t+1)].

By plugging the above inequality in Inequality (17). we get that

E[zn2(t+n2+1)]E[zn2(t+1)]-E[z1(t+n2)]nE[zn2(t+1)]-(1n)n2E[zn2(t+1)]=(1-(1n)n2)E[zn2(t+1)].

Because (1-(1n)n2)<1 and does not depend on t, we get that

limtE[zn2(t)]=0.

This means thatlimtE[ϕn2(t)]=Ω(n2E[W2]).

Let Gapn2(t)=max1in|xi(t)-xi+n2(t)|. Note that:

Gap(t)2Gapn2(t)2ϕn2(t)n.

Hence

limtE[Gap(t)2]=Ω(nE[W2]).

Unfortunately we are not able to obtain the lower bound on the gap, since our approach uses the fact that the upper bounds on k-hop potentials are ’tight’. Since our potentials are quadratic, we are not able to derive any kind of lower bound for the gap itself. Intuitively, this will be an issue with any argument which uses convex potential.

Upper Bound on the Gap, General Case

To prove Theorem 1 for the general case, we need to redefine our sets Aki. In order to do this, for each k we define 2k dimensional vector Δk=(δk1,δk2,,δk2k). For k=0, we have that Δk=(n). For lognk>0 we set Δk=(αk,δk-11-αk,αk,δk-12-αk,,αk,δk-12k-1-αk). where

αk=n2k-1/2,ifn2k-1is even.n2k-1/2,otherwise.

First we prove the following Lemma:

Lemma 4

For any lognk0, we have that

1. i=12kδki=n.

2. For any 1i2k, δki{n2kn2k} (notice that this means αk=n2k or αk=n2k).

Proof

We prove the lemma using induction on k. Base case k=0 holds trivially. For the induction step, assume that Properties 1 and 2 hold for k-1, we aim to prove that they hold for k as well. We have that i=12kδki=i=12k-1(αk+δk-1i-αk)=i=12k-1δk-1i=n. To prove Property 2 we consider several cases:

Case 1 n2k-1=2q, for some integer q.

We have that αk=q, and hence for any 1i2k-1, δk-1i-αk=q. Since n2k=q, Property 2 holds.

Case 2 n2k-1=2q+1, for some integer q.

We have that αk=q, and hence for any 1i2k-1, δk-1i-αk=q+1. Since n2k=q and n2k=q+1, Property 2 holds.

Case 3 n2k-1=2q+ϵ, for some integer q and 0<ϵ<1.

We have that n2k-1=2q and n2k-1=2q+1. Additionally, αk=q, and hence for any 1i2k-1, (δk-1i-αk){q,q+1}. Since n2k=q and n2k=q+1, Property 2 holds.

Case 4 n2k-1=2q+1+ϵ, for some integer q and 0<ϵ<1.

We have that n2k-1=2q+1 and n2k-1=2q+2. Additionally, αk=q+1, and hence for any 1i2k-1, (δk-1i-αk){q,q+1}. Since n2k=q and n2k=q+1, Property 2 holds.

Next, for lognk>0 we set

Aki={i,i+δk1,i+δk1+δk2,,i+j=12k-1δkj}.

It is easy to see that for any lognk>0 and i, we have that |Aki|=2k, Aki=Ak-1iAk-1i+αk and Ak-1iAk-1i+αk=. Also notice that for any uAk-1i, u+αkAk-1i+αk and for any uAk-1i+αk, u-αkAk-1i.

Next we prove the lemma which is similar to the Lemma 2 for n=2m case:

Lemma 5

For any 1in and lognk>0, we have that

2GapAki(t)2maxjAki|xj(t)-xj+αk(t)|+GapAk-1i+αk(t)+GapAk-1i(t). 18

Proof

Notice that the statement we need to prove is identical to that of Lemma 2, with the exception that in the letter we use 2m-k instead of αk. The proofs are also almost identical (2m-k can be simply replaced with αk). The only difference is that the proof of Lemma 2 uses the property that for any uAk-1i+2m-k, |xu(t)-xu+2m-k(t)|maxjAki|xj(t)-xj+2m-k(t)| and u+2m-kAk-1i. Instead, we will use the property that for any uAk-1i+αk, |xu(t)-xu-αk(t)|maxjAki|xj(t)-xj+αk(t)| and u-αkAk-1i.

Next, we upper bound i=1nmaxjAki|xj(t)-xj+αk(t)|, by proving the following lemma, which is the analogue of Lemma 3.

Lemma 6

i=1nmaxjAki|xj(t)-xj+αk(t)|nn2kn2kϕαk(t) 19

Proof

Notice that for any 1un and the sets Aku,Aku+1,,Aku+n2k-1 are disjoint, because for any 1j2k, δkjn2k (this means that for any 1in, distances between consecutive vertices in Aki are at least n2k). Using this fact and Cauchy–Schwarz inequality we get that

i=uu+n2k-1maxjAki|xj(t)-xj+αk(t)|n2ki=uu+n2k-1maxjAki|xj(t)-xj+αk(t)|2n2kj=1n|xj(t)-xj+αk(t)|2=n2kϕαk(t)

Since the above inequality holds for any u we can write that:

i=1nmaxjAki|xj(t)-xj+αk(t)|nn2kn2kϕαk(t).

With the above three lemmas in place, we are ready to prove Theorem 1 for general n.

From Lemma 5 we have that

i=1n2GapAki(t)i=1nGapAk-1i(t)+i=1nGapAk-1i+αk(t)+i=1n2maxjAki|xj(t)-xj+αk(t)|=2i=1nGapAk-1i(t)+2i=1nmaxjAki|xj(t)-xj+αk(t)|.

After dividing the above inequality by 2 and applying Lemma 6, we get that:

i=1nGapAki(t)i=1nGapAk-1i(t)+nn2kn2kϕαk(t).

Notice that for any i, GapA0i(t)=0. Hence, after summing up the above inequality for k=1 to logn we get that

i=1nGapAlogni(t)k=1lognnn2kn2kϕαk(t).

Let i=argminiGapAlogni(t). Notice that consecutive vertices in Alogni are 1 or 2 edges apart, hence for any 1in, either iAlogni or i+1Alogni. This gives us that

Gap(t)GapAlogni(t)+2maxi|xi(t)-xi+1(t)|=GapAlogni(t)+2maxi|xi(t)-xi+1(t)|2GapAlogni(t)+2ϕ1(t).

By combining the above two inequalities we get that

nGap(t)nGapAlogni(t)+2nϕ1(t)i=1nGapAlogni(t)+2nϕ1(t)k=1lognnn2kn2kϕαk(t)+nϕ1(t).

Next, we apply Jensen’s inequality and Lemma 1 (we are going to use a looser upper bound: E[ϕi(t)]i(n-i)-1in)

nE[Gap(t)]2nE[ϕ1(t)]+k=1lognnn2kn2kEϕαk(t)2nE[ϕ1(t)]+k=1lognnn2kn2kE[ϕαk(t)]2nn+k=1lognnn2kn2kαkn=O(nnlogn).

This completes the proof.

Experimental Validation

On the practical side, we implemented our load balancing algorithm with unit weight increments on a cycle. The results confirm our hypothesis that the gap is of order Θ(n). In our experiment we observe the evolution of gap as we perform up to 109 increment operations. In Fig. 1 we ran our experiment 100 times and calculated average gap over all runs. x-axis shows number of balls thrown (which is the same as the number of increments) and y-axis is current average gap divided by n. The experiment shows that once the number of thrown balls is large enough, the gap stays between n and 1.4n.

Fig. 1.

Fig. 1

The evolution of average gap divided by square root of n, where n is the number of bins

Harary Graph, Upper Bound on the Gap

Recall that the Harary graph Hk,n is a k-connected graph with n vertices, which has the smallest possible number of edges. In this section we show that our approach can be extended to the Harary graph H4,n (unless specified we will assume H4,n to be the Harary graph): each vertex i is connected with edges to vertices i-1, i+1 (called cycle edges), i-2 and i+2 (called extra edges). As before, the operation consists of picking an edge u.a.r and doing increment and averaging (for the simplicity we assume that increments have unit weights, the result can be extended to the random weights, in the similar fashion to the cycle case). After careful calculations which mimic the calculations for the cycle case, but by taking extra edges of the Harary graph into the account, we can derive the following equations for the hop potentials (hop distance is counted over the cycle edges only):

E[ϕ1(t+1)]=n-2nE[ϕ1(t)]+34+E[ϕ1(t)]4n+E[ϕ3(t)]2nE[ϕ2(t+1)]=n-2nE[ϕ2(t)]+34-E[ϕ2(t)]4n+E[ϕ3(t)]2n+E[ϕ4(t)]2nE[ϕk(t+1)]=n-2nE[ϕk(t)]+1-E[ϕ1(t)]2n-E[ϕ2(t)]2n+E[ϕk-2(t)]2n+E[ϕk-1(t)]2n+E[ϕk+1(t)]2n+E[ϕk+2(t)]2n

Recall that for the cycle potential ϕk(t+1) depends on the potentials ϕk(t), ϕk+1(t), ϕk-1(t) and ϕ1(t) (please see Eq. (8)). In the case of Harary graph ϕk(t+1) depends on the potentials ϕk+2(t), ϕk+1(t), ϕk(t), ϕk-1(t), ϕk-2(t), ϕ1(t) and ϕ2(t). The reason is that we are able to perform load balancing operation on two hop neighbours. Similarly, if we have a graph where each vertex is connected with all vertices which are at hop distance at most (this is the Harary graph H2,n), then ϕk(t+1) will depend on ϕk+(t), , ϕk+1(t), ϕk(t), ϕk-1(t), , ϕk-(t), and ϕ1(t), ϕ2(t), , ϕ(t). Next step is to find the stationary points for the hop potentials. That is: the values which stay the same after we apply step given by the above equations. As before (please see Lemma 1), these values will be used as the upper bounds for the expected values of potentials. In the case of H4,n, we get that for every t and k:

E[ϕk(t)]25k(n-k)+α. 20

Here, extra term α has a closed form, which we omit and instead concentrate on the property that it is upper bounded by 2n. Observe that since the Harary graph contains cycle and we defined our hop potentials based on the hop counts of that cycle, we can upper bound the gap by using:

E[Gap(t)]k=1m12m-kEϕ2m-k(t)O(nlogn). 21

Notice that since α2n, for large enough k and n, the upper bound for E[ϕk(t)] can be two times smaller than the upper bound for the cycle case, which was shown in Lemma 1. Hence, we can use this to slightly improve the constant hidden by big O notation in the upper bound. In general, we conjecture that for any pair of parameters 1l1<l2n, a gap for the Harary graph H2l2,n is smaller than a gap for the Harary graph H2l1,n. Unfortunately, we are not able to provide the exact dependence of a gap on the Harary graph parameter.

Discussion and Future Work

We have shown that in the case of dynamic averaging on a cycle the gap between highest and lowest loaded bins is upper bounded by O(nlogn) in expectation. Additionally we showed that the expected square of the gap is lower bounded by Ω(n). It the future, it would be interesting to further tighten our results, matching our experimental analysis. We conjecture that the “correct” bound on the expected gap is Θ(n). As already discussed, we also plan to extend our results to more general graph families, in particular grid graphs.

Comparison of Two-Choice and Averaging Load Balancing

Finally, it is interesting to ask if it is possible to extend our gap bounds to the case of the classic two-choice load balancing process. In particular, is it possible to show that the gap in the case of averaging process is always smaller in expectation than the gap in the case of two choice process? Intuitively this should be the case, since the load balancing operation in the case of averaging can be viewed as picking up a random edge, incrementing the load of the less loaded endpoint, and then averaging the values. The extra averaging step should not make the gap larger. Indeed, the exponential potential used to analyse the gap in [17] can be used to upper bound the gap for the averaging process, since the exponential function is convex and averaging values does not increase it (by Jensen’s inequality).

Unfortunately, it is not clear if averaging helps to actually decrease the exponential potential. Additionally, this argument shows that averaging does not make the gap worse if applied to the particular technique of upper bounding the gap, and it is not clear if the gap itself is actually smaller, if we use averaging on top of the two-choice process. We conjecture that there exists a majorization argument which is based on how often the process performs the averaging step. More precisely, we consider the setting where after the increment step (using two choice), we perform averaging with probability β. The gap should decrease in expectation as we increase β. Note that the only result which lower bounds the gap for the two-choice process on the cycle is the straightforward Ω(logn) lower bound which can be shown for the clique [17]. Where The lower bound comes from the observation that if Ω(nlogn) balls of weight one are placed into n bins according to the two choice process, then the average load is Ω(logn) and with constant probability there exists a bin which is empty. What would make the existence of the majorization argument interesting is that it would allow us to show that the lower bound we derived on the second moment of the gap while always performing averaging step on the cycle (β=1) can be automatically used as the lower bound on the gap for two choice on the cycle (β=0). We plan to investigate this connection in future work.

Acknowledgements

The authors sincerely thank Thomas Sauerwald and George Giakkoupis for insightful discussions, and Mohsen Ghaffari, Yuval Peres, and Udi Wieder for feedback on earlier versions of this draft. We also thank the ICALP anonymous reviewers for their very useful comments.

Funding

Open access funding provided by Institute of Science and Technology (IST Austria). Funding was provided by European Research Council (Grant No. PR1042ERC01).

Footnotes

Special Issue on Combinatorial Algorithms (IWOCA 2020).

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Contributor Information

Dan Alistarh, Email: dan.alistarh@ist.ac.at.

Giorgi Nadiradze, Email: giorgi.nadiradze@ist.ac.at.

Amirmojtaba Sabour, Email: amirmojtaba.sabour@ist.ac.at.

References

  • 1.Alistarh, D., Brown, T., Kopinsky, J., Li, J.Z., Nadiradze, G.: Distributionally linearizable data structures. arXiv preprint arXiv:1804.01018 (2018)
  • 2.Alistarh, D., Kopinsky, J., Li, J., Nadiradze, G.: The power of choice in priority scheduling. In: Proceedings of the ACM Symposium on Principles of Distributed Computing, pp. 283–292. ACM (2017)
  • 3.Azar Y, Broder AZ, Karlin AR, Upfal E. Balanced allocations. SIAM J. Comput. 1999;29(1):180–200. doi: 10.1137/S0097539795288490. [DOI] [Google Scholar]
  • 4.Berenbrink, P., Czumaj, A., Steger, A., Vöcking, B.: Balanced allocations: the heavily loaded case. In: Proceedings of the Thirty-Second Annual ACM Symposium on Theory of Computing, STOC’00, New York, NY, USA. ACM, pp. 745–754 (2000)
  • 5.Berenbrink, P., Friedetzky, T., Hu, Z.: A new analytical method for parallel, diffusion-type load balancing. vol. 2006 (2006)
  • 6.Boillat JE. Load balancing and Poisson equation in a graph. Concurr. Pract. Exp. 1990;2:289–314. doi: 10.1002/cpe.4330020403. [DOI] [Google Scholar]
  • 7.Boyd S, Ghosh A, Prabhakar B, Shah D. Randomized gossip algorithms. IEEE/ACM Trans. Netw. 2006;14(SI):2508–2530. [Google Scholar]
  • 8.Czumaj, A., Stemann, V.: Randomized allocation processes. In: Proceedings 38th Annual Symposium on Foundations of Computer Science. IEEE, pp. 194–203 (1997)
  • 9.Frieze, A., Melsted, P., Mitzenmacher, M.: An analysis of random-walk cuckoo hashing. In: Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques. Springer, pp. 490–503 (2009)
  • 10.Ghosh, B., Leighton, F., Maggs, B., Muthukrishnan, S., Plaxton, C., Rajaraman, R., Richa, A., Tarjan, R., Zuckerman, D.: Tight analyses of two local load balancing algorithms, vol. 29, pp. 548–558 (1995)
  • 11.Ghosh B, Muthukrishnan S. Dynamic load balancing by random matchings. J. Comput. Syst. Sci. 1996;53(3):357–370. doi: 10.1006/jcss.1996.0075. [DOI] [Google Scholar]
  • 12.Ghosh, B., Muthukrishnan, S., Schultz, M.H.: First and second order diffusive methods for rapid, coarse, distributed load balancing (extended abstract). In: Proceedings of the Eighth Annual ACM Symposium on Parallel Algorithms and Architectures, SPAA’96, New York, NY, USA. Association for Computing Machinery, pp. 72–81 (1996)
  • 13.Harary F. The maximum connectivity of a graph. Proc. Natl. Acad. Sci. USA. 1962;48(7):1142. doi: 10.1073/pnas.48.7.1142. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Mitzenmacher M. The power of two choices in randomized load balancing. IEEE Trans. Parallel Distrib. Syst. 2001;12(10):1094–1104. doi: 10.1109/71.963420. [DOI] [Google Scholar]
  • 15.Muthukrishnan S, Ghosh B, Schultz MH. First-and second-order diffusive methods for rapid, coarse, distributed load balancing. Theory Comput. Syst. 1998;31(4):331–354. doi: 10.1007/s002240000092. [DOI] [Google Scholar]
  • 16.Peres, Y.: Personal Communication (2015)
  • 17.Peres Y, Talwar K, Wieder U. Graphical balanced allocations and the (1+ β)-choice process. Random Struct. Algorithms. 2015;47(4):760–775. doi: 10.1002/rsa.20558. [DOI] [Google Scholar]
  • 18.Raab, M., Steger, A.: “balls into bins”—a simple and tight analysis. In: International Workshop on Randomization and Approximation Techniques in Computer Science. Springer, pp. 159–170 (1998)
  • 19.Rabani, Y., Sinclair, A., Wanka, R.: Local divergence of Markov chains and the analysis of iterative load-balancing schemes. In: Proceedings 39th Annual Symposium on Foundations of Computer Science (Cat. No. 98CB36280), pp. 694–703 (1998)
  • 20.Richa AW, Mitzenmacher M, Sitaraman R. The power of two random choices: a survey of techniques and results. Comb. Optim. 2001;9:255–304. [Google Scholar]
  • 21.Sauerwald, T., Sun, H.: Tight bounds for randomized load balancing on arbitrary network topologies. In: 2012 IEEE 53rd Annual Symposium on Foundations of Computer Science. IEEE, pp. 341–350 (2012)
  • 22.Sinclair A, Jerrum M. Approximate counting, uniform generation and rapidly mixing Markov chains. Inf. Comput. 1989;82(1):93–133. doi: 10.1016/0890-5401(89)90067-9. [DOI] [Google Scholar]
  • 23.Talwar, K., Wieder, U.: Balanced allocations: a simple proof for the heavily loaded case. In: Esparza, J., Fraigniaud, P., Husfeldt, T., Koutsoupias, E. (eds.) Automata, Languages, and Programming—41st International Colloquium, ICALP 2014, Copenhagen, Denmark, July 8–11, 2014, Proceedings, Part I, volume 8572 of Lecture Notes in Computer Science. Springer, pp. 979–990 (2014)

Articles from Algorithmica are provided here courtesy of Springer

RESOURCES