• Nenhum resultado encontrado

Algorithm Description and Analysis

No documento Jan Bulánek The Online Labeling Problem (páginas 34-43)

For each k ≥1 we define an algorithmAk. It will be obvious from the definitions that the cost per inserted item is at most 2k−1. The main technical question will be how many itemsAkcan handle. Let us definenk(m) to be the maximum number of items thatAkcan handle in an interval of size at least m(the argumentm need not to be an integer) at cost 2k−1. Our goal is to show thatnk(m)≥ blogk/3(m)c.

First we define algorithm A1. For each successive item yt (t ≥ 1), we identify the open segment S compatible with yt. If it is usable we store yt in the middle cell of the segment. If there is not such segment, we stop since we tried to insert more items thanA1 can handle in the array of a given size. The pseudocode of A1 can be found in Figure 4.1.

22

Algorithm A1(m)

• f0(minU)←−1,f0(maxU)←−m

• t←−1

• Repeat

– ft←−ft−1

– S ←−segment compatible with yt

{Check whether yt can be stored into the array}

– if S is usable

∗ ft(yt)←−middle cell of segment S – else

∗ goto END – t←−t+ 1

• label END

• Output: f1,f2, . . . ,ft−1

Figure 4.1: Pseudocode of Algorithm A1

We analyze the cost of algorithm A1. We never move any inserted item, so the cost per inserted item is 1 which equals 2k−1 (since k = 1). Next we want to lower bound the number of items that can be inserted. The size of the initial open segment ism, so aftert−1 items are inserted every open segment has size at least m/2t−1. Recall we can handle arbitraryyt if this is at least 3. Thus we can insert t items provided thatt−1≤log(m/3) + 1. Son1(m)≥log(m/3) + 1, which is at least log1/3(m) form large enough.

Fork ≥2 we defineAk, which makes use ofAk−1. We initially insert log(k−1)/3(m) items using algorithm Ak−1, which by induction can be done at amortized cost of 2k−3 moves per item. Then we rearrange all of the items so that they are spaced as evenly as possible along the array which increases the amortized cost per item to 2k−2.

Next the algorithm works in rounds. Let oldR denote the set of items inserted prior to round R. Let skR−1 denote the minimal size of the open segments defined by the allocation of oldR at the beginning of the round R of algorithm Ak.

Each round consists of two phases. During the first phase we refer to the open segments defined by the allocation of inserted items at the beginning of the

23

phase as working segments. We will run Ak−1 independently on each working segment. When an item is presented we assign it to the working segment it is compatible with, and insert it into the working segment usingAk−1. We insert at most log(k−1)/3(skR−1) items during the whole roundR. Since each working segment has length at leastskR−1, we are guaranteed that each of the independent copies of Ak−1 successfully inserts all of their assigned items at amortized cost of 2k−3.

After the first phase of each round, there may exist non-inserted items such that their compatible segments are not usable. Thus we need to rearrange inserted items to ensure usable segment for each each non-inserted item. Therefore during the second phase we proceed as follows. We say that inserted item y is old if y∈oldR and we say that it is new otherwise. Let excess of the segment S be the number of old items in it minus the number of new items in it (with respect to a current allocation). First we define S to be a set of disjoint segments such that each segment in S has excess exactly 1, each new item is in exactly one segment of S and the smallest and greatest items of each segment are old. Thus each segment ofS is a concatenation of some working segments. Such set always exists as the whole array has the positive excess. If there are more such sets we choose an arbitrary one. Then we rearrange all segments in S so that the labels of the smallest and greatest items in each segment are preserved and the remaining items in the segment (both old and new) are redistributed as uniformly as possible.

Since the number of rearranged old items in the segments of S is at most the number of new items minus one (recall that the smallest and the greatest items of each segment ofS are not rearranged and the excess of each segment is 1), it gives an additional amortized cost of at least 2 per new item. Thus the total amortized cost of Ak is at most 2k−1 per item.

Therefore to prove Theorem 4.3.1 it only remains to show that nk(m) ≥ logk/3(m). To do this, we first lower bound the minimal size of the working seg- ment at the start of each round R, skR−1. We prove that skR−1 for R ≥ 1 is at least 2−R+1m/(q+ 1), where q= log(k−1)/3(m). ForR = 1 this is obvious from the definition of Ak as prior to first round we insert nk−1(m) items.

To prove it for R > 1 assuming that sR−2 ≥ 2−Rm/(q+ 1), we focus on the second phase of each round. Let S be an arbitrary segment of S and let noldS be the number of old items in it. Obviously its length is at least (noldS −1)·skR−2 as the number of internal old items was noldS −2. But since the number of new items in the segment is exactlynoldS −1 we can infer thatsR−1(noldS2(n−1)·sold kR−2

S −1) which immediately implies thatskR−1 ≥2−R+1m/(q+ 1).

Now we can lower bound the number nk(m) for k > 1. (Recall n1(m) >

log1/3(m).) For k > 1 let us assume that nk−1(n) ≥ log(k−1)/3(m). Let r denote the number of rounds. We have sk0 = q+1mm

2 log(k−1)/3(m). Then the number of 24

items inserted during all rounds is at least

r

X

i=1

ni(sk0)≥

r

X

i=1

log(k−1)/3(ski−1)

r

X

i=1

log(k−1)/3 sk0

2i−1

=

r

X

i=1

log

m 2ilog(k−1)/3(m)

(k−1)/3

=

r

X

i=1

log

m log(k−1)/3(m)

−i

(k−1)/3

≥r

log

m log(k−1)/3(m)

−r

(k−1)/3

.

Let us chose r=√

logm and we obtain plogm

log

m log(k−1)/3(m)

−p logm

(k−1)/3

=

log(2k+1)/6(m) 1−

√logm

logm −k−1 3

log logm logm

(k−1)/3

Recall that k <1/2p

logm/log logm (statement of Theorem 4.3.1). Thus we obtain the lower bound for this expression

log(m)(2k+1)/6 1−

s

log logm logm

!16·q

logm log logm

≥ log(m)(2k+1)/6 1

2e 16

which is for m > 216 greater than log(m)2k/6. Therefore during all rounds ofAk, logk/3(m) items are inserted with an amortized cost 2k −1 per insertion. This implies Theorem 4.3.1.

25

26

Part II

Online Labeling Problem Lower Bounds

5. Introduction

In this part, we present all lower bounds for the online labeling problem known to date. These results prove tight lower bounds for deterministic online labeling algorithms for all array sizes. In addition we provide the first (tight) lower bound for linear size arrays for the case when the universe U is small (recall that for the case |U| < m the online labeling problem is trivial). This result implies that even for small universe size algorithms using arrays of linear size cannot perform asymptotically better than in the case of exponential size universe. Finally we present the first nontrivial lower bound for randomized algorithms, which is tight for arrays of polynomial size. Refer to Table 5.1 for the overview of bounds.

Prior to our results, only little was known about lower bounds for the online la- beling problem. There were only two results: the tight lower bound for polynomial size arrays (which of course applies also for smaller arrays, but provides non-tight bound) by Dietz et al. [13] and another result by Dietz et al. [12], that proves a tight lower bound for a restricted class of online labeling algorithms (so called smooth algorithms) in case of linear size arrays. Both of these results appear also in Ph.D. thesis by Zhang [21], which prior to our work was the most comprehensive source for the problem.

5.1 Overview of Results

Here we briefly describe out results that we present in this part.

In Chapter 6 we present the tight lower bound for deterministic algorithms using arrays of size from nc (c > 1) to 2n. Our proof extends and simplifies the result of Dietz at al. [13] (also in [21]) which is valid only for arrays of polynomial size.

In Chapter 7 we describe the first lower bound for randomized algorithms. In particular, this result is tight for polynomial size arrays. Since this bound is the same (up to a constant factor) as the one presented in Chapter 6 we can infer that at least for polynomial size arrays randomized algorithms are not asymptotically better in expectation than the deterministic ones. As this section uses basic ideas similar to Chapter 6 we advice you to read first Chapter 6 which uses simpler argument and introduces many of the necessary concepts.

The remaining chapters focus on arrays of almost linear size.

In Chapter 8 we present the first tight lower bound for the superlinear (but

“subpolynomial”) arrays. This result also proves the tight lower bounds for linear arrays which makes it seemingly superior to the result in the later Chapter 9.

However, in this result we do not prove the tight bounds for array of size close to 29

Array size (m) Asymptotic bound Note Reference n < m≤2n Θ nlog2(n) log(m−nn )

Chapter 9 m=cn,

constantc > 1 Θ nlog2(n)

1) Chapters 8, 9

m=n1+o(1) Θ

nlog2(n) 1+logm−logn

Chapter 8 m=nC,

constantC > 1 Θ(nlogn) 2) Chapters 6,7 m∈[n1+ω(1), nlog(n)) Ω

nlogn 1+log logm−log logn

3) Chapter 6

m=nΩ(log(n)) Θ

nlogn 1+log logm−log logn

Chapter 6 1) Valid even for the case when the universe U is small.

2) Valid even for randomized algorithms.

3) We do not know a matching upper bound.

Table 5.1: Overview of results of Part II

n and we do not consider the case of small item universe.

Finally in the last Chapter 9, we prove the tight lower bound for linear arrays even in the case of arrays of size ofn (recall that for such arrays we have an upper bound O(nlog3(n))) for arbitrary deterministic algorithms. The previous results by Dietz et al. [12, 21] consider only the restricted class of smooth algorithms.

This restriction makes the construction of an adversary against the algorithms easy (as opposed to the case of arbitrary algorithms), still the rest of their analysis is non-trivial and contains useful ideas which we build on.

In addition this is the first result which considers the case of limited universe of items we insert. This is important question as we already mention that for the universe U of size r < m the online labeling problem is trivial and it is not clear whether a small universe of size comparable tom cannot help one to develop better algorithms. However, we show that for linear size arrays the lower bound is asymptotically the same as for non-limited universe.

Chapter 9 uses similar ideas as Chapter 8, but Chapter 8 is significantly easier to follow, as it proves the lower bound only for the online labeling problem without further limitation. Thus we recommend you to read Chapter 8 prior to Chapter 9.

30

No documento Jan Bulánek The Online Labeling Problem (páginas 34-43)