• Keine Ergebnisse gefunden

Limited Weights

Im Dokument Online Resource Management (Seite 28-32)

= −2tk(1−t)

T(T+ 1) +2tk(T−t+ 1) T(T+ 1)

= 2tk T+ 1.

Finally, by means of this result, the competitive ratiocbecomes c= max

t=1,...,T

tk

E[αt] = tk

2tk T+1

= T + 1 2 , which completes the proof.

2.5 Limited Weights

In this section, we drop the assumption of unit weights and discuss the setting of k-incremental capacity withlimited weights, i.e., we have weights wi ∈ {1, . . . , k}. Let St denote the set of indices of requests accepted by some algorithm in time periodt. Then, the knapsack capacityct in time periodtis now given as ct=ct1+k−P

i∈St1wi and c1=k.

It is reasonable to consider limited weights wi ∈ {1, . . . , k} instead of unlimited weightswi∈N+since the setting with unlimited weights does not allow any competitive online algorithm as shown in the following theorem:

Theorem 2.5.1. There does not exist a competitive algorithm for okic with unlimited weights wi ∈N+.

Proof. For > 0, consider the request sequence σ with requests r1 = (1, , k) and r2 = (2, M, k+ 1)as illustrated in Figure 2.3. In the first time period, requestr1 is offered to any online algorithm and, in order to be competitive, any online algorithm has to accept this request. Otherwise, the adversary offers no further requests and accepts requestr1. In the second time period, request r2 is offered to any online algorithm. The remaining capacity available for the online player is given byc2=c1+k−P

iS1wi =k+k−k=k.

Thus, the online player does not have the capacity to accept requestr2. The offline player

1 2 t

Available Requests

r1 r2

k k+ 1

2k

1 2 t

alg

r1 r1

1 2 t

opt

r2

Figure 2.3: Request sequence with w2> k.

rejects request r1, saves up the capacity and accepts request r2. The competitive ratio is then given by

opt(σ) alg(σ) = M

→ ∞ for M → ∞.

Consequently, there exists no competitive algorithm for okicwith weights wi ∈N+. 2.5.1 Deterministic Online Algorithms

Now, we consider a lower bound for any deterministic algorithm for okic with limited weightswi ∈ {1, . . . , k}. Fork= 1, we have unit weights and the results from Sections 2.3 and 2.4 with k = 1 apply. For k ≥ 2, we show the following lower bound on the competitive ratio of deterministic online algorithms:

Theorem 2.5.2. For k ≥ 2, no deterministic online algorithm for okic with limited weights can achieve a competitive ratio smaller than

T k/(bk2c+1) .

Proof. The proof is analogous to the proof of Theorem 2.3.1. For each time period t= 1, . . . , T −1, the adversary presentst identical requestsrt1, . . . , rtt with

rti = (t, vt, k), v≥1, i= 1, . . . , t,

and, by the same argumentation as in the proof of Theorem 2.3.1, forces the online player to accept one request in each time period in order to be competitive.

In time periodT, the adversary presents

T k/(bk2c+1)

identical requests with valuevT and weight k

2

+ 1. Since the adversary did not accept any request before, he is able to accept all of these requests, whereas the online player is able to accept exactly one of these requests. This leads to a competitive ratio of

opt alg =

T k

bk2c+1

vT

TP1 j=1

vj+vT

$ T k k

2

+ 1

%

for v→ ∞.

Algorithm 4: Greedy algorithm forokic with limited weights.

1 fort= 1, . . . , T do

2 Solve the knapsack problem with all requests ri withdi =tand the available capacity and accept the corresponding requests.

The lower bound given in Theorem 2.5.2 is matched by the competitive ratio of Algorithm 4 for k → ∞, as shown in the following. Note that the running time of Algorithm 4 is only pseudo-polynomial in the encoding length of the problem input as the algorithm has to solve a knapsack problem exactly in each time period. This can be done, for example, by standard dynamic programming approaches (cf., for example, (Martello and Toth, 1990; Kellerer et al., 2004)).

Theorem 2.5.3. Algorithm 4 is 2T−1-competitive forokic with limited weights.

Proof. In each time periodt= 1, . . . , T,opthas at mostt·kunits of capacity available.

Hence, the requests accepted by opt in time period t can be fractionally assigned to t knapsacks of sizek each, such that at most t−1 requests overlap from one knapsack to the next, i.e., at mostt−1 requests are fractionally assigned (cf. Figure 2.4).

0 k 2k 3k 4k (t1)k tk

· · ·

Figure 2.4: Fractional assignment to t knapsacks of size k each. Fractionally assigned requests are shown in grey.

Consequently, removing each of these requests and assigning it to its own additional knapsack yields an integral assignment of the requests accepted byoptin time periodt to at most2t−1knapsacks. Sincealg has at leastkunits of capacity available in time period t, alg obtains at least the value of the most valuable of these 2t−1 knapsacks in period t. Denote by optt the total value of items accepted by optin time period t and byalgt the total value of items accepted byalg in time period t. We then have

opt

Fork→ ∞, the lower bound converges to the competitive ratio of Algorithm 4:

$ T k

2.5.2 Randomized Online Algorithms

Finally, we consider randomized algorithms forokicwith limited weights. By combining several methods used in the previous sections, a lower bound on the competitive ratio of any randomized online algorithm and a competitive randomized online algorithm can be established.

Theorem 2.5.4. ForT ≥2andk∈N+, no randomized algorithm forokicwith limited weights wi∈ {1, . . . , k} can achieve a competitive ratio smaller than T+12 .

Proof. Consider the proof of Theorem 2.3.2. The request sequencesσi consist ofj·k re-quests of the form rj = (j, vj,1) for each j ∈ {1, . . . , i}. We replace these request sequences σi by request sequences consisting of j requests of the formrj = (j, vj, k), for each j ∈ {1, . . . , i}. The remaining proof is then equivalent to the case of k = 1 in the proof of Theorem 2.3.2.

In order to construct a competitive online algorithm forokic with limited weights, we combine the methods used in Algorithm 3 and Algorithm 4:

Algorithm 5:Randomized greedy algorithm forokic with limited weights.

1 fort= 1, . . . , T do

2 With probabilitypt=2/(T−t+2), solve the knapsack problem with all requestsri with di =tand the available capacity and accept the

corresponding requests. With probability1−pt, accept no requests at all.

Theorem 2.5.5. Algorithm 5 is3 (T+1/2)-competitive forokic with limited weights.

Proof. First of all, note that, in each time period, it is advantageous for the adversary to reveal additional invaluable requests with appropriate weights such that the online player uses up all available capacity when solving the knapsack problem. Thus, the expected available capacityEtc in time periodt is given by

Etc= Xt−1

i=1

ikpt−i

i−1Y

j=1

(1−pt−j) +tk

t−1Y

j=1

(1−pj).

See the proof of Theorem 2.4.3 for a detailed explanation. Due to (2.7), we have Etc= 2tk

(T + 1)pt = tk(T−t+ 2)

T+ 1 . (2.12)

Now we apply the same line of argument as in the proof of Theorem 2.5.3, but incorporate the expected available capacity. In each time period t = 1, . . . , T, opt has at most t·k units of capacity available. Hence, the requests accepted by opt in time period t can be fractionally assigned to dtk/Etce knapsacks of size Etc≥keach, such that at most dtk/Etce − 1 requests overlap from one knapsack to the next, i.e., at most dtk/Etce −1

0 Etc 2Etc 3Etc 4Etck l

Figure 2.5: Fractional assignment to dtk/Etce knapsacks of size Etc each. Fractionally assigned requests are shown in grey.

requests are fractionally assigned (cf. Figure 2.5). Consequently, removing each of these requests and assigning it to its own additional knapsack yields an integral assignment of the requests accepted by optin time period tto at most 2dtk/Etce −1knapsacks. Since the expected available capacity of alg in time periodt is given by dtk/Etce,alg obtains at least the value of the most valuable of these2dtk/Etce−1knapsacks in periodt. Denote byoptt the total value of items accepted byoptin time period tand byalgt the total value of items accepted byalg in time period t. We then have

opt

Here, the second inequality holds since, for all1≤t≤T, we have:

pt

Im Dokument Online Resource Management (Seite 28-32)