online balanced repartitioningstefan/repartition.pdf1 introduction graph partitioning problems are...

16
Online Balanced Repartitioning Chen Avin 1 Andreas Loukas 1,2 Maciej Pacut 3 Stefan Schmid 2,4 1 Ben Gurion University of the Negev, Israel 2 TU Berlin, Germany 3 University of Wroclaw, Poland 4 T-Labs, Germany Abstract This paper initiates the study of a fundamental online problem called online balanced repartitioning. Unlike the classic graph partitioning problem, our input is an arbitrary sequence of communication requests between nodes, with patterns that may change over time. The objective is to dynamically repartition the n nodes into clusters, each of size k. Every communication request needs to be served either locally (cost 0), if the communicating nodes are collocated in the same cluster, or remotely (cost 1), using inter- cluster communication, if they are located in different clusters. The algorithm can also dynamically update the partitioning by migrating nodes between clusters at cost α per node migration. Therefore, we are interested in online algorithms which find a good trade- off between the communication cost and the migration cost, maintaining partitions which minimize the number of inter-cluster communications. We consider settings both with and without cluster-size augmentation. For the former, we prove a lower bound which is strictly larger than k, which highlights an interesting difference to online paging. Somewhat surprisingly, and unlike online paging, we prove that any deterministic online algorithm has a non-constant competitive ratio of at least k, even with augmentation. Our main technical contribution is an O(k log k)-competitive algorithm for the setting with (constant) augmentation. We believe that our model finds interesting applications, e.g., in the context of data- centers, where virtual machines need to be dynamically embedded on a set of (multi-core) servers, and where machines migrations are possible, but costly. Keywords: On-line Algorithms, Graph Partitioning, Online Paging and Caching, Migra- tion, Matching, Ski-rental arXiv:1511.02074v1 [cs.DS] 6 Nov 2015

Upload: truongtram

Post on 28-Aug-2019

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

Online Balanced Repartitioning

Chen Avin1 Andreas Loukas1,2 Maciej Pacut3 Stefan Schmid2,4

1 Ben Gurion University of the Negev, Israel 2 TU Berlin, Germany3 University of Wroclaw, Poland 4 T-Labs, Germany

Abstract

This paper initiates the study of a fundamental online problem called online balancedrepartitioning. Unlike the classic graph partitioning problem, our input is an arbitrarysequence of communication requests between nodes, with patterns that may change overtime. The objective is to dynamically repartition the n nodes into ` clusters, each ofsize k. Every communication request needs to be served either locally (cost 0), if thecommunicating nodes are collocated in the same cluster, or remotely (cost 1), using inter-cluster communication, if they are located in different clusters. The algorithm can alsodynamically update the partitioning by migrating nodes between clusters at cost α pernode migration. Therefore, we are interested in online algorithms which find a good trade-off between the communication cost and the migration cost, maintaining partitions whichminimize the number of inter-cluster communications.

We consider settings both with and without cluster-size augmentation. For the former,we prove a lower bound which is strictly larger than k, which highlights an interestingdifference to online paging. Somewhat surprisingly, and unlike online paging, we provethat any deterministic online algorithm has a non-constant competitive ratio of at leastk, even with augmentation. Our main technical contribution is an O(k log k)-competitivealgorithm for the setting with (constant) augmentation.

We believe that our model finds interesting applications, e.g., in the context of data-centers, where virtual machines need to be dynamically embedded on a set of (multi-core)servers, and where machines migrations are possible, but costly.

Keywords: On-line Algorithms, Graph Partitioning, Online Paging and Caching, Migra-tion, Matching, Ski-rental

arX

iv:1

511.

0207

4v1

[cs

.DS]

6 N

ov 2

015

Page 2: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

1 Introduction

Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance [2, 10, 19] and the references therein. Due to their numerouspractical applications (e. g., communication networks, data mining, social networks, etc.),partitioning problems are also among the most intensively studied problems. Interestinglyhowever, not much is known today about how to dynamically partition nodes which interactor communicate in a time-varying fashion.

This paper initiates the study of a natural model for online graph partitioning. We aregiven a set of n nodes with time-varying communication patterns (in pairs), which we haveto partition into ` clusters of equal size. Intuitively, we would like to avoid inter-cluster linksby mapping communicating nodes to the same cluster. Since communication patterns changeover time, partitions should to be dynamically readjusted, that is, the nodes re-partitioned,in an online manner. The objective is to jointly minimize inter-cluster communications andreconfigurations, that is, the number of communication requests served remotely and thenumber of times nodes are migrated from one cluster to another.

Practical Motivation. One practical motivation for our problem arises in the context ofserver virtualization. Imagine a set V of n virtual machines (henceforth called nodes) whichneed to be placed to ` physical servers (called clusters). Each server can host k virtualmachines simultaneously. For instance, k is the number of CPU cores of the server. Assumethat the ` servers are connected via a switch, to form a datacenter rack. It is desirable that thefrequently communicating virtual machines be collocated, i.e., mapped to the same physicalserver: communication across the network induces network load and may exhibit a higherlatency. However, migrating virtual machines between servers also comes at a price: the statetransfer is bandwidth intensive, and may even lead to short service interruptions.

Model. We assume the perspective of online algorithms and competitive analysis and definethe online balanced repartitioning problem as follows. The inputs to our problem are:

1. A set V of n = |V | nodes, initially distributed arbitrarily across the ` clusters C ={C1, . . . , C`}, each of size k.

2. An arbitrary and possibly infinite sequence σ of |σ| communication requests, σ ={u1, v1}, {u2, v2}, {u3, v3}, . . . , {u|σ|, v|σ|}. For any t, {ut, vt} denotes a communicationrequest: at time t, nodes ut, vt ∈ V exchange (a fixed amount of) data.

At any moment in time t, each node v ∈ V is assigned to a cluster, which we will refer to byCt(v). If the time t is clear from the context or irrelevant, we simply write C(v). We call twonodes u, v ∈ V collocated if they are in the same cluster: C(u) = C(v).

We consider two settings:

1. Without augmentation: The nodes fit perfectly into the clusters, i.e., n = k · `.

2. With augmentation: The online algorithm has access to additional space in each cluster.We say that an algorithm is c-augmented if the size of each cluster is k′ = c · k, whereasthe total number of nodes remains n = k ·` < k′ ·`. As usual, in the competitive analysis,the augmented online algorithm is compared to the optimal offline algorithm withoutaugmentation.

Each time t, the online algorithm decides how to repartition the nodes into clusters afterserving the communication request {ut, vt}. We assume that a communication request betweentwo nodes located in different clusters costs 1, and a communication request between two nodeslocated in the same cluster costs 0. We assume that migrating a node from one cluster to

1

Page 3: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

another costs α > 0. In a setting without augmentation, due to space constraints, a node cannever be migrated alone; swapping the position of two nodes costs 2α.

We want to devise online repartitioning algorithms which minimize the (strict) competitiveratio. Let On(σ) be the cost incurred by an online algorithm On for a given request sequenceσ. We compare On(σ) to the cost Off(σ) incurred by the optimal offline algorithm Off forthe same sequence. In contrast to On which learns the requests one by one as it serves them,Off is clairvoyant, meaning that it has a complete knowledge of the entire request sequenceσ, as well as of On’s decisions, ahead of time.

The competitive ratio ρ(On) is defined as

ρ(On) = maxσ

On(σ)

Off(σ)(1)

In summary, an online repartitioning algorithm has to define a strategy for each of thefollowing questions:

A) Serve remotely or migrate (“rent or buy”)? If a communication pattern is short-lived, itmay not be worthwhile to collocate the nodes: the migration cost cannot be amortized.

B) Where to migrate, and what? If nodes should be collocated, the question becomes where.Should ut be migrated to C(vt), vt to C(ut), or should both nodes be migrated to a newcluster? Moreover, an algorithm may be required to pro-actively migrate (resp. swap)additional nodes.

C) Which nodes to evict? There may not exist sufficient space in the desired destinationcluster. In this case, the algorithm needs to decide which nodes to evict, to free upspace.

Our Contributions. This paper initiates the study of a fundamental dynamic repartitioningproblem, from an online perspective. We make the following contributions:

1. To acquaint ourselves with the problem, we first examine the special case k = 2 (butarbitrary `): essentially an online rematching problem. We present an almost optimal,constant-competitive online algorithm.

2. While in a setting without augmentation, a k− 1 lower bound for the competitive ratioof any deterministic online algorithm follows from a simulation of online paging, we alsoderive a lower bound which is strictly larger than k, for any α > 0.

3. Intriguingly, we show that the online repartitioning problem remains hard even withaugmentation. In particular, we prove that no augmented deterministic online algorithmcan achieve a competitive ratio below k, as long as it cannot solve the problem triviallyby placing all nodes into a single cluster. This is different from the related problem ofonline paging which becomes constant competitive with constant augmentation [21].

4. Our main algorithmic contribution is a deterministic O(k log k)-competitive algorithmfor the setting with (small) augmentation.

Observe that none of our bounds depends on `. This is interesting, as for example, inour motivating virtual machine collocation problem, k is likely to be small: a server typicallyhosts a small number of virtual machines.

Paper Organization. The remainder of this paper is organized as follows. After reviewingrelated work in Section 2, we start by discussing the special case k = 2 in Section 3. Weconsider lower bounds for the general setting with and without augmentation in Section 4.Section 5 is then devoted on the presentation and analysis of REP, an augmented determin-istic algorithm. To facilitate the presentation, some proofs appear in the Appendix.

2

Page 4: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

2 Related Work

Our work assumes a new perspective on several classic algorithmic problems. For example,the subproblem of finding a good trade-off between serving requests remotely (at a low butrepeated communication cost) or migrating nodes together (entailing a potentially high one-time cost α), is essentially a ski rental or rent-or-buy problem [14, 15]. A similar tradeoff alsoarises in the context of online page and server migration problems [5, 6], where requests appearin a metric space [7] or graph [3] over time, and need to be served by one [6] or multiple [13]servers. However, in our problem, the number of possible node-cluster configurations is large,rendering it difficult to cast the problem into an online metrical task system. Moreover,in contrast to most online migration problems, which typically optimize the placement ofa page or server with respect to the request locations, in our model, both end-points of acommunication request are subject to optimization.

Our problem also has connections to online packing problems, where items of differentsizes arriving over time need to be packed into a minimal number of bins [18, 20]. In contrastto these problems, however, in our case, the objective is not to minimize the number of binsbut rather the number of “links” between bins, given a fixed number of bins.

Our model can be seen as a generalization of online caching and paging [12, 16, 17, 22],where requests for data items arrive over time and need to be served from a cache of finitecapacity, and where the number of cache misses must be minimized. The online caching andpaging problem was first analyzed in the framework of the competitive analysis by Sleatorand Tarjan [21], who presented a kALG/(kALG− kOPT + 1)-competitive algorithm, wherekALG is the cache size of the online and kOPT the cache size of the offline algorithm. Theauthors also proved that no deterministic online algorithm can beat this ratio. Interestingly,in contrast to online caching where a constant augmentation already allows for constant-competitive online algorithms, in our model, we can prove high lower bounds even withaugmentation.

In the classic caching model and its variants [8, 9, 17], items need to be put into the cacheupon each request, and the problem usually boils down to finding a smart eviction strategy,such as Least Recently Used (LRU) or Flush-When-Full (FWF). In contrast, in our setting,requests can be served remotely. In this light, our model is reminiscent of caching modelswith bypassing [1, 11]. More importantly, however, in our model, the “cache” is distributed :requests occur between nodes and not to nodes, and costs can be saved by collocation.

Our model also nicely generalizes recent work on online clique and correlation clustering [2,4, 10, 19]. In this prior work, nodes and/or links can appear over time, but the underlyingcommunication graph remains invariant.

3 Warmup: Online Rematching

Let us first consider the special case where clusters are of size two (k = 2, arbitrary `). This isessentially an online (re-)matching problem: clusters of size two host (resp. “match”) exactlyone node pair.

In a k = 2 scenario, the question of which node to evict is trivial: there is simply nochoice. The problem can also be seen from a ski-rental perspective: we have to find a goodtradeoff between serving requests remotely (“renting”) and migraing the communicating nodestogether (“buy”).

A natural Greedy online algorithm to solve this problem proceeds as follows: For eachcluster pair Ci, Cj , hosting nodes ui, vi and uj , vj respectively, we count the total number ofrequests over time between non-collocated pairs. After 2α requests occurred between nodesinside any cluster C1 to nodes outside the cluster, we identify the cluster C2 with which C1

3

Page 5: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

τ0 τ1 τ2(xy timeline)

t0 t1 t2

uvuv out(uv)

out(xy)

out(ux)

out(ux)

ux

xb

xyxy

xu

ua

(uv timeline)

Figure 1: The illustration, which accompanies the proof of Lemma 1, shows a sequence ofevents leading Greedy to merge node u and v, as well as x and y, at time t2 = τ2. Each ofthe two time-lines correspond to the swaps and requests involving a pair (uv or xy). Arrowscorrespond to merges (pointing down) and splits (pointing up) of node pairs by Greedy.Boxes correspond to requests Greedy served remotely. For instance, the events on the right-most side correspond to the sequence of λα requests that cause Greedy to swap at t2.

communicates the most in this time period. We then swap u1 with v2 or u2, respectively.Afterwards, we reset all pairwise communication counters involving u1, u2, v1, v2 (including toother clusters).

We can show the following:

Lemma 1. Greedy is 4-competitive.

Proof. We analyze the competitive ratio of Greedy by considering a parametrized algorithmGreedy(λ), which acts exactly like Greedy, but using a threshold λα. To prove our claim,we consider each swap that Greedy(λ) performs, and show that Off must have paid at leasta λ-dependent fraction of the online algorithm’s cost, either by serving requests remotelyor by migrating nodes. We then derive the competitive ratio by minimizing over λ. Moreconcretely, suppose that at time t2, Greedy(λ) merged nodes uv and xy, where, at time t1,the partitioning was ux and vy—see Figure 1.

The costs of Greedy(λ). We proceed to account for all costs of the online algorithmpertaining to the swap, i. e., the costs pertaining to pair uv starting from the last time thepair was merged by Greedy(λ), denoted as t0, and until t2, as well as the respective costsof pair xy in the corresponding period (τ0, τ2]. Obviously, since Greedy(λ) only merged thepairs once in the considered period, it paid exactly 2α migration cost. Furthermore, if t1 isthe last time u was merged with some other node prior to t2, this node must be x, meaningthat during period (τ1 = t1, τ2 = t2], Greedy(λ) served λα requests remotely between thecluster holding u and x, and that holding v and y (box out(ux) in the figure).

Summarizing, the online algorithm’s cost is

Greedy(λ) = (2 + λ)α.

The costs of Off. W.l.o.g., let us focus on u and v. Depending of whether Off served theout(ux) requests remotely or not, we distinguish two cases:

1. Off had u and v collocated during parts of (t0, t2]. As we show next, independentlyof x and y, Off must have paid at least min{α, λα/2}. To see this, notice that Off hadtwo options: (a) First, Off merged u and v at some instant during (t0, t2). Splitting the2α migration cost Off paid for the four involved nodes, and charging the two quarterspertaining to nodes u and v, we find that in this case Off ≥ α. (b) Second, Off mergedu and v before t0. In this case, Off must have paid λα for the outgoing requests out(uv)

4

Page 6: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

from the cluster hosting u and v between (t0, t2]. By distributing again the cost overthe four involved nodes and charging the two quarters pertaining to nodes u and v, itfollows that Off ≥ λα/2.

2. Off kept u and v in different clusters during (t0, t2]. In contrast to the previouscase, here Off has the option to distribute its communication costs arbitrarily amongstu and v, or x and y. We therefore need to examine Off’s actions w. r. t. to x and y, aswell as u and v. As shown below, also in this case, Off ≥ min{α, λα/2}. We distinguishthree sub-cases: (a) First, Off merged x and y at some instant during (τ0, τ2). Thisis the symmetric case to Case 1(a). As before, we can charge Off = α migration cost(we distribute the 2α cost paid for the four involved nodes). (b) Second, Off merged xand y before τ0. This is the symmetric case to Case 1(b). As before, after distributingthe cost among all involved nodes, we find that Off ≥ λα/2 because of the outgoingrequests from x and y during (τ0, τ2] (box out(xy) in the figure). (c) Third, Off keptx and y at different clusters during (τ0, τ2]. By the swapping condition of Greedy(λ),we know that during (t1, t2], a total of out(ux) = λα requests were served betweenthe cluster hosting nodes u, x and all other clusters. There are two types of requests:R1 requests between nodes u, v and x, y and R2 request between u to other nodes andbetween x to other nodes and R1 + R2 = λα. Now, since Off kept both u and v, aswell as x and y in different clusters, it must have paid for all R1. Regarding R2, sinceOff performed no swaps during (τ0, τ2], it was only able to save R′ ≤ R2 requests bysmartly placing u and x with two other nodes p and q at some earlier time. Yet, sincethe online algorithm always collocates the most heavily communicating nodes, it musthold also that R′ ≤ R1 so R′ ≤ λα/2 and Off pays at least λα−R′ ≥ λα/2.

Optimizing over λ, we obtain Greedy’s competitive ratio

ρ(Greedy) = minλ

(2 + λ)α

max {λα/2, α}= 4,

which is achieved for λ∗ = 2.

This is almost optimal, as no deterministic online algorithm can achieve a competitiveratio below 3.

Lemma 2. For k = 2 and any request sequence σ of length |σ|, no deterministic onlinealgorithm achieves a competitive ratio below 3− 2

1+|σ|/(4α) .

4 Lower Bounds for Online Balanced Repartitioning

Our problem is generally hard to approximate online. While it is easy to see that a lowerbound of k − 1 follows by simulating online paging (using only two servers), we can prove aneven larger lower bound (cf. Theorem 1). In fact, we observe that even with augmentation,our problem is hard to approximate online: as long as the augmentation is less than whatwould be required to solve the partitioning problem trivially, namely by putting all nodes intothe same cluster (i. e., c < `), no deterministic online algorithm can achieve a competitiveratio better than k (cf. Theorem 2). This highlights an intriguing difference from onlinepaging, where the competitive ratio becomes constant under augmentation [21]. Both ourlower bounds are independent of the initial configuration: both Off and On start off havingthe nodes placed identically in clusters.

Theorem 1. No deterministic online algorithm can achieve a competitive ratio smaller thank + k−2

2α , independently of `.

Interestingly, an adversary can outwit any online algorithm, even in the setting withaugmentation. In the following, we consider online algorithms which, compared to Off, havec-times more space in each cluster.

5

Page 7: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

Theorem 2. No c-augmented deterministic online algorithm can achieve a competitive ratiosmaller than k, as long as c < `.

Proof. We prove the claim by constructing a request sequence σ which does not reveal anyinformation about the locations and actions of an optimal offline algorithm Off. In such ascenario, in order to ensure a finite competitive ratio, the online algorithm On is forced toiterate through a large set of possible partitionings. Off on the other hand can settle on onepartitioning, paying only for a small subset of the requests.

To show the lower bound, it is sufficient to consider requests arising from a ring graphG = (V,E) of n nodes and n edges ei = {ui, ui+1} for i = 1, . . . , n − 1 and en = {un, u1}.For every possible partitioning p of G, the cut-edge set cut(p) contains all edges of G whichare cut by the partition, i. e., ei ∈ cut(p) if ui and ui+1 are not in the same cluster, i.e.,C(ui) 6= C(ui+1).

To define the request sequence σ, suppose that at time t, On has chosen a partitioningpt and let cut(pt) be the corresponding cut-edge set. The adversary then issues the nextrequest across the ring cut-edge adjacent to the node with the smallest id, formally σt+1 =arg minei∈cut(pt) i. By construction, σ has two important properties: (i) On will have to serveevery request remotely. (ii) σ is uniquely determined by the online algorithm and does notdepend on Off’s actions at all. Accordingly, the evolution of the request sequence is entirelyunder the control of On.

By construction On’s cost, in each time step, is at least 1 (serve remotely or swap), so itscost up to time t is On(σt) ≥ t. Regarding Off’s cost, let an order-preserving partitioning bea partitioning in which nodes in the same cluster have contiguous ids on the ring graph. Sincethere are k possible order-preserving partitionings om, where m = 1, . . . , k, we define for eachpartitioning the corresponding cut-edge sets as cut(om) = {ei : (i − 1) mod k = m − 1}. Itis crucial to observe that different order-preserving cut-edge sets are disjoint, meaning thatcut(om) ∩ cut(om′) = ∅ for all m 6= m′. Before the first request is issued, Off chooses anorder-preserving partitioning o and performs the necessary swaps to reach it, paying migrationcosts of MOff ≤ α · n. Off does not swap nodes again. The key point here is that, as far asOn is concerned, Off might have chosen any order-preserving partitioning. We now claimthat Off’s communication cost is Off(σt) ≤ t/k. Based on On’s actions, Off chooses tomigrate to an order-preserving partitioning o∗ that minimizes its communication cost. LetCOff(om) denote the communication cost of Off if it had chosen to migrate to partitioning

om. Since the order-preserving cuts are disjoint, we have that at time t,∑k

m=1COff(om) = t.Therefore, clearly minmCOff(om) ≤ t/k so COff(o

∗) ≤ t/kIt easily follows that, as the length of the request sequence grows, the competitive ratio

approaches k.

ρ(On) = limt→∞

On(σt)

Off(σt)≥ lim

t→∞

t

COff +MOff≥ lim

t→∞

t

t/k + α · n= k (2)

To see that the above holds independently of the augmentation (given that c < `) notice that,as long as On cannot fit the entire ring within a single cluster (k′ < k · `), the cut edge cut(pt)sets will be non-empty. The adversary can therefore always generate the request sequence asabove, forcing On to serve each request remotely, and the argument proceeds as before.

5 REP Algorithm: An O(k log k) Upper Bound

The main technical contribution of this paper is an online REPartitioning algorithm (REP)which achieves an almost tight upper bound matching the k lower bound of Theorem 2 withaugmentation at least 4. Intuitively we think of a 4-augmented algorithm as one that can usetwice as many clusters, each having twice as much space. Formally, we claim:

Theorem 3. With augmentation at least 4, REP is O(k log k)-competitive.

6

Page 8: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

REP is summarized in Algorithm 1. The algorithm is non-trivial and relies on the followingbasic ideas:

1. Communication components. REP groups nodes which recently communicated intocomponents. Once the cumulative communication cost of a group of nodes distributedacross two or more components exceeds a certain threshold, REP merges them intoa single component, by collocating them in the same cluster. That is, we maintain alogical, time-varying weighted component graph Gt = (Ct, Et, wt), where Ct is the setof components immediately after request t, the edges Et connect components whichcommunicated at least once during this epoch, and wt is the number of communica-tion requests between the corresponding two nodes in this epoch. In other words, anedge (i, j) ∈ E between two components ci, cj ∈ Ct indicates that the two compo-nents (resp. the corresponding nodes in ci and cj) were involved in wij > 0 requests.Although the graph Gt changes over time (when components are merged or split ac-cording to REP), when the time is clear from the context, we drop the time-index andsimply write G = (C,E,w). Edges disappear (and their weights are reset) when thecomponents are merged. For a component set X = {ci, cj , . . . } ⊆ C, let |X| denotethe number of components in X. We call vol(X) =

∑c∈X |c| the volume of the set and

comm(X) =∑

ci,cj∈X wij the communication cost among the members of X.

2. Component epochs. We analyze REP in terms of component-wise epochs. A componentepoch starts with the first request between two individual nodes (singleton components),and ends when: (i) the size of the component (the number of nodes in the connectedcomponent) exceeds k and (ii) the accumulated communication between the componentsexceeds a certain threshold. REP maintains the invariant that components are neversplit during an epoch, that is: once two nodes of the same component epoch are placedtogether in a cluster, they will remain in the same cluster in the remainder of theepoch (but they may possibly be migrated together to a new cluster). As such, whena component set X is merged into a new component (Line 7), REP tries to migrateall the components to the cluster of the largest component (ties broken arbitrarily). Ifthere is not enough reserved space in the cluster, then all components are migrated toa new cluster. If on the other hand vol(X) exceeds k, the component-epoch ends, andall c ∈ X are reset to singleton components (Line 19). More specifically, according toAlgorithm 1, two termination criteria have to be fulfilled for a component set Y to endan epoch: vol(Y ) > k and comm(Y ) ≥ vol(Y ) · α. This non-trivial criterion is critical,to keep the migration cost competitive. An epoch that ends as a result of Y is called aY -epoch.

3. Space reservations. In order to keep the number of migrations low, REP performsspace reservations in clusters. Whenever REP migrates a component c into a cluster, itreserves additional space reserve(c) = min{k−|c|, |c|}. As we will prove, these proactivespace reservations can ensure that a component has to be migrated again only after itssize doubles. For a cluster s, let reserved(s), occupied(s) and spare(s) denote the reserved,occupied and spare (unreserved) space in s, where always reserved(s) + occupied(s) +spare(s) = 2k. Similarly, for a component c let reserved(c) denote the amount of itsreserved space that is still available in its current cluster.

The remainder of this section is devoted to the proof of Theorem 3. The proof unfolds ina number of observations and lemmas. We first observe, in Proposition 1, that indeed, it isalways possible to find a cluster where the to-be-merged components fit. We then derive anupper bound on REP’s cost per component epoch and a lower bound on the optimal offline

7

Page 9: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

Algorithm 1 REP with 4 Augmentation

1: Construct graph G = (C,E,w) with singleton components: one component per node. Set

wij = 0 for all {vi, vj} ∈(V2

). For each component ci, reserve space reserve(ci) = 1.

2: for each new request {ut, vt} do. Keep track of communication cost.

3: Let ci = C(ut) and cj = C(vt) be the two components that communicated.4: if ci 6= cj then5: wij ← wij + 16: end if

. Merge components.7: Let X be the largest cardinality set with vol(X) ≤ k and comm(X) ≥ (|X| − 1) · α8: if |X| > 1 then9: Let c0 =

⋃ci∈X ci and for all cj ∈ C\X set w0j =

∑ci∈X wij .

10: Let c ∈ X be the component having the largest reserved space.11: if reserved(c) ≥ vol(X)− |c| then12: Migrate c0 to the cluster hosting c13: Update reserved(c0) = reserved(c)− (vol(X)− |c|)14: else15: Migrate c0 to a cluster s with spare(s) ≥ min(k, 2|c0|)16: Set reserved(c0) = min(k − |c0|, |c0|)17: end if18: end if

. End of a Y -epoch.19: Let Y be the smallest components set with vol(Y ) > k and comm(Y ) ≥ vol(Y ) · α20: if Y 6= ∅ then21: Split every ci ∈ Y into ci singleton components and reset the weights of all edges

involving at least one newly created component. Reserve one additional space for eachnewly created component. If necessary, migrate at most vol(Y )/2+1 singletons to clusterswith spare space.

22: end if23: end for

cost per component epoch. Finally, in the Appendix, we show that the competitive ratio isalso bounded with respect to incomplete epochs.

We start by observing that there always exists a cluster which can host the entire mergedcomponent, including the required reserved space without any evacuation, i.e., its spare spaceis at least k.

Property 1. At any point in time, a cluster exists having at least k spare space.

So indeed, REP can always place a merged component greedily into clusters—no globalcomponent rearrangement is necessary. On the other hand, augmenting the cluster size allowsREP to reserve additional space for migrated components. As we show in the following, thisensures that each node is migrated at most log k times (rather than k) during the formationof a component.

Upper bound on REP’s costs. The online algorithm’s cost during each epoch consists ofthe communication cost, which amounts to the number of communication requests that wereserved remotely, and the migration cost, which is equal to the number of node migrations.The following properties provide upper bounds for both kinds of costs for a single component:

Property 2. At any point in time, consider a component c induced by the communicationpattern in this epoch, then:

8

Page 10: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

1. The communication cost between nodes in c is, in this epoch, at most (|c| − 1) · α.

2. The migration cost of nodes in c is, in this epoch, at most (|c| log |c|) · α.

Using Property 2, we can bound the migration and communication cost of a Y -epoch:

Lemma 3. Consider the end of a Y -epoch (Line 19). REP migrates at most∑

ci∈Y |ci| log |ci| ≤vol(Y ) · log k nodes and serves at most 2 vol(Y ) ·α remote requests during this epoch for nodesin Y .

The proof of Lemma 3 follows directly from Property 2 and is omitted.

Lower bound on Off’s cost. Having derived an upper bound on REP’s cost, we nextcompute a lower bound of Off’s cost.

Lemma 4. By the end of a Y -epoch, Off pays at least vol(Y )/k · α communication cost(during this epoch) for nodes in Y .

Before establishing a lower bound on Off’s cost, we will prove two useful properties.

Property 3. Consider any component c in the current epoch and any partition of c into twonon-empty disjoint sets B and W , with B ∪W = c. During the creation of c (by merging),there were at least α communication requests between nodes in B and W .

Proof of Property 3. Consider the tree T which describes how component c merged from sin-gletons into c during the current epoch. The leafs of the tree are the nodes in c and eachinternal node corresponds to a component set X that was found in Line 7 of the algorithm,and entails a merge to a new component c0. Now color the leafs of the tree according to W andB. Since both sets are non-empty there must exist an internal node τ in T , whose descendentleafs in the subtree are colored identically. Let B′ = {b1, b2, . . . , bp} be the child componentsof τ which are in B, and let W ′ = {w1, w2, . . . , wq} be the components which are childrenof τ and which are in W . Let X be the set corresponding to τ and note that X = B′ ∪W ′and |X| = p+ q. Since neither B′ nor W ′ were merged earlier, the total communication costamong B′ resp. W ′ is at most (p− 1)α resp. (q − 1)α. This sums up to at most (p+ q − 2)α.But since X is witnessing a communication cost of (p+ q− 2)α, between the nodes in B andthe nodes in W , there must have occurred at least α communication cost during the currentepoch.

Property 4. Consider any two non-empty disjoint subsets of components U, V ⊂ Y s.t. U ∪V = Y and vol(U) < k (i.e., U ’s components fit in one cluster). The inter-communicationcost between U and V is at least α during the Y -epoch.

Proof of Property 4. The proof follows from the minimality of Y and because no merge in-volving components happened in Y . From the Y -epoch termination condition, we havecomm(Y ) = comm(U) + comm(V ) + inter(U, V ) ≥ vol(Y ) · α, where inter(U, V ) is the inter-communication cost between U and V . Assume for the sake of contradiction that inter(U, V ) <α. Recall that vol(U) ≤ k and, since the components in U have not been merged yet,comm(U) ≤ (|U | − 1) · α ≤ (vol(U) − 1) · α (the equality holds when |U | = 1). We thereforehave

comm(V ) = comm(Y )− comm(U)− inter(U, V ) > vol(Y ) · α− (vol(U)− 1) · α− α = vol(V ) · α.

We get the desired contradiction by distinguishing between two cases: (i) If vol(V ) > k,then V ⊂ Y meets both termination conditions of a component epoch (Line 19), and thus theminimality of set Y is contradicted. (ii) Next, consider that vol(V ) ≤ k and notice that it musthold |V | > 1 (otherwise comm(V ) = 0). Since the components in V have not been mergedyet, comm(V ) ≤ (|V |−1) ·α ≤ (vol(V )−1) ·α ≤ vol(V ) ·α, which is again a contradiction.

9

Page 11: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

Proof of Lemma 4. We now use Properties 3 and 4 to lower bound Off’s cost. First, itfollows from Property 3 that Off cannot gain by splitting any component c ∈ Y betweendifferent clusters (which would only increase its cost). The question is then, how much canOff reduce the inter-communication cost by arranging c ∈ Y more efficiently? Let Jsaved bethe amount of inter-communication Off saved by placing the components in an optimal way.Furthermore, denote by s the number of clusters Off used and by bj ≤ k the number of nodesOff placed in each cluster j = 1, . . . , s. Consider any cluster j. In the best case for Off,each of the bj nodes in the cluster is a singleton component which REP placed in a differentcluster. It follows that Off’s saved cost cannot be greater than (bj − 1) · α: otherwise REPwould have merged bj into a single component. Observe also that, although Off aims to putthe components in as few a possible clusters, by a simple pigeonhole argument, s must be atleast vol(Y )/k. Combining the above, the amount Jpaid Off pays (assuming that no nodewas migrated during the Y -epoch) is

Jpaid ≥ vol(Y ) · α− Jsaved

≥ vol(Y ) · α−s∑j=1

(bj − 1) · α =

vol(Y )−s∑j=1

bj +s∑j=1

1

· α ≥ vol(Y )/k∑j=1

1 =vol(Y )

k· α,

where the last step follows from the fact that∑s

j=1 bj = vol(Y ).It remains to show that Off cannot decrease Jpaid any further by swapping nodes during

the Y -epoch. From Property 4, the nodes in each cluster j communicated at least α timeswith clusters i 6= j. Since any swap that Off performs between two clusters costs at least2α, a swap between the involved clusters can only be beneficial to On. Considering thatthere are at least s ≥ vol(Y )/k clusters, even with migrations, Off’s cost will be at leastvol(Y )/k · α.

Incomplete Component Epochs. So far, we have quantified the cost that REP and Offpay at the end of each epoch. It remains to account for the costs that REP accumulates inincomplete epochs.

First, let us observe that the edge weights w of incomplete epochs in the component graphare naturally bounded: at some point, the edge will cause a merge, or end the epoch. Moreformally, we can divide the edges of the component graph G into two types: light edges andheavy edges. We claim the following:

Property 5. For every edge (ci, cj) in the component graph, at any given time:

1. If |ci|+ |cj | ≤ k (we call this a light edge), the edge has cost at most α.

2. If |ci|+ |cj | > k (we call this a heavy edge), the edge cost is at most (|ci|+ |cj |)α ≤ (2k)α

The claim holds by the definition of REP. If in the first case, the (ci, cj) edge cost waslarger than α, REP would have merged ci and cj into a new component. Similarly, if in thesecond case, the edge (ci, cj) cost was larger than (|ci| + |cj |)α, REP would have ended theepoch.

Let us consider σ at some time t. Recall that at the end of an epoch, we reset all involvededge weights, and charge Off for them. So at time t, we have not taken into account yetthe communication requests that were not reset. For any two nodes u and v, we consider alltheir communication requests since the last time they belonged to the same Y , at the endof a Y -epoch. All these requests belong to what we call the last epoch. Note that σ maynot contain any complete epochs at all. But every request (u, v) ∈ σ must belong to someY -epoch or to the last epoch. Using Property 5 we can claim the following:

Lemma 5. The competitive ratio of REP for communication requests which belong to thelast epoch, is bounded by O(k log k).

10

Page 12: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

References

[1] A. Adamaszek, A. Czumaj, M. Englert, and H. Racke. An O(log k)-competitive algorithmfor generalized caching. In 23rd ACM-SIAM Symp. on Discrete Algorithms (SODA),pages 1681–1689, 2012.

[2] K. Andreev and H. Racke. Balanced graph partitioning. In Proc. 16th Annual ACMSymposium on Parallelism in Algorithms and Architectures (SPAA), 2004.

[3] B. Awerbuch, Y. Bartal, and A. Fiat. Competitive distributed file allocation. Inf. Com-put., 185(1):1–40, Aug. 2003.

[4] N. Bansal, A. Blum, and S. Chawla. Correlation clustering. Mach. Learn., 56(1-3):89–113, June 2004.

[5] Y. Bartal, M. Charikar, and P. Indyk. On page migration and other relaxed task systems.Theoretical Computer Science, 268(1):43–66, 2001. Also appeared in Proc. of the 8thSODA, pages 43–52, 1997.

[6] M. Bienkowski, A. Feldmann, J. Grassler, G. Schaffrath, and S. Schmid. The wide-area virtual service migration problem: A competitive analysis approach. IEEE/ACMTransactions on Networking, 22(1):165–178, 2014.

[7] A. Borodin, N. Linial, and M. E. Saks. An optimal on-line algorithm for metrical tasksystem. Journal of the ACM, 39(4):745–763, 1992. Also appeared in Proc. of the 19thSTOC, pages 373–382, 1987.

[8] M. Brehob, R. J. Enbody, E. Torng, and S. Wagner. On-line restricted caching. Journalof Scheduling, 6(2):149–166, 2003.

[9] N. Buchbinder, S. Chen, and J. Naor. Competitive algorithms for restricted cachingand matroid caching. In Proc. of the 22th European Symp. on Algorithms (ESA), pages209–221, 2014.

[10] C. H. Q. Ding, X. He, H. Zha, M. Gu, and H. D. Simon. A min-max cut algorithm forgraph partitioning and data clustering. In Proc. IEEE International Conference on DataMining (ICDM), pages 107–114, 2001.

[11] L. Epstein, C. Imreh, A. Levin, and J. Nagy-Gyorgy. Online file caching with rejectionpenalties. Algorithmica, 71(2):279–306, 2015.

[12] A. Fiat, R. M. Karp, M. Luby, L. A. McGeoch, D. D. Sleator, and N. E. Young. Com-petitive paging algorithms. Journal of Algorithms, 12(4):685–699, 1991.

[13] A. Fiat, Y. Rabani, and Y. Ravid. Competitive k-server algorithms. J. Comput. Syst.Sci., 48(3):410–428, 1994.

[14] A. Kumar, A. Gupta, and T. Roughgarden. A constant-factor approximation algorithmfor the multicommodity rent-or-buy problem. In Proc. 43rd Symposium on Foundationsof Computer Science (FOCS), 2002.

[15] Z. Lotker, B. Patt-Shamir, and D. Rawitz. Rent, lease or buy: Randomized algorithmsfor multislope ski rental. In Proc. of the 25th Symp. on Theoretical Aspects of ComputerScience (STACS), pages 503–514, 2008.

11

Page 13: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

[16] L. A. McGeoch and D. D. Sleator. A strongly competitive randomized paging algorithm.Algorithmica, 6(6):816–825, 1991.

[17] M. Mendel and S. S. Seiden. Online companion caching. Theoretical Computer Science,324(2–3):183–200, 2004.

[18] P. V. Ramanan, D. J. Brown, C. C. Lee, and D. T. Lee. On-line bin packing in lineartime. Journal of Algorithms, 10(3):305–326, 1989.

[19] S. E. Schaeffer. Graph clustering. Computer Science Review, 1(1):27 – 64, 2007.

[20] S. S. Seiden. On the online bin packing problem. Journal of the ACM, 49(5):640–671,2002.

[21] D. D. Sleator and R. E. Tarjan. Amortized efficiency of list update and paging rules.Communications of the ACM, 28(2):202–208, 1985.

[22] N. E. Young. On-line caching as cache size varies. In Proc. of the 2nd ACM-SIAM Symp.on Discrete Algorithms (SODA), pages 241–250, 1991.

A Deferred Proofs

A.1 Proof of Lemma 2

Consider σ to be a sequence of communication requests, divided into the following phases:For each phase p, the adversary chooses two arbitrary nodes u, v currently located in differentclusters. Then, the adversary generates requests between u and v, i.e., it appends them to therequest sequence σ, until On moves u and v to the same cluster. At this time, the phase ends.We refer to the number of requests issued in phase p by wp. We observe that an algorithmwhich never collocates the nodes cannot have a finite competitive ratio, and hence, phasesand wp are finite. After phase p, the next phase starts, and the adversary issues wp+1 requestsbetween nodes {v, z}: here, z is the (unique) node which was in the same cluster as v at timep − 1. Denote by λ the number of phases in σ and, for simplicity of presentation, let λ beeven.

We observe that the strategy of any online algorithm On can be characterized by its choiceof wp values and that the cost of On for this sequence is On(σ) =

∑λp=1(wp + 2α). To obtain

a closed-form expression on the competitive ratio, one should compare the cost of On to anoptimal offline algorithm. Nevertheless, since our aim is to derive a lower bound, we cancompare On to arbitrary algorithms, not necessarily optimal ones. We will compare On’scost to the following three of offline algorithms: (i) The first algorithm performs no moves

whatsoever and hence pays cost∑λ/2

p=1w2p−1. (ii) The second algorithm moves only in the

first phase, and pays∑λ/2

p=1w2p+2α. (iii) The third algorithm moves at the beginning of each

phase, and hence pays∑λ

p=1 2α. In order to minimize the maximal competitive ratio againstany of these three offline algorithms, On must choose w = {w1, . . . , wT } conservatively. Let

wodd =∑λ/2p=1 w2p−1

λ/2 and weven =∑λ/2p=1 w2p

λ/2 . Then we have

ρ(On) = minw

∑λp=1(wp + 2α)

min{∑λ/2

p=1w2p−1,∑λ/2

p=1w2p + 2α,∑λ

p=1 2α}

= minweven,wodd

(λ/2)(weven + wodd) + 2αλ

min {(λ/2)weven, (λ/2)wodd + 2α, 2αλ},

12

Page 14: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

Dividing by λ/2, we find

ρ(On) = minweven,wodd

weven + wodd + 4α

min {weven, wodd + 4α/λ, 4α}≥ 3− λ−1

and the minimum is achieved for weven = 4α and wodd = 4α (1− λ−1). The claim follows bynoticing that after λ phases, |σ| = 4α (2λ− 1) requests have been issued.

A.2 Proof of Theorem 1

Given a deterministic online algorithm On, we specify an initial and a final node partition-ing, as well as a sequence of requests σ divided into phases. Set ` = 2 and name nodes

as u1, u2, . . . , uk and v1, v2, . . . , vk. Initially, the adversary places the nodes as P(start)1 =

{v1, u2, . . . , uk} and P(start)2 = {u1, v2, . . . , vk}, respectively. In our setting, Off can per-

form a single swap to reach the final partitioning P(final)1 = {u1, u2, . . . , uk} and P

(final)2 =

{v1, v2, . . . , vk}.The basic idea is to force On to perform at least k − 1 swaps before reaching the final

partitioning. The sequence of requests σ is defined in terms of phases, indexed by 1 ≤ p ≤ k−1.Phase p involves requests between u1, u2, . . . up+1 in a round robin manner, with the firstrequest being {up, up+1}, the second {up−1, up+1}, and so on. The phase ends when Onperforms at least one swap, and all nodes u1, u2, . . . up+1 are in the same cluster. We observethat any online algorithm with a finite competitive ratio eventually must perform these swaps.

Let wp denote the number or requests (i. e., On’s waiting time) in phase p. It can easily beshown that any online algorithm with finite wp has the following properties at the end of anyphase p < k: (i) Nodes u1, u2, . . . up+1 are in the same cluster, whereas nodes ui with i > p+1have not been involved in any communication request so far. (ii) Node up+2 is not in the samecluster as u1, u2, . . . , up+1. The first property follows by construction. The second propertyfollows from the fact that, during phase p, On had to swap nodes that never communicated.We can therefore assume w. l. o. g. that On swapped up+2 (unless it was already on the othercluster). Since all phases end with the above properties, the best strategy for On is to reachthe next phase with a minimum number of swaps, i. e., using a single swap.

We have so far established that in the best case, On reaches the final partitioning afterk − 1 phases, each involving one swap. Next we consider the number of requests wp Onserved remotely during each phase p. To begin with, one can directly deduce that wp ≥ 1:any online algorithm that swaps before receiving at least one request has an unboundedcompetitive ratio. To force On to serve at least 2α remote requests during the first phase,we enhance the adversary’s strategy as follows: If w1 < 2α the adversary (i) changes the final

partitioning to be C(end)1 = {v1, u2, . . . , uk}, C

(end)2 = {u1, v2, . . . , vk}, and (ii) does not issue

any requests involving u1 in phases p > 1. On the other hand, if w1 ≥ 2α the adversary’sstrategy remains unchanged. By the same argument used previously, in each phase p, Onplaces nodes u2, . . . up+1 in a different cluster than node up+2, and is again forced to swapk−1 times. On the other hand, depending on w1 ≥ 2α, Off either performs one swap paying2α, or does not swap and pays w1 communication cost. The competitive ratio is therefore

ρ(On) ≥∑k−1

p=1(wp + 2α)

min{w1, 2α}≥ 2α (k − 1)

2α+

w1

min{w1, 2α}+

∑k−1p=2 wp

2α≥ k +

k − 2

2α,

matching our claim.

A.3 Proof of Property 2

The two properties are proved in turn.

13

Page 15: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

Property 2.1. We prove this property by induction on the merging sequence, i. e., the sequenceof merges that includes all the nodes in c from the time when they were singletons, orderedby time. To establish the base case, consider the first merge of nodes in c, where X was a setof singletons (Line 7) and |X| singleton components were combined into a new componentc0 = ∪ci∈Xci. By REP’s merging condition, the cost up to this point is equal to (|X|−1) ·α =(|c0| − 1) · α. For the inductive step, consider again that X ′ is merged into c0 and supposethat the communication cost paid for each component c′ ∈ X ′ is (|c′| − 1) · α. After themerge, REP’s total communication cost is equal to (|X ′| − 1) · α +

∑ci∈X′(|ci| − 1) · α =(∑

ci∈X′ |ci|)· α− α = (|c0| − 1) · α and the induction holds.

Property 2.2. First observe that any node u which belongs to c is migrated at most log |c|times during an epoch. To see this, suppose that u was just migrated into a cluster andthat the size of u’s current component is |c′|. From Property 1, we know that u will not bemigrated as a consequence of a merge that does not involve u’s component (i.e., it will neverbe evicted). Furthermore, due to the existence of reserved space, u will stay in the samecluster as long as the size of its current component c′ remains smaller or equal to 2|c′|. Sincethe size of u’s component between any consecutive migrations doubles, the total migrationscan be at most log |c|. This implies the total number of migrations pertaining to all nodes inc is at most |c| log |c|.

A.4 Proof of Lemma 5

Consider for now a scenario where there exists only a last epoch, and let us hence focus onthe case where REP and Off start from the same initial configuration. We analyze the costinduced by the communication graph G, at some time t. We can bound the cost of Off asfollows: Let Off place the components of the graph in a statically optimal way, to minimizethe communication cost between clusters (i.e., a graph G partition).

Clusters. We start by examining the costs pertaining to clusters, while ignoring edgesbetween components (for now). There could be two types of clusters with regard to the initialconfiguration: identical and unidentical clusters. An identical cluster s is a cluster which hasthe same nodes as the initial configuration.

Identical clusters. For any identical cluster s there are two options, either REP touchedcluster s, i.e., REP migrates at least one node in or out from s, or not. If the cluster was nottouched by REP, then Off and REP pay the same cost for this cluster. If REP touchedthe cluster, then Off communication cost is at least α for s. We now bound the cost of REPfor s: recall from Property 2 that for each component c, the cost of migration and internalcommunication of REP for c is at most 2α · (|c| log |c|). Hence, the cost for migration andinternal communication of all components in a cluster is bounded by 2α · (k log k).

Unidentical clusters. Consider a cluster which is unidentical to its initial configuration.The cost incurred by Off on this cluster is at least 2α, since it has to perform at least oneswap to arrange it form the initial configuration. On the other hand, the total cost of REP,over all components in the cluster, is again bounded by 2α · (k log k).

Crossing edges. It remains to bound the cost of the edges between components in G. Weknow that while REP paid the full price

∑ij wij for these edges, Off may have been able

to arrange many edges within the same cluster and avoid their cost. We show next that thiscannot happen. We call an edge between two components (ci, cj) light if |ci| + |cj | ≤ k, andcorrespondingly heavy if |ci|+ |cj | > k.

Light edges. Consider a set of light edges that Off put in the same cluster s. Therecould be two types of components connected to these edges: broken and unbroken ones.A broken component is a component which Off did not place entirely within s, but split

14

Page 16: Online Balanced Repartitioningstefan/repartition.pdf1 Introduction Graph partitioning problems are among the most fundamental problems in theoretical Com-puter Science, see for instance

between multiple clusters. Let B denote the set of broken components. Correspondingly,an unbroken component is a component which is completely within s, and U is the set ofunbroken components. The cost of light edges between unbroken components can be at most|U | − 1 ≤ k − 1, times 2α since, otherwise, U would have been merged by REP to a newcomponent. For each broken component, Property 3 entails a communication cost of at leastα to nodes outside s, which Off must pay. Each of these components can have at most |U |light edges to components in U , entailing a total cost of at most kα.

Heavy edges. If Off puts a heavy edge with k < |ci| + |cj | ≤ 2k into a cluster, it mustsplit either ci or cj among two clusters, which, again by Property 3, incurs communicationcosts of at least α, between the two parts of the divided component. Since this holds for anypartition, any swap made by Off will only increase the lower bound.

Concluding the first part of our proof, the competitive ratio holds as, for every cluster andits components, the ratio is O(k log k). For light edges the ratio is O(k) and for heavy edgesthe ratio is O(k).

Multiple epochs. Finally, we relax the assumption that there is only a last epoch. So far, weassumed that both Off and REP start the last epoch from the same initial configuration. Wefind that, differently from the above, Off now does not necessarily pay for the componentsof touched clusters; it can exploit the migrations induced by previous epochs to rearrangecomponents in an optimal way. Nevertheless, for every difference in the configuration ofREP and Off in the beginning of the last epoch, there must exist a point in the past atwhich Off paid at least α (either because Off performed a migration, or because REPmigrated whereas Off did not). By charging Off half the cost in previous epochs, we cancharge Off at least cost α/2 for every touched cluster during the last epoch. The competitiveratio in Lemma 5 thus also holds here.

15