Petra Berenbrink

Ralf Klasing
email: ralf.klasing@labri.fr

Adrian Kosowski
email: adrian.kosowski@inria.fr

Frederik Mallmann-Trenn
email: mallmann-trenn@ens.fr

Przemysław Uznański
email: przemyslaw.uznanski@aalto.fi

Improved Analysis of Deterministic Load-Balancing Schemes

We consider the problem of deterministic load balancing of tokens in the discrete model. A set of n processors is connected into a d-regular undirected network. In every time step, each processor exchanges some of its tokens with each of its neighbors in the network. The goal is to minimize the discrepancy between the number of tokens on the most-loaded and the least-loaded processor as quickly as possible.

Rabani et al. (1998) present a general technique for the analysis of a wide class of discrete load balancing algorithms. Their approach is to characterize the deviation between the actual loads of a discrete balancing algorithm with the distribution generated by a related Markov chain. The Markov chain can also be regarded as the underlying model of a continuous diffusion algorithm. Rabani et al. showed that after time T = O(log(Kn)/µ), any algorithm of their class achieves a discrepancy of O(d log n/µ), where µ is the spectral gap of the transition matrix of the graph, and K is the initial load discrepancy in the system.

In this work we identify some natural additional conditions on deterministic balancing algorithms, resulting in a class of algorithms reaching a smaller discrepancy. This class contains well-known algorithms, e.g., the ROTOR-ROUTER. Specifically, we introduce the notion of cumulatively fair loadbalancing algorithms where in any interval of consecutive time steps, the total number of tokens sent out over an edge by a node is the same (up to constants) for all adjacent edges. We prove that algorithms which are cumulatively fair and where every node retains a sufficient part of its load in each step, achieve a discrepancy of O(min{d log n/µ, d √ n}) in time O(T ). We also show that in general neither of these assumptions may be omitted without increasing discrepancy. We then show by a combinatorial potential reduction argument that any cumulatively fair scheme satisfying some additional assumptions achieves a discrepancy of O(d) almost as quickly as the continuous diffusion process. This positive result applies to some of the simplest and most natural discrete load balancing schemes.

Introduction

In this paper, we analyze diffusion-based load balancing algorithms. We assume that the processors are connected by an arbitrary d-regular graph G. At the beginning, every node has a certain number of tokens, representing its initial load. In general, diffusion-based load balancing algorithms operate in parallel, in synchronous steps. In each step, every node balances its load with all of its neighbors. The goal is to distribute the tokens in the network graph as evenly as possible. More precisely, we aim at minimizing the discrepancy (also known as smoothness), which is defined as the difference between the maximum load and the minimum load, taken over all nodes of the network.

One distinguishes between continuous load balancing models, in which load can be split arbitrarily, and the much more realistic discrete model, in which load is modeled by tokens which cannot be split. In the former case, the standard continuous diffusion algorithm works as follows. Every node u having load x(u) considers all of its neighbors at the same time, and sends x(u)/(d + 1) load to each of its d neighbors, keeping x(u)/(d + 1) load for itself. This process may also be implemented more efficiently: for each neighbor v of u, node u sends exactly max{0, (x(u) -x(v))/(d + 1)} load to v. It is well-known (cf. e.g. [START_REF] Subramanian | An analysis of diffusive load-balancing[END_REF]) that the load in the continuous model will eventually be perfectly balanced. In the discrete case with indivisible tokens, exact simulation of the continuous process is not possible. A node u may instead try to round the amount of load sent to its neighbor up or down to an integer. Discrete balancing approaches are, in general, much harder to analyze than continuous algorithms.

In [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF], Rabani et al. suggest a framework to analyze a wide class of discrete neighborhood load balancing algorithms in regular graphs (it can be adapted to non-regular graphs). The scheme compares the discrete balancing algorithm with its continuous version, and the difference is used to bound the so-called error that occurs due to the rounding. Their results hold for round-fair algorithms where any node u having load x t (u) at time t sends either ⌊x t (u)/(d + 1)⌋ or ⌈x t (u)/(d + 1)⌉ tokens over its edges. They show that the discrepancy is bounded by O(d log n/µ) after T = O(log(Kn)/µ) steps, where µ is the eigenvalue gap of the transition matrix of the underlying Markov chain and K is the initial load discrepancy. The scheme applies to any discrete load balancing scheme which, at every time step, rounds the load which would be exchanged in the continuous diffusion process by a given pair of nodes to one of the nearest integers, either up or down.

The time T in the above bound is also the time in which a continuous algorithm balances the system load (more or less) completely. T is closely related to the mixing time of a random walk on G, which is the time it takes for a random walk to be on every node with almost the same probability. Within the class of schemes considered in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF], the bound of O(d log n/µ) on discrepancy cannot be improved for many important graph classes, such as constant-degree expanders. Since the work [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF], many different refinements and variants of this approach have been proposed [START_REF] Akbari | A simple approach for adapting continuous load balancing processes to discrete settings[END_REF][START_REF] Friedrich | Quasirandom load balancing[END_REF][START_REF] Friedrich | Near-perfect load balancing by randomized rounding[END_REF][START_REF] Sauerwald | Tight bounds for randomized load balancing on arbitrary network topologies[END_REF], as well as extensions to other models, including systems with non-uniform tokens [START_REF] Akbari | A simple approach for adapting continuous load balancing processes to discrete settings[END_REF] and non-uniform machines [START_REF] Adolphs | Improved bounds on diffusion load balancing[END_REF].

Our Contribution

The main goal of this paper is to continue the work of [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF] by analyzing properties/classes of deterministic algorithms that balance better in the diffusive model than the class defined in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. We suggest and analyze two general classes of balancing algorithms (called cumulatively fair balancers and good balancers) that include many well-known diffusion algorithms and we bound the discrepancy they achieve after O(T ) time steps. Within the framework of schemes which are deterministic and pose no major implementation challenges (i.e., do not generate negative load and do not rely on additional communication), we obtain a number of significant improvements with respect to the state-of-the-art, cf. Table 1.

For our algorithms we assume that every node of the graph has in addition to its d original edges d • ≥ d many self-loops. We define d + = d • + d as the degree of the graph including the self-loops. Cumulatively δ-fair balancers. We call an algorithm cumulatively δ-fair if (i) for every interval of consecutive time steps, the total number of tokens an algorithm sends over the original edges (non-self-loops) differs by at most a small constant δ and (ii) for every time step every edge (original edges and self-loops) of a node receives at least ⌊x/d + ⌋ many tokens, where x is the current load of the node. Cumulatively δ-fair balancers are a subclass of the algorithms studied in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF], which satisfied weaker fairness conditions. We show (Theorem 2. Additionally to the upper bound, we show that the discrepancy can be of order Ω(d • diam) (diam is the diameter of the graph) if we drop the condition of cumulative fairness (Theorem 4.1) or remove self-loops completely (Theorem 4.3). In more detail, Theorem 4.1 shows that there are round-fair balancers that satisfy the constraints of [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF] and that have Ω(d • diam) discrepancy nonetheless. Such discrepancy is worse than the one we obtain for cumulatively fair balancers (Theorem 2.3) for many graph classes. In Theorem 4.3 we show for a specific cumulatively 1-fair balancer not using any self-loops (ROTOR-ROUTER), that it cannot achieve discrepancy better than Ω(n) on a cycle with n nodes.

The class of cumulatively fair balancers contains many well-known deterministic algorithms. In particular, many of these algorithms are stateless, meaning the load any node sends over edges in any step depends solely on the load of the node at this time step. An example for a stateless cumulatively fair balancer is SEND (⌊ x /d + ⌋), where a node with load x sends ⌊ x /d + ⌋ many tokens to every original edge (non-self-loop). The remaining x -⌊ x /d + ⌋ tokens are distributed over self-loops such that every self-loop receives at least ⌊ x /d + ⌋ many tokens. Similarly, the algorithm SEND ([ x /d + ]) is cumulatively fair. Here [ x /d + ] rounds x /d + to the next integer and a node with load x sends [x/d + ] tokens over every original edge. Another well-known algorithm in this class is the so-called ROTOR-ROUTER model (also referred to in the literature as the Propp model, [START_REF] Akbari | Parallel rotor walks on finite graphs and applications in discrete load balancing[END_REF][START_REF] Cooper | Deterministic random walks on regular trees[END_REF][START_REF] Friedrich | The cover time of deterministic random walks[END_REF]) which uses a simple round-robin approach to distribute the tokens to the d + neighbors, i.e., over all its edges.

Good s-balancers. The class of good s-balancers can be regarded as a restriction of cumulatively 1-fair balancers. A cumulatively 1-fair balancer is a good s-balancer if it (i) is round-fair (every edge receives ⌊x/d + ⌋ or ⌈x/d + ⌉ many tokens, where x is the current load of a node) (ii) sends over at least s self-loops ⌈x/d + ⌉ many tokens in every round. We show that algorithms of this class achieve a O(d)-discrepancy within O(T + d log 2 n/µ) time steps. Moreover, if s = Ω(d), then the same discrepancy of O(d) is reached within O(T + log 2 n/µ) time steps. The class of good s-balancers contains many well-known algorithms. For example, the algorithm SEND ([ x /d + ]) is a good s-balancer for d + > 2d. If d + ≥ 3d, then it achieves a O(d) discrepancy in O(T + log 2 n/µ) time. Additionally, the class contains some variants of the rotorrouter approach, e.g., one variant which we denote by ROTOR-ROUTER * . This algorithm maintains d -1 self-loops, together with one special self-loop, which always receives ⌈x t (u)/(2d)⌉ tokens. The remaining tokens are distributed fairly using a rotor-router on the original edges and the d -1 self-loops.

The only other result in the literature known to the authors which achieves a discrepancy of O(d) in O(T ) steps in the diffusive model is the one of [START_REF] Akbari | A simple approach for adapting continuous load balancing processes to discrete settings[END_REF] (see [START_REF] Sauerwald | Tight bounds for randomized load balancing on arbitrary network topologies[END_REF] for O(d) discrepancy in the dimension exchange model where nodes balance with only one neighbor per round). Their algorithms simulate and mimic (with the discrete tokens) the continuous flow.

Technical contributions. Our techniques for the analysis of cumulatively fair balancers rely on a comparison between our discrete process and the continuous process. The latter can also be regarded as a Markovian process (random walk) which is governed by the transition matrix of the graph. We calculate the total deviation (of any cumulatively fair balancer) to the continuous process as done in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. However, instead of doing it step-by-step as in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF], the comparison is done over long time intervals. This was done in, e.g., [START_REF] Kosowski | Does Adding More Agents Make a Difference? A Case Study of Cover Time for the Rotor-Router[END_REF][START_REF] Yanovski | A Distributed Ant Algorithm for Efficiently Patrolling a[END_REF], in the context of the graph exploration problem. Our analysis of this class connects this deviation to the value O(log n/µ), which is a natural upper bound on the mixing time. For the analysis of good s-balancers we combine the algebraic techniques used for the analysis of cumulatively fair balancers with a potential function approach. Whereas all cumulatively 1-fair balancers admit a natural potential function, which is (weakly) monotonous throughout the balancing process, for the narrower class of good s-balancers we can define time phases so that in each time phase, the process exhibits a strict potential drop in each phase of balancing, up to a balancing discrepancy of O(d). Even though we limit ourselves to regular graphs in this paper, our results can be extended to non-regular graphs.

Related Work

Herein we only consider related results for load balancing in the discrete diffusive and balancing circuit models, and some results for the rotor-router model which are relevant to our work.

Diffusive load balancing. Discrete load balancing has been studied in numerous works since [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. The authors of [START_REF] Friedrich | Quasirandom load balancing[END_REF] propose a deterministic load balancing process in which the continuous load transferred along each edge is rounded up or down deterministically, such that the sum of the rounding errors on each edge up to an arbitrary step t is bounded by a constant. This property is called the bounded-error property. Then they show that after T steps any process with bounded-error property achieves a discrepancy of O(log 3/2 n) for hypercubes and O(1) for constant-degree tori. There are no similar results for other graph classes. Note that the algorithm of [START_REF] Friedrich | Quasirandom load balancing[END_REF] has the problem that the original demand of a node might exceed its available load, leading to so-called negative load.

In [START_REF] Akbari | Parallel rotor walks on finite graphs and applications in discrete load balancing[END_REF], the authors consider ROTOR-ROUTER-type walks as a model for load balancing. It is assumed that half of the edges of every node are self-loops. The authors present an algorithm which falls in the class of bounded-error diffusion processes introduced in [START_REF] Friedrich | Quasirandom load balancing[END_REF]. This results in discrepancy bounds of O(log 3/2 n) and O(1) for hypercube and r-dimensional torus with r = O(1). In [START_REF] Adolphs | Improved bounds on diffusion load balancing[END_REF], the authors consider the diffusion algorithms that always round down for heterogeneous networks. They also show that a better load balance can be obtained when the algorithm is allowed to run longer than T steps.

In [START_REF] Akbari | A simple approach for adapting continuous load balancing processes to discrete settings[END_REF], the authors propose an algorithm that achieves discrepancy of 2d after T steps for any graph. For every edge e and step t, their algorithm calculates the number of tokens that should be sent over e in t such that the total number of tokens forwarded over e (over the first t steps) stays as close as possible to the amount of load that is sent by the continuous algorithm over e during the first t steps. However, their algorithm can result in negative load when the initial load of any node is not sufficiently large and it has to calculate the number of tokens that the continuous algorithm sends over all edges. Note that the algorithm presented in this paper has to simulate the continuous algorithm in order to calculate the load that it has to transfer over any edge, whereas our algorithms are much easier and they do not need any additional information, not even the load of their neighbors.

There are several publications that suggest randomized rounding schemes [1, 3-5, 9, 18] to convert the continuous load that is transferred over an edge into discrete load. The algorithm of [START_REF] Berenbrink | Randomized diffusion for indivisible loads[END_REF] calculates the number of additional tokens (the difference between the continuous flow forwarded over edges and the number of tokens forwarded by the discrete algorithm after rounding down). All additional tokens are sent to randomly chosen neighbors. 1.

Dimension exchange model. In the Dimension Exchange model, the nodes are only allowed to balance with one neighbor at a time. Whereas for all diffusion algorithms considered so far the discrepancy in the diffusion model is at least d, dimension exchange algorithms are able to balance the load up to an additive constant. In [START_REF] Friedrich | Near-perfect load balancing by randomized rounding[END_REF] the authors consider a discrete dimension exchange algorithm for the matching model. Every node i that is connected to a matching edge calculates the load difference over that edge. If that value is positive, the algorithm rounds it up or down, each with probability one half. This result is improved in [START_REF] Sauerwald | Tight bounds for randomized load balancing on arbitrary network topologies[END_REF], where the authors show that a constant final discrepancy can be achieved within O(T ) steps for regular graphs in the random matching model, and constant-degree regular graphs in the periodic matching (balancing circuit) model.

Rotor-router walks. Originally introduced in [START_REF] Priezzhev | Eulerian walkers as a model of self-organized criticality[END_REF], the rotor-router walk model was employed by Jim Propp for derandomizing the random walk, thereby frequently appearing under the alternative names of Propp machines and deterministic random walks [START_REF] Cooper | Deterministic random walks on regular trees[END_REF][START_REF] Doerr | Deterministic random walks on the two-dimensional grid[END_REF][START_REF] Friedrich | The cover time of deterministic random walks[END_REF][START_REF] Kijima | Deterministic random walks on finite graphs[END_REF]. In the rotor-router model, the nodes send their tokens out in a round-robin fashion. It is assumed that the edges of the nodes are cyclically ordered, and that every node is equipped with a rotor which points to one of its edges. Every node first sends one token over the edge pointed to by the rotor. The rotor is moved to the next edge which will be used by the next token, and so on, until all tokens of the node have been sent out over one of the edges. It has been shown that the rotor walks capture the average behaviour of random walks in a variety of respects such as hitting probabilities and hitting times. The rotor-router model can be used for load balancing, and directly fits into the framework we consider in this paper. The authors of [START_REF] Shiraga | Deterministic Random Walks for Rapidly Mixing Chains[END_REF] obtain rough bounds on the discrepancy, independently of [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. In [START_REF] Akbari | Parallel rotor walks on finite graphs and applications in discrete load balancing[END_REF], the authors study a lazy version of the rotor-router process (half of the edges are self-loops) for load balancing. They prove that the rotor walk falls in the class of bounded-error diffusion processes introduced in [START_REF] Friedrich | Quasirandom load balancing[END_REF]. Using this fact they obtain discrepancy bounds of O(log 3/2 n) and O(1) for the hypercube and r-dimensional torus with r = O(1), respectively, which improve the best existing bounds of O(log 2 n) and O(n 1/r ) in this graph class.

Model and Notation

In this section we define our general model, which applies to both classes of studied algorithms.

The input of the load-balancing process is a symmetric and directed regular graph G = (V, E) with n nodes. Every node has out-degree and in-degree d. We have m ∈ N indivisible tokens (workload) which are arbitrarily distributed over the nodes of the network. For simplicity of notation only, we assume that initially G does not contain multiple edges. In general, the nodes of the graph may be treated as anonymous, and no node identifiers will be required. The time is divided into synchronized steps. Let x t = (x t (1), . . . , x t (n)) be the load vector at the beginning of step t, where x t (u) corresponds to the load of node u at the beginning of step t. In particular, x 1 denotes the initial load distribution and x is the real-valued vector resulting when every node has achieved average load, x(u) = 1 n u∈V x 1 (u) ≡ x, for all u ∈ V . Note that the total load summed over all nodes does not change over time. The discrepancy is defined as the load difference between the node with the highest load and the node with the lowest load. We will denote by K the maximal initial discrepancy in x 1 , i.e., K = max u∈V x 1 (u) -min u∈V x 1 (u). The balancedness of an algorithm is defined as the gap between the node with the highest load and the average load.

In order to introduce self-loops, we transform G into the graph

G + = (V, E ∪ E • ) by adding d • self-loops to every node. For a fixed node u ∈ V , let E • u = {e 1 (u, u), . . . , e d • (u, u)} denote the set of self-loops of u and let E u denote the original edges of u in G. We assume d • = O(d). We can now define E + u = E • u ∪ E u and E • = u∈V E • u .
In the following, we call G the original graph and G + the balancing graph. The edges E • are called self-loop edges of G + and E u are the original edges. We remark again that the balancing graph is introduced for purposes of analysis, only, and is completely transparent from the perspective of algorithm design. We also define

d + = d + d • as the degree of any node in G + . N (u) is the set of direct neighbors of u in G + , i.e., it contains all neighbors of u in G including u itself (because of the self-loops).
For a fixed edge e = (u, v) ∈ E + let f t (e) be the number of tokens which u sends to v in step t. In particular, let

f t (u, u) = e∈E • u f t (e).
Let F t (e) denote the cumulative load sent from u to v in steps 1, . . . , t, i.e, F t (e) = τ ≤t f τ (e). For a fixed node u, we define

f out t (u) = v∈N (u) f t (u, v)
to be the number of tokens (or flow) leaving u in step t. The incoming flow is then defined as

f in t (u) = {v:u∈N (v)} f t (v, u).
We define the cumulative incoming and original flows F out t (u) and F in t (u) accordingly, and F out t and F in t are defined as the vectors of the (cumulative) original and incoming flow. We will say that edge e = (u, v) received x tokens when node u sends x tokens to v.

Results for Cumulatively Fair Balancers

In this section we present a general class of algorithms, called cumulative fair algorithms, and analyze their discrepancy after T = O ((log K + log n)/µ) many time steps. Note that T is the balancing time of the continuous diffusion algorithm if the initial discrepancy is K, and d is the number of original edges (non-self-loops) of each node.

We call an algorithm cumulatively fair if the flow that is sent out over every edge of u (including the self-loops) up to step t can differ by at most δ.

Definition 2.1. Let δ be a constant. An algorithm is called cumulatively δ-fair if for all t ∈ N, u ∈ V • every edge e ∈ E + u receives at least ⌊x t (u)/d + ⌋ many tokens. • all original edges e 1 , e 2 ∈ E u satisfy |F t (e 1 ) -F t (e 2 )| ≤ δ.
Note that round-fair algorithms (defined in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]) are not necessarily cumulatively δ-fair for any fixed δ.

Observation 2.2. The algorithms SEND (⌊ x /d + ⌋) and SEND ([ x /d + ]) are 0-cumulatively fair. Furthermore, ROTOR-ROUTER is cumulatively 1-fair.

For cumulatively fair balancers we show the following bound.

Theorem 2.3. Let G be any d-regular input graph and let d + is the degree of the balancing graph G + (including the self-loops). Let δ be a constant. Assume A is a cumulatively δ-fair balancer. Then, after O (log(Kn)/µ) time steps, A achieves a discrepancy of

(i) O (δ + 1) • d • log n/µ for d + ≥ 2d. (ii) O ((δ + 1) • d • √ n) for d + ≥ 2d. (iii) O ((δ + 1) • d • log n/µ) for arbitrary d + ≥ d + 1.
For constant δ and at least d self-loops, the results of Claim (i) of the above theorem show a better discrepancy after T steps compared to the result of [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. Claim (ii) provides an improvement for graphs with a bad expansion (small eigenvalue gap), such as cycles.

The rest of this section is devoted to the proof of Theorem 2.3. The core idea of the proof is to regard the balancing process over several steps and to observe that the cumulative load of the nodes is closely related to a random walk of all tokens. The difference to the random walk can be bounded by a small corrective vector depending on δ. We start by providing some additional definitions.

In the analysis, we change the way the tokens are kept at a node: In addition to sending tokens over self-loop edges we allow a node to retain a remainder (of tokens) of size r < d + at every node. The reason for this is that the proof requires the cumulative fairness on all edges and not just on original edges. One can show (Proposition A.2) that every cumulatively fair balancer can be transformed (by shifting tokens from self-loops to the remainder) into an algorithm guaranteeing cumulative fairness on all edges and that this transformed algorithm sends exactly the same load over original edges in every round.

Let the remainder r t (u) of node u in step t be the number of tokens of u that will not participate in the load distribution over its original edges and self-loops. Then, r t = (r t (1), . . . , r t (n)) denotes the remainder vector at step t, where r t (i) is the number of tokens kept by the i'th node of G in step t. We will denote by r the upper bound on the maximum remainder of an algorithm, satisfying |r t (u)| ≤ r ≤ d + for every time step t and every u ∈ V . For the ease of notation, we assume that r < d + . Note that for all u ∈ V and all steps t

x

1 (u) + F in t-1 (u) = r t (u) + F out t (u). (1)
Moreover,

x t (u) = f out t (u) + r t (u). (2)
Let P denote the transition matrix of a random walk of G + . Let P(u, v) denote the one-step probability for the walk to go from u to v.

Then P(u, v) = 1/d + if (u, v) ∈ E, P(u, v) = d • /d + if u = v, and P(u, v) = 0 otherwise.
Let µ be the eigenvalue gap of P, i.e., µ = 1 -λ 2 , where λ 2 is the second largest eigenvalue. We define P t to be the t-steps transition matrix, i.e., P t = P • P t-1 . We define the steady-state distribution as

P ∞ = lim t→∞ P t . Note that ∀u, v ∈ V , P ∞ (u, v) = d + /(2|E + |) = 1/n. Observe that P ∞ • x 1 = (x, x, . . . , x).
We can express P t as P t = P ∞ + Λ t , where Λ t is the error-term calculating the difference between P t and the steady-state distribution. Let p ≥ 1. The p-norm of a vector r is defined as

r p = ( n i=1 |r i | p ) 1 p . In particular, r ∞ is defined to be max{|r 1 |, . . . , |r n |}.
We are ready to prove the main theorem of this section. The core idea of the proof is to calculate the total deviation between any cumulatively fair balancer and a continuous process, similar to [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. However, instead of comparing the two processes step-by-step as in [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF], the comparison is done over long time intervals similar to [START_REF] Kosowski | Does Adding More Agents Make a Difference? A Case Study of Cover Time for the Rotor-Router[END_REF]. This deviation is then connected to the value O(log n/µ).

Proof of Theorem 2.3. Fix a node u ∈ V . Note that by the definition of cumulatively δ-fairness and Proposition A.2 we have for all (u, v) ∈ E + u that

F t (u, v) -F out t (u)/d + ≤ δ. (3)
We will define a corrective vector which at time t measures the difference between the load the nodes sent over original edges at time t and the load the nodes should have sent over these edges in order to ensure that every original edge received the exact same (continuous) load until time t. Formally, we define the n-dimensional corrective vector δ δ δ t,u with δ

t,u (v) = F t (v, u) -F out t (v)/d + for v = u and δ t,u (u) = F t (u, u) -d • /d + • F out t (u). The entries of the corrective vector satisfy |δ t,u (v)| ≤ δ for v ∈ N (u) \ {u}, |δ t,u (u)| ≤ d • δ,
and δ t,u (v) = 0 for v ∈ N (u). Consequently, δ δ δ t,u 1 ≤ δd + . Then we derive from (3) the following bound on the incoming cumulative load of node u

F in t (u) = def. v∈N (u) F t (v, u) = v∈N (u)\{u} F t (v, u) + F t (u, u) = (3) v∈N (u)\{u} 1 d + F out t (v) + δ t,u (v) + d • d + F out t (u) + δ t,u (u) = v∈N (u)\{u} 1 d + F out t (v) + d • d + F out t (u) + δ δ δ t,u 1 . (4)
Rewriting (1) by introducing (4) we get:

F out t (u) = x 1 (u) + v∈N (u)\{u} 1 d + F out t-1 (v) + d • d + F out t-1 (u) + δ δ δ t,u 1 -r t (u) εt(u) . (5)
We have ε t (u) ∞ ≤ δd + + r. Rewriting (5) in vector form, we obtain

F out t = x 1 + P • F out t-1 + ε ε ε t = 0≤τ <t P τ x 1 + 1≤τ ≤t P t-τ • ε ε ε τ .
For any T > 0, the number of tokens leaving node u in the interval

[t + 1; t + T ] is F out t+ T (u) -F out t (u). Hence, F out t+ T -F out t = t≤τ <t+ T P τ x 1 + 1≤τ ≤t (P t+ T -τ -P t-τ ) • ε ε ε τ + t<τ ≤t+ T P t+ T -τ • ε ε ε τ .
We set t * = t -4t µ , where t µ = 6 log n/µ, and substitute P τ = P ∞ + Λ τ . We derive

F out t+ T -F out t = t≤τ <t+ T P τ x 1 + 1≤τ ≤t * (P t+ T -τ -P t-τ )ε ε ε τ + t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ + t<τ ≤t+ T P t+ T -τ ε ε ε τ = T P ∞ x 1 + t≤τ <t+ T Λ τ x 1 + 1≤τ ≤t * (Λ t+ T -τ -Λ t-τ )ε ε ε τ + t * <τ ≤t (P t+ T -τ -P t-τ ) • ε ε ε τ + t<τ ≤t+ T P t+ T -τ • ε ε ε τ . ( 6
)
In the following we use x = P ∞ x 1 .

t<τ ≤t+ T x τ -T • x ∞ = (2)   F out t+ T -F out t + t<τ ≤t+ T r τ   -T P ∞ x 1 ∞ ≤ (6) t≤τ <t+ T Λ τ x 1 ∞ + 1≤τ ≤t * Λ t+ T -τ ε ε ε τ ∞ + Λ t-τ ε ε ε τ ∞ + t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ ∞ + t<τ ≤t+ T P t+ T -τ ε ε ε τ ∞ + t<τ ≤t+ T r τ ∞ .
By well-known properties of mixing in graphs (cf. claims (i) and (ii) of Lemma A.1 in the Appendix) it follows for t ≥ 16

• log(nK)/µ that ∀ τ ≥t Λ τ x 1 ∞ ≤ 2 -4 , and moreover τ ≥4•tµ Λ τ ε ε ε τ ∞ ≤ n -4 • max τ ≥4•tµ { ε ε ε τ ∞ }. This results in t<τ ≤t+ T x τ -T • x ∞ ≤ T • 2 -4 + 2 • n -4 max 1≤τ ≤t * ε ε ε τ ∞ + t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ ∞ + T (δd + + r) + T r ≤ T 4 + (δd + + r) + t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ ∞ + T (δd + + 2r).
Dividing the last equation by T yields

t<τ ≤t+ T x τ T -x ∞ ≤ 1 4 + (δd + + 2r) + (δd + + r) + t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ ∞ T . (7)
In this way, in [START_REF] Cooper | Simulating a random walk with constant error[END_REF] we have derived a bound on the difference between the average load of a node during an interval of length T and the average load x.

In the remainder we bound (7) for T = 1, which describes the load difference to the average. Fix an arbitrary t ≥ 16 log(nK)/µ. We define P t (u, w) to be the probability that a random walk following matrix P, initially located at u ∈ V , is located at w after t time steps. We then obtain the following bound (see Appendix A.1 for details):

(P t+1-τ -P t-τ )ε ε ε τ ∞ ≤ (δd + + r) • max w∈V v∈V |P t+1-τ (v, w) -P t-τ (v, w)| . (8)
Combining ( 7) and ( 8) for T = 1, recalling that t * = t -4t µ = t -24 log n/µ, and introducing the notation a = t -τ , we obtain:

x t+1 -x ∞ ≤ 1 4 + r + (δd + + r) 2 + 24 log n/µ a=0 max w∈V v∈V |P a+1 (v, w) -P a (v, w)| . (9)
Thus, the right-hand side of the above expression provides an asymptotic upper bound on the discrepancy at time O(log(nK)/µ). It remains to provide an estimate of the sums which appear in the expression. These sums can be analyzed using techniques for bounding probability change (current) of a reversible random walk in successive time steps. In Appendix A.1, we provide three different ways of bounding the expression, leading directly to claims (i), (ii), and (iii) of the theorem. We remark that it is not clear whether the obtained bounds on the right hand side of ( 9) are asymptotically tight. For example, the question whether it may be possible to replace "

√ n" in claim (ii) by a term which is polylogarithmic in n is an interesting open question in the theory of random walks on graphs (cf. [START_REF] Norris | Surprise probabilities in Markov chains[END_REF] for some recent related results in the area).

3 Results for Good s-Balancers

In this section, we consider a subclass of cumulatively 1-fair balancers that achieve a better discrepancy compared to the cumulatively fair balancers if the runtime is slightly larger than T . Algorithms of this class are, by definition, a subclass of cumulatively 1-fair balancers. Hence, Theorem 2.3 also applies to Good s-Balancing Algorithms. A cumulatively 1-fair balancer is also a good s-balancer if the algorithm is (i) round-fair and (ii) self-preferring, i.e., if it favors self-loop edges over original edges. As we will see in Theorem 3.3, the "more self-preferring" an algorithm is, the faster it balances. The following theorem shows that good s-balancers achieve a smaller discrepancy of O(d) if they are allowed to run longer than T steps. Theorem 3.3. Let G be any d-regular input graph and let d + is the degree of the balancing graph G + . Let δ be an arbitrary constant and let 1 ≤ s ≤ (d + -d). Assume A is a good s-balancer. Then A achieves a discrepancy of ((2δ + 1)

d + + 4d • ) after time O log K + ds -1 • log 2 n/µ .
We note that large values of s (s = Ω(d)) increase the speed of the balancing process. In Theorem 4.2 (Section 4) we provide a lower bound of Ω(d) on the discrepancy of any stateless algorithms, the bound is independent of the balancing time. Since the class of good s-balancers contains many stateless algorithms, this also means that the bound on the discrepancy in Theorem 3.3 cannot be improved without further restrictions on the class.

The remainder of this section is devoted to a proof of Theorem 3.3. We first define the following two families of potential functions, parameterized by c:

φ t (c) = v∈V max{x t (v) -cd + , 0} and φ ′ t (c) = v∈V max{cd + + s -x t (v), 0}.
To show the theorem we use Equation 7 of the proof of Theorem 2.3, to derive Lemma 3.4. The lemma shows that, for every node u, there exists a time step t u in which the load of the node has a certain distance to x. We will then show that the time step t u results in a potential drop of φ t (c) for u if the load of u was larger than cd + .

The following lemma gives a bound on the required length of the time interval so that there is a step t u where u has a load which is sufficiently close to x. The required time is expressed as a fraction of log n/µ. The lemma shows a tradeoff (parameter λ) between the required time and the load difference of u to x. The proof can be found in Appendix B. Lemma 3.4. Consider any cumulatively δ-fair balancer with remainder bounded by r, and an initialization of the load balancing process with average load x and initial discrepancy K. Let λ ≥ 0, and let t ≥ 16 • log(nK)/µ, and let T = O (d log n/(µ • (λ + 1))) . Then we have: For all u ∈ V there exists a time step t ′ ∈ [t + 1; t + T ] such that x t ′ (u) ≤ x + δd + + 2r + 1/2 + λ.

The next lemma bounds the one-step potential drop of φ t (c) occurring on every node which has a load of more than cd + at time t -1 and has a smaller load of at most cd + + s at time t. The proof can be found in Appendix B.

Lemma 3.5 (Monotonicity of potential).

Let A be a good s-balancer. The potential φ t (c) is non-increasing in time and it satisfies: φ t (c) ≤ φ t-1 (c) -u∈V ∆ t (c, u), where:

∆ t (c, u) =    min{x t-1 (u), cd + + s} -max{x t (u), cd + } if x t-1 (u) > x t (u) and x t-1 (u) > cd + and x t (u) < cd + + s 0 otherwise
The following observation extends Lemma 3.5 to intervals [t, t ′ ]. It estimates the potential drop of φ t (c) for nodes which have a load ≥ cd + at time t and a load ≤ cd + during one time step of the interval. The observation follows directly from Lemma 3.5; we omit its proof. Observation 3.6. Let A be a good s-balancer and let t ≤ t ′ be two fixed time steps. Denote by U the subset of nodes such that for all u ∈ U x t (u) ≥ cd + + 1 and there exists a moment of time

t u ∈ [t, t ′ ] such that x tu (u) ≤ cd + . Then φ t ′ (c) ≤ φ t (c) -u∈U max{s, x t (u) -cd + }.
The potential defined in Lemma 3.5 bounds the number of tokens above certain thresholds. Now we use φ ′ t (c) to show symmetric results measuring the number of 'gaps' below certain thresholds. The proof of Lemma 3.7 is very similar to that of Lemma 3.5, and we provide it for completeness in Appendix B. Lemma 3.7. Let A be a good s-balancer. The potential φ ′ t (c) is non-increasing in time and it satisfies:

φ ′ t (c) ≤ φ ′ t-1 (c) -u∈V ∆ ′ t (c, u)
, where:

∆ ′ t (c, u) =    min{x t (u), cd + + s} -max{x t-1 (u), cd + } if x t-1 (u) < x t (u) and x t-1 (u) < cd + + s and x t (u) > cd + 0 otherwise
Before proving the lemma, we remark that the potential admits a drop at node u at time t (i.e., ∆ ′ t (c, u) ≥ 1) for every node u such that x t-1 (u) ≤ cd + and x t (u) ≥ cd + + 1, for any algorithm which is at least 1self-preferring. Again, the following observation follows directly from Lemma 3.7; we omit its proof. Observation 3.8. Let A be a good s-balancer and let t ≤ t ′ be two fixed time steps. Denote by U the subset of nodes such that for all u ∈ U x t (u) < cd + + s and there exists a moment of time t u ∈ [t, t ′ ] such that x tu (u) ≥ cd + + s. Then φ ′ t ′ (c) ≤ φ t (c) -u∈U max{s, cd + + s -x t (u)}. The main idea of the rest of the proof is the following. We will consider the potential functions φ t (c) for decreasing values of c and analyze the time T c it takes to decrease the potentials φ t (c). The time bound of Theorem 3.3 is then the sum of the times T c for suitably chosen values of c. A symmetrical argument can be used to bound φ ′ t (c). Details of the arguments of the proof are provided in Appendix B.

Lower Bounds

We start by showing that the cumulative fairness bounds we introduce cannot be completely discarded when improving upon the discrepancy gaps from [START_REF] Rabani | Local divergence of Markov chains and the analysis of iterative loadbalancing schemes[END_REF]. Note that a round-fair balancer is not necessarily cumulatively δ-fair for any constant δ. In the following we show that there are round-fair balancers which have a discrepancy of at least Ω(diam(G) • d). The proofs of this section are deferred to Appendix C. The following bound shows that the stateless algorithms we design are asymptotically the best possible in terms of eventual discrepancy. Namely, any stateless algorithm is not able to achieve a discrepancy better than cd, for some constant c. This also means that the bound on the discrepancy, presented in Theorem 3.3, cannot be improved in general for the class of good s-balancers. Theorem 4.2. Let A be an arbitrary deterministic and stateless algorithm. For every even n, there exists a d-regular graph and an initial load distribution such that A cannot achieve discrepancy better than cd, for some positive constant c > 0.

Our final lower bounds concern variants of the ROTOR-ROUTER. The next theorem shows that for a graph without self-loops (i.e., G = G + ) the best possible discrepancy of the ROTOR-ROUTER is at least c • d • ϕ ′ (G), where ϕ ′ (G) is the odd girth of graph G, i.e., the length of the shortest odd length cycle over all nodes of G. This gives for an odd-length cycle of n nodes a discrepancy of at least c • n for some constant c.

Conclusion

We introduced two classes of deterministic load-balancing algorithms: Cumulative δ-fair balancers and good s-balancer. The lower bounds show discrepancies of Ω(d • diam) for algorithms which are not cumulatively δ-fair or which do not have any self-loops. However, there are two main questions which we leave unanswered: 1) How many self-loops are necessary to obtain our bounds? 2) Are the restrictions imposed by good s-balancers necessary to obtain our bounds?

Proof. The reformulation of algorithm A as algorithm A ′ proceeds as follows. For all edges e ∈ E(G) (i.e., except for self-loops), in every step A ′ places the same amount of load on e as A. However, in A ′ load may be retained on nodes in a different way, being placed in the remainder r t (u) rather than on self-loops at node u ∈ V . To prove, that it is always possible, we proceed by induction.

Specifically, at a fixed moment of time t, let f t (e) be the amount of load put on an edge e by algorithm A, and f ′ t (e) be the amount of load put on an edge by A ′ , and let F t (e) and F ′ t (e) be the respective cumulative loads for algorithms A and A ′ . Algorithm A ′ processes all edges (including self-loops) sequentially and verifies if sending this amount of load along e would satisfy the cumulative fairness condition up to time t with respect to all edges original from u already processed.

Let e 1 be the edge or self-loop that violates the cumulative load property for A ′ , that is there exists an incident edge or self-loop e 2 such that |(

F ′ t-1 (e 1 ) + f t (e 1 )) -(F ′ t-1 (e 2 ) + f t (e 2 ))| > δ. Since |f t (e 1 ) - f t (e 2 )| ≤ 1, and |F ′ t-1 (e 1 ) -F ′ t-1 (e 2 )| ≤ δ (from inductive assumption), we get that (F ′ t-1 (e 1 ) + f t (e 1 )) -(F ′ t-1 (e 2 ) + f t (e 2 )) ∈ {δ + 1, -δ -1} (10)
(without loss of generality we can assume that this value is δ + 1). Moreover, we can show that for every e ′ 2 such that the pair e 1 , e ′ 2 violates cumulative fairness, the value ( 10) is δ + 1 (otherwise

F ′ t-1 (e 1 ) - F ′ t-1 (e 2 ) = δ and F ′ t-1 (e 1 ) -F ′ t-1 (e ′ 2 ) = -δ imply F ′ t-1 (e ′ 2 ) -F ′ t-1 (e 2 )
= 2δ which contradicts the inductive assumption). We can also observe that e 1 is a loop (attached to vertex u), since non-loop edges satisfy cumulatively fairness for A. Thus it is enough to set f ′ t (e 1 ) = f t (e 1 ) -1 and increase r t (u) by one (in the mirror scenario with a value of -δ -1 in (10) we would set f ′ t (e 1 ) = f t (e 1 ) + 1 and decrease r t (u) by one). It is easy to observe that this makes e 1 satisfy δ-fairness with every other edge incident to u. After processing all edges and self-loops and edges in this way and since every edge receives ⌊x t (u)/d + ⌋ tokens, we eventually obtain that cumulative fairness is preserved, and moreover

|r ′ t (u)| ≤ d + .
A.1 Proof of Theorem 2.3

Here we finish the proof of Theorem 2.3 presented in Section 2.

Proof. We begin by providing the details of bound [START_REF] Doerr | Deterministic random walks on the two-dimensional grid[END_REF]. Let w be the i'th node of V , then we define w to be the vector, such that w[i] = 1 and ∀ j =i w[j] = 0. Let a = t -τ . Then, we have:

(P t+1-τ -P t-τ )ε ε ε τ ∞ = (P a+1 -P a )ε ε ε t-a ∞ = max w∈V w ⊤ P a+1 -P a ε ε ε t-a = max w∈V w ⊤ P a+1 -P a v∈V ε ε ε t-a (v)v ≤ ε ε ε t-a ∞ • max w∈V v∈V w ⊤ (P a+1 -P a )v ≤ (δd + + r) • max w∈V v∈V |P a+1 (v, w) -P a (v, w)| (8)
Since the graph is regular, we have P t (v, w) = P t (w, v). 1 From here on, we split the analysis of the claims of Theorem 2.3, proving each one of them by bounding (8) separately.

(i) O (δ + 1)d log n µ -discrepancy for d + ≥ 2d : For regular graphs having P (u, u) ≥ 1/2 for all u ∈ V , we have by [START_REF] Levin | Markov chains and mixing times[END_REF] (for a > 0)

∀ w∈V v∈V |P a+1 (w, v) -P a (w, v)| < 24 √ a .
(For case of a = 0, we have

∀ w∈V v∈V |P 1 (w, v) -P 0 (w, v)| ≤ 2.)
We obtain by applying

t-t * a=1 1/ √ a ≤ 2 √ t -t * 0≤a<t-t * (P a+1 -P a )ε ε ε t-a ∞ < (δd + + r)   2 + 48 t -t * 4tµ    ≤ 98(δd + + r) t µ .
Introducing this into ( 7) and setting T = 1 yields

x t+1 -x ∞ = O (δd + + r) t µ = O ((δ + 1)d) log n µ
where we take into account that t µ = 6 log n/µ, and that r ≤ d + . (Observe that whenever a cumulatively fair balancer has a δ = 0 the bound on the remainder r has to be of order Ω(d).)

(ii) O ((δ + 1)d √ n)-discrepancy for d + ≥ 2d :
Let D a+1 be the diagonal matrix of (P a+1 -P a ) and let X be the corresponding base change matrix. (P a+1 -P a )w 1 = max

w 2 =1 X ⊤ D a+1 Xw 1 ≤ √ n X ⊤ D a+1 X 2 = √ n D a+1 X 2 . (11)
We have

D a+1 =      λ a+1 1 -λ a 1 0 . . . 0 0 λ a+1 2 -λ a 2 . . . 0 . . . . . . . . . . . . 0 0 . . . λ a+1 n -λ a n      .
where λ 1 , . . . , λ n are the eigenvalues of P . We note that λ 1 = 1 and λ 2 , . . . ,

λ n ∈ [0, 1] since d • ≥ d.
Hence by plugging [START_REF] Friedrich | The cover time of deterministic random walks[END_REF] in ( 8) we derive

0≤a<t-t * (P t+ T -τ -P t-τ )ε ε ε τ ∞ ≤ (δ + 1)d + • a<t-t * max w∈V v∈V |P a+1 (w, v) -P a (w, v)| ≤ (δ + 1)d + • a<t-t * √ n D a+1 X 2 ≤ (δ + 1)d + • √ n t-t * a=0 |λ a+1 2 -λ a 2 | = (δ + 1)d + • √ n • (λ 0 2 -λ t-t * 2 ) ≤ (δ + 1)d + • √ n
iii Introducing this into (7) and setting T = 1 yields:

x t+1 -x ∞ ≤ (δ + 1)d + • √ n,
which completes the proof.

(iii) O (δ + 1) d log n µ -discrepancy for d + ≥ d + 1:
We bound the term t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ ∞ of (7):

t * <τ ≤t (P t+ T -τ -P t-τ )ε ε ε τ ∞ ≤ t * <τ ≤t (P t+ T -τ ε ε ε τ ∞ + P t-τ ε ε ε τ ∞ ≤ 2 t * <τ ≤t ε ε ε τ ∞ ≤ 2(δd + + r)(t -t * ) = 8t µ (δd + + r).
Putting this into [START_REF] Cooper | Simulating a random walk with constant error[END_REF] and dividing by T gives:

t<τ ≤t+ T x τ T -x ∞ ≤ δd + + 2r + 1 4 + (8t µ + 1)(δd + + r) T . (12)
The claim follows from ( 12) by setting T = 1.

B Omitted Proofs from Section 3

B.1 Proof of Lemma 3.4

Proof. We build upon the proof of Theorem 2.3 (see Section 2). We will use the notation established in the proof of Theorem 2.3. Since

d • = O(d + ), δ = O(1)
, and r ≤ d + , there is a constant c such that cd ≥ δd + + r. We also have t µ = 6 log n/µ. We set T ≥ 216c • d log n µ(λ+1) . We derive from ( 12)

t<τ ≤t+ T x τ T -x ∞ ≤ δd + +2r+ 1 4 + 9t µ • cd 216c • d log(n) µ(λ+1) ≤ δd + +2r+ 1 4 + (λ + 1) 4 ≤ δd + +2r+ 1 4 +λ+ 1 4 .
Therefore, we have that the difference between the average load of any node over T = 6d log(n) µ(λ+1) steps and the average load x is bounded by δd + + 2r + 1 2 + λ. This means that for every node u there has to be a time step t ′ ∈ [t + 1, t + T ] such that x t ′ (u) -x ≤ δd + + 2r + 1 2 + λ. This yields the claim.

B.2 Proof of Lemma 3.5

Proof. Fix c ∈ N. At any time t, we will divide the set L of m tokens circulating in the system into two groups: the set of black tokens L - t and the set of red tokens L + t , with L = L - t ∪ L + t . Colors of tokens persist over time unless they are explicitly recolored. For t = 1, for each node u we color exactly |L - 1 (u)| = min{x 1 (u), cd + } tokens at u black, and the remaining tokens at u red. In every time step, we follow two rules concerning token distribution: iv (1) The number of black tokens leaving a node u along any edge (including self-loops) is never more than c.

(2) At the start of each subsequent step t, we recolor some red tokens to black, so that the total number of black tokens located at a node u is exactly |L - t (u)| = min{x t (u), cd + }. We note that both rules of token circulation are well defined. The proof proceeds by induction. To prove the correctness of rule (1) at step t, observe that, by the definition of good s-balancers, for any node u we either have x t (u) ≤ cd + and then node u sends at most c tokens along each of its edges and self-loops, or x t (u) > cd + , and then node u sends at least c tokens along each of its edges and self-loops. In the first case, rule (1) is correct regardless of how u distributes tokens of different colors; in the second case, u has exactly cd + black tokens, and we can require that it sends exactly c of its black tokens along each of its edges and self-loops. To prove the correctness of rule (2), we note that by the correctness of rule (1) for the preceding time step, the number of black tokens arriving at u along edges and self-loops can be upper-bounded by min{x t (u), cd + }. Hence, no recoloring of tokens from black to red is ever required.

We now observe that the potential φ t (c) is by definition the number of red tokens circulating in the system at any given moment of time. Indeed, we have:

φ t (c) = u∈V (x t (u) -min{x t (u), cd + }) = m - u∈V |L - t (u)| = m -|L - t | = |L + t |.
The monotonicity for the potential follows immediately from the fact that no new red tokens appear in the system. To prove the potential drop, we will show that the number of tokens being recolored from red to black at node u in step t is at least ∆ t (c, u). Indeed, suppose that at time t -1 we had for some node u:

x t-1 (u) = cd + + i, for some i ≥ 1. Then, by definition of the self-preference of algorithm A, at least c + 1 units of load will be sent on at least i ′ = min{i, s} self-loops of u in step t. By rule (1) of the token circulation process, each of these self-loops will contain at least one red token. Thus, the number of red tokens arriving at u at time t is at least i ′ . On the other hand, the number of red tokens remaining after the recoloring at u in step t is precisely max{x t (u) -cd + , 0}. Thus, the number of tokens recolored from red to black at u, or equivalently the potential drop induced at u, is at least

max{i ′ -max{x t (u)-cd + , 0}, 0} = max{min{x t-1 (u)-cd + , s}-max{x t (u)-cd + , 0}, 0} def = ∆ t (c, u)
which yields the claimed potential drop.

B.3 Proof of Lemma 3.7

Proof. The proof is similar to Lemma 3.5. Fix c ∈ N. At any time t, we will divide the set L of tokens circulating in the system into two groups: the set of black tokens L - t and the set of red tokens L + t , with L = L - t ∪ L + t . Colors of tokens persist over time unless they are explicitly recolored. For t = 1, for each node u we color exactly |L - 1 (u)| = min{x 1 (u), cd + + s} tokens at u black, and the remaining tokens at u red. In every time step, we follow two rules concerning token distribution:

(1) The number of black tokens leaving u along original edges is at most c.

(2) At the start of each subsequent step t, we recolor some red tokens to black, so that the total number of black tokens located at a node u is exactly |L - t (u)| = min{x t (u), cd + + s}. We note that both rules of token circulation are well defined. The proof proceeds by induction. To prove the correctness of rule (1) at step t, observe that, by the definition of good s-balancers, for any node u we either have x t (u) ≤ cd + and then node u sends at most c black tokens along each of its edges and self-loops, or v x t (u) > cd + , and then node u sends over max{min{x t (u) -cd + , s}, 0} many self-loops c + 1 black tokens and c along all other edges. In the first case, rule (1) is correct regardless of how u distributes tokens of different colors; in the second case, let s ′ = max{min{x t (u) -cd + , s}, 0}. Node u has exactly cd + + s ′ black tokens, and we can require that it sends exactly c + 1 of its black tokens along s ′ many arbitrary self-loops, since the algorithm is s-self-preferring, and exactly c along each of its other edges. To prove the correctness of rule (2), we note that by the correctness of rule (1) for the preceding time step, the number of black tokens arriving at u along edges and self-loops can be upper-bounded by min{x t (u), cd + + s}. Hence, no recoloring of tokens from black to red is ever required.

We now observe that the potential φ ′ t (c) is by definition the number of missing black tokens such that every node has cd + + s of them. Indeed, we have:

φ ′ t (c) = u∈V (cd + + s -min{x t (u), cd + + s}) = (cd + + s) • n - u∈V |L - t (u)| = (cd + + s) • n -|L - t |.
The monotonicity for the potential follows immediately from the fact that no new red tokens appear in the system. To prove the claimed potential drop, we will show that the number of tokens being recolored from red to black in time step t is at least ∆ ′ t (c, u). Note, that a red token, which is recolored in black, will decrease the potential by 1. Indeed, suppose that at time t -1 we had for a node u: x t-1 (u) = cd + + s -i, for an integer i ≥ 1. Then, by the definition of the self-preference of algorithm A, at least i ′ = min{i, s} self-loops carry at most c tokens in step t. Intuitively, each of them can 'trap' a red token. By rule (1) of the token circulation process, every neighbor of u sent at most c black tokens. Thus, the number of black tokens arriving at u at time t is at most cd + + s -i ′ , and the number of red tokens which u receives is at least max{x t (u) -(cd + + s -i ′ ), 0}. Therefore, for x t-1 (u) < cd + + s, since at most i ′ self-loops 'trap' a red token we have that the number of red tokens which are repainted black at node u at time t is at least (by rule (2) of recoloring)

min{max{x t (u) -(cd + + s -i ′ ), 0}, i ′ } = min{max{ x t (u) -(cd + -min{cd + -x t-1 (u), 0}), 0}, min{cd + + s -x t-1 (u), s}} = max{min{x t (u) -x t-1 (u), s, x t (u) -cd + , cd + + s -x t-1 (u)}, 0} = ∆ ′ t (c, u),
and for x t-1 (u) ≥ cd + + s we have ∆ ′ t (c, u) = 0, which yields the claimed potential drop.

B.4 Proof of Theorem 3.3

Proof. We consider the behavior of the process for t ≥ T = O( log(Kn) µ

). Due to the monotonicity described in Lemma 3.5, once the maximum load in the system is below cd + for some c, it will stay below this threshold. In particular, this means that the maximum load will not exceed

x m = x + O d log n µ after O ((δ + 1)d • log n /µ) time, as shown in Theorem 2.3(iii).
In the first part of the proof, we will show that after a further O( d + s log 2 n µ ) time steps, the maximum load in the network will drop below the threshold value c 0 d + , where c 0 is the smallest integer such that

c 0 d + ≥ x + δd + + 2d • + d + /2.
We note that if there exists a node u with load x t (u) ≥ c 0 d + + 1 at some time moment t ≥ T , then by Lemma 3.4 with λ = d + /2 -1/2 (which we can apply to good s-balancers, putting r = d • , by Proposition A.2), there exists some time step t ′ ∈ [t + 1; t + T ], where T = O log n µ , such that we have

x t ′ (u) ≤ c 0 d + .
We then obtain directly from Observation 3.6 that such a load change for node u results in the decrease of potential φ(c 0 ) in the time interval [t + 1; t + T ]. Since the potential φ(c 0 ) is non-increasing and non-negative, it follows that eventually the load of all nodes must be below the threshold c 0 d + . vi In order to prove that the load of all nodes drop below c 0 d + within O( d + s log 2 n µ ) time steps after time T , we apply a more involved potential-decrease argument based on the parallel drop of multiple potentials φ(c), for c ∈ {c 0 , c 0 + 1, . . . , c 1 }. Here, c 1 is the smallest integer such that c 1 d + ≥ x m = x + O d log n µ . We now partition the execution of our process into phases of duration t p , p = 1, 2, 3, . . . , p f , such that, at the end of moment T p = T + t 1 + . . . + t p (end of the p'th phase), the following condition is satisfied:

φ Tp (c) ≤ 4 (c 1 -c) 2 -p (c 1 -c 0 )d + n, for all c 0 ≤ c ≤ c 1 . (13)
As we have remarked, the values of time t p are well defined, since eventually the potentials φ(c) drop to 0, for all c 0 ≤ c ≤ c 1 . Our goal is now to bound the ending time T p f of phase p f , where:

p f = 2(c 1 -c 0 ) + ⌈log((c 1 -c 0 )d + n)⌉ + 1. (14)
At the end of this phase, we will have by ( 13) that φ Tp f (c 0 ) ≤ 1/2, hence φ Tp f (c 0 ) = 0, and so there are no nodes having load exceeding c 0 d + .

We now proceed to show the following bounds on the duration of each phase t p :

t p = O d + s d log n µ • max{(2(c 1 -c 0 ) -p)d + + 1, d + /2 + 1} . (15)
For any fixed p, assume that bound [START_REF] Norris | Surprise probabilities in Markov chains[END_REF] holds for all phases before p. For phase p, the proof proceeds by induction with respect to c, in decreasing order of values:

c = c 1 , c 1 -1, . . . , c 0 . First, we consider values of c ≥ c 1 -p/2. For a fixed c, following (13) we denote b = 4 (c 1 -c) 2 -p (c 1 - c 0 )d + n. Knowing that φ T p-1 (c) ≤ 2b, φ T p-1 (c + 1) ≤ b/2,
and by the inductive assumption φ Tp (c + 1) ≤ b/4, we will show that φ Tp (c) ≤ b. Let s t (c) := φ t (c) -φ t (c + 1); intuitively, s t (c) can be seen as total the number of tokens in the system which are "stacked" on their respective nodes at heights between cd + + 1 and (c + 1)d + . For t ∈ [T p-1 ; T p ], s t (c) satisfies the following bound:

s t (c) = φ t (c) -φ t (c + 1) ≥ φ t (c) -φ T p-1 (c + 1) ≥ φ t (c) -b 2 . (16)
For any such time moment t consider the set of nodes with load at least cd + at time t. Within the time interval ),d + /2+1} follows from Lemma 3.4, every node with a load of more than cd + at time t, will decrease its load below x + δd + + 2d

• + 1 2 + 1 2 max{(2(c - c 0 )d + ), d + /2} ≤ c 0 d + -d + /2+ 1 2 +max{(d + (c-c 0 )), d + /4} ≤ cd + + 1 2
(and so also below cd + ) at some moment of time during the considered time interval. By Observation 3.6 a potential drop occurs for φ(c) in the considered interval [t + 1; t + T ]. More precisely, every node u with x t (u) ∈ [cd + , cd + + s] contributes x t (u) -cd + to both the potential drop and the value of s t (c), whereas every node u with x t (u) > cd + + s contributes exactly s to the potential drop and at most d + to the value of s t (c). Hence, we obtain from Observation 3.6 (and the fact that s ≤ d + ):

φ t+ T (c) ≤ φ t (c) - s d + • s t (c). (17)
Combining ( 16) and ( 17), we obtain for any time moment t ∈ [T p-1 , T p ]:

φ t+ T (c) ≤ φ t (c) - s d + • (φ t (c) -b 2 ). (18)
We can transform this expression to the following form:

φ t+ T (c) -b 2 ≤ φ t (c) -b 2 - s d + • (φ t (c) -b 2 ) = 1 - s d + • (φ t (c) -b 2 ).
vii Observe that we can fix t p satisfying (15) so that t p ≥ d + s T (which implies T p ≥ T p-1 + d + s T ) where we took into account that 2(c -c 0 ) ≥ 2(c 1 -c 0 ) -p for c ≥ c 1 -p/2. Now, taking advantage of the monotonicity of potentials, we have from [START_REF] Sauerwald | Tight bounds for randomized load balancing on arbitrary network topologies[END_REF]:

φ Tp ≤ φ (T p-1 + d + s T ) (c) ≤ b 2 + 1 - s d + d + s • (φ T p-1 (c) -b 2 ) ≤ b 2 + 1 2 (2b -b 2 ) = 3 4 b ≤ b,
which completes the inductive proof of the bound on t p for c ≥ c 1 -p/2. Moreover, for c < c 1 -p/2, (13) holds because 4 (c 1 -c) 2 -p > 1, and φ Tp (c) ≤ (c 1 -c 0 )d + n holds by the definition of potentials. Now, taking into account ( 14) and ( 15), we can bound the time of termination of phase p f of the process as follows:

T p f = T + p f p=1 t p f = T + p f p=1 O d + s d log n µ • max{(2(c 1 -c 0 ) -p)d + + 1, d + /2 + 1} = O   T + d s log n µ     2(c 1 -c 0 )-1 p=1 1 2(c 1 -c 0 ) -p + 1/d +   + d + d + /2 + 1 • log (c 1 -c 0 )d + n     = O T + d s log 2 n µ ,
where we recall that p f was given by expression ( 14 Proof. We will describe an initial state, corresponding to a steady state distribution, such that the flow of load along each edge e is the same in every moment of time (f 0 (e) = f 1 (e) = f 2 (e) = . . .), and the load of nodes does not change in time (however, the load of two distant nodes in the graph will be sufficiently far apart). We take two vertices u and w such that the distance between them is diam(G). We assign to every node v ∈ V a value b(v) being the shortest path distance from v to u (b(u) = 0, b(v) = 1 for direct neighbors of u, etc.). For any given edge (v 1 , v 2 ), we assign

f 0 (v 1 , v 2 ) = min(b(v 1 ), b(v 2 ))
We observe, that for each v: max and for each edge (v 1 , v 2 ):

f 0 (v 1 , v 2 ) = f 0 (v 2 , v 1 ).
Thus, at each step there exists a way to assign values of ⌈f (v)⌉ and ⌊f (v)⌋ so as to achieve desired values over edges, and that the system is in the steady state. The sought value of discrepancy is achieved for the considered pair of nodes u and w whose distance in G is diam(G).

viii

C.2 Proof of Theorem 4.2

Proof. We take an arbitrary graph G with n vertices which contains a ⌊d/2⌋-clique C. We can construct such a graph by taking nodes numbered from 0 to n -1 and connecting each pair of nodes i and j with an edge if and only if (i -j) mod n ∈ {n -⌊d/2⌋, . . . , n -1, 0, 1, . . . , ⌊d/2⌋}. If d is odd, we also add edges (i, j) for all (i -j) mod n = n/2. W.l.o.g. we can assume that C = {0, 1, . . . , ⌊d/2⌋ -1}.

Let A be a deterministic and stateless algorithm. Since A is deterministic and stateless, for each node u, at round t the load which A sends to neighbors and the load it keeps through the remainder vector depend solely on the current load of u. Let us fix ℓ = |C| -1. Initially, the load is distributed in such a way that every node in C has load ℓ and every other node has load 0. For any given node whose current load is ℓ, let p • denote the number of tokens kept by A at the considered node, and let p 1 , p 2 , . . . , p d be the number of tokens sent by A along respective original edges. Clearly, ℓ = p • + d i=1 p i . At most ℓ of those values are positive, so we can assume w.l.o.g. that p d = p d-1 = . . . = p ℓ+1 = 0.

We complete the construction in such a way that at each time step the load over every node is preserved. Let us fix i ∈ C. We design an adversary which has control over which values from {p 1 , . . . , p d } are sent along edges of the clique, and which chooses to send along edges of the clique the possibly nonzero values p 1 , p 2 , . . . , p ℓ . These values will be assigned to the edges (i, (i + 1) mod d), (i, (i + 2) mod d), . . . , (i, (i -1) mod d), respectively. We assign all other values arbitrarily since they are all equal to 0. Thus, we observe that at each step loads of nodes are preserved, since the new load of all nodes having load ℓ at the end of a step is p • + ℓ i=1 p i = ℓ in the next step. All other nodes in V \ C will not receive any tokens and they will remain with load 0. Thus, the load of nodes in the graph does not change over rounds and the load difference of nodes in C and the nodes in V \ C is cd, for some constant c > 0.

C.3 Proof of Theorem 4.3

Proof. Let u be an arbitrary vertex belonging to the shortest odd cycle. We assign to every node v ∈ V a value b(v) being the shortest path distance from v to u (b(u) = 0, b(v) = 1 for direct neighbors of u, etc.). Observe that for any edge (v 1 , v 2 ), we have b(v 1 ) -b(v 2 ) ∈ {-1, 0, 1}. Moreover, we have b(v 1 ) = b(v 2 ) only if b(v 1 ) ≥ ϕ(G). Suppose b(v 1 ) < ϕ(G). We can construct an odd length cycle u v 1 → v 2 u of at most 2 • ϕ(G) -1, a contradiction.

For the construction, fix a sufficiently large integer L > 0 which will be linked to the average load in the system (it has no effect over the final discrepancy, we need L to be large enough to have nonnegative values of load). We will design a configuration of load in the system which will alternate between two different states, identical for all configurations in odd time steps and even time steps, respectively (thus, f 0 (e) = f 2 (e) = . . . and f 1 (e) = f 3 (e) = . . .). We will describe a configuration at any time step by providing values distributed over every edge. The load distributed over edge (v 1 , v 2 ) will only depend on the values of b(v We also set:

f 1 (v 1 , v 2 ) = f 0 (v 2 , v 1 ). ( 19
)
Setting all of f 0 (e) and f 1 (e) is enough to describe every value over every edge. We now prove that such a configuration is possible for some execution of the ROTOR-ROUTER algorithm, i.e., that there exists an ordering of the original edges of each node in the cycle of the ROTOR-ROUTER which leads to such alternating configurations. We observe that f t (v 1 , v 2 ) + f t (v 2 , v 1 ) = 2L for t ∈ N. Thus, for t ∈ N we have

f t (v 1 , v 2 ) + f t+1 (v 1 , v 2 ) = 2L. (20)
ix

We observe, that for any node v and its two neighbors v 1 , v 2 , it holds

|f t (v, v 1 ) -f t (v, v 2 )| ≤ 1
Also, due to (20):

. . . = f t (v, v 1 ) -f t (v, v 2 ) = -(f t+1 (v, v 1 ) -f t+1 (v, v 2 )) = f t+2 (v, v 1 ) -f t+2 (v, v 2 ) = . . . By [START_REF] Subramanian | An analysis of diffusive load-balancing[END_REF], the incoming and original flows of load through edges are preserved, and because the difference between original flows is alternating in signs (for two incident original edges), it is always possible to choose an edge ordering in the cycle of the ROTOR-ROUTER representing such a situation. Indeed, we observe that for a particular vertex v, original directed edges of v can be partitioned into two sets P 1 ∪ P 2 , where in even steps edges from P 1 are given one more token than edges from P 2 , and in odd steps edges from P 1 are given one less token than edges from P 2 . So it is enough to select an ordering of edges for the ROTOR-ROUTER such that every edge from P 1 precedes every edge from P 2 set. We observe that the node u alternates between loads (L+ϕ(G))•d and (L-ϕ(G))•d, while the average load of a node in this setting is exactly L • d, which gives us the claimed discrepancy.

x

3 )

 3 that algorithms satisfying these conditions with d • ≥ d achieve a discrepancy of O(d • min{ log n/µ, √ n}) in O(T ) time steps. The restrictions result in deterministic balancing schemes with an improved discrepancy after O(T ) time steps. For example, for expanders, the achieved discrepancy after time O(T ) is O( √ log n), as opposed to Θ(log n).

Theorem 4 . 1 .

 41 Let G be a d-regular graph. There exists an initial distribution of tokens and a round-fair balancer A, such that A cannot achieve a discrepancy better than (c • diam(G) • d), for some positive constant c > 0.

Theorem 4 . 3 .

 43 Let G be any d-regular and non-bipartite graph, and let d + = d. Then, there exists an initial load distribution and direction of the rotors such that ROTOR-ROUTER cannot achieve discrepancy better than (c • dϕ(G)), for some positive constant c > 0, where (2ϕ(G) + 1) is the odd girth of G.

1 ≤ max w 2

 12 max w∈V v∈V |P a+1 (w, v) -P a (w, v)| = max w∈V v∈V |v(P a+1 -P a )w| = max w∈V (P a+1 -P a )w =1

[

  t+1; t+ T ], where the period of time T = O d log n µ max{(2(c-c 0 )d + +1

  ), and that c 1 d + -c 0 d + = O d log n µ . In this way, we have shown that a balancedness of (δ+1/2)d + +2d • is achieved in time O T + d s log 2 n µ . By using the same techniques and Observation 3.8 instead of Observation 3.6, we can show that no node has a load of less than x-(δ +1/2)d + +2d • . This gives the desired discrepancy bound of (2δ +1)d + +4d • . C Omitted Proofs from Section 4 C.1 Proof of Theorem 4.1

e 1 ,e 2 ∈Ev |f 0 (e 1 )

 11 -f 0 (e 2 )| ≤ 1

1 )

 1 and b(v 2 ). If b(v 1 ) ≥ ϕ(G) or b(v 2 ) ≥ ϕ(G), we set f 0 (v 1 , v 2 ) = L, otherwise: f 0 (v 1 , v 2 ) = L + (ϕ(G) -min(b(v 1 ), b(v 2 ))) if 2|b(v 1 ) and 2 | b(v 2 ), L -(ϕ(G) -min(b(v 1 ), b(v 2 ))) if 2 | b(v 1) and 2|b(v 2 ).

Table 1 :

 1

A comparison of the discrepancy of load-balancing algorithms in the diffusive model for d-regular graphs. In all result statements, if not specified otherwise, we assume that the graph is augmented with at least d self-loops per node.

  Definition 3.1. Assume δ is an arbitrary constant and 1 ≤ s ≤ d • . An algorithm is called a good s-balancer if if for t ∈ N and u ∈ V all edges of u (including self-loops) receive ⌊x t (u)/d + ⌋ many tokens in step t. The remaining e(u) = x t (u) -d + • ⌊x t (u)/d + ⌋ have to be distributed over the edges such that 1. the algorithm is cumulatively 1-fair 2. at least min{s, e(u)} self-loops receive ⌈x t (u)/d + ⌉ many tokens. (s-self-preferring) 3. every edge e ∈ E + u receives at most ⌈x t (u)/d + ⌉ many tokens. Note that, by definition, every good s-balancer is round-fair, meaning that every edge receives either ⌊x t (u)/d + ⌋ or ⌈x t (u)/d + ⌉ many tokens in every round. Observation 3.2. The algorithm SEND ([ x /d + ]) is a good (d + -2d)-balancer for d + > 2d. Furthermore, ROTOR-ROUTER * is a good 1-balancer.

For general graphs, one can use Pt(v, w) = (d + (w)/d + (v))Pt(w, v)

APPENDIX A Omitted Proofs from Section 2

We start with a technical lemma giving bounds on the behaviour of the error matrix Λ τ for τ ∈ N with τ > log n/µ. We recall that Λ t = P t -P ∞ .

Lemma A.1. Let (q t ) be a sequence of vectors parameterized by t, let qt = P ∞ q t , and let c ∈ N be an arbitrary constant.

we have

(ii) The following bound holds:

Proof. The proof proceeds by standard arguments (cf. e.g. [START_REF] Levin | Markov chains and mixing times[END_REF], Chapter 4); we do not attempt to optimize the constants in the claims. Consider the eigendecomposition of matrix

To show claim (i), we take into account that qt is an eigenvalue of P, so Λ t qt = 0, and we can write:

Claim (i) follows directly. To show Claim (ii), observe that we have:

The following proposition shows that the change in the model (the way the tokens are retained) in the preliminaries of Section 2 in comparison to the original model described in Section 1.3 does change the load sent over any original edge in the graph. In particular, every cumulatively fair balancer can be transformed (by shifting tokens from self-loops to the remainder) into an algorithm guaranteeing cumulative fairness on all edges and that this transformed algorithm sends exactly the same load over original edges in every round.

Proposition A.2. For any cumulatively δ-fair load-balancing algorithm A, there exists an Algorithm A ′ with remainder r ≤ d + such that for any t and for all (u, v) ∈ E + u 1. F t (u, v) -

2. the load sent over (u, v) is the same in A and A ′ . i