


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



bound OPT and k by, respectively, OPT ≥ n/s and k ≤ 2 n/s to obtain k ≤ 2OPT, hence the number of sets selected by the algorithm is at most
k + 2 log(s/2)OPT ≤ 2OPT + 2 log(s/2)OPT = 2 log(s)OPT,
as desired.
for any i > i∗. For the first claim, observe that D[i] ≥ D[i∗] for i ≤ i∗, hence (for i ≤ i∗)
U [i∗] + D[i∗] ≤ 2 D[i∗] ≤ 2 D[i] ≤ 2(U [i] + D[i]),
as desired. Similarly, U [i∗^ + 1] ≤ U [i] for i∗^ < i, hence (for i > i∗)
U [i∗^ + 1] + D[i∗^ + 1] ≤ 2 U [i∗^ + 1] ≤ 2 U [i] ≤ 2(U [i] + D[i]),
again as desired. To summarize, U [i∗] + D[i∗] is within a factor of 2 of mini≤i∗^ U [i] + D[i], while U [i∗^ + 1] + D[i∗^ + 1] is within a factor of 2 of mini>i∗^ U [i] + D[i]. It suffices then to take the minimum of U [i∗] + D[i∗] and U [i∗^ + 1] + D[i∗^ + 1].
If such an i∗^ does not exist, then either U [1] > D[1] or U [n] < D[n]. The analysis above works for either case by just ignoring the “nonsensical half”, and we find that U [1] + D[1] (in the former case) or U [n] + D[n] (in the latter case) are within a factor of 2 of mini U [i] + D[i].
To improve this approximation factor to 1 + 1/x, we perform 2x − 1 binary searches to find indices i∗ k, −x < k < x, such that
U [i∗ k] ≤
x + k x
D[i∗ k], U [i∗ k + 1] ≥
x + k x
D[i∗ k + 1]
for −x < k ≤ 0, and
U [i∗ k] ≤
x x − k
D[i∗ k], U [i∗ k + 1] ≥
x x − k
D[i∗ k + 1]
for 0 ≤ k < x. Clearly this takes time O(x log n). Again, assume for the moment that all such i∗ k’s exist. Now observe that if k = −x + 1 and 1 ≤ i ≤ i∗ k, then
U [i∗ k] + D[i∗ k] ≤
x
D[i∗ k]
x
D[i]
x
(U [i] + D[i]);
while if −x + 1 < k ≤ 0 and i∗ k− 1 < i ≤ i∗ k, then
U [i∗ k] + D[i∗ k] ≤
k x
D[i∗ k]
k x
D[i]
x
D[i] +
x + (k − 1) x
D[i]
x
D[i] + U [i]
x
(U [i] + D[i]).
Thus, for −x < k ≤ 0, U [i∗ k] + D[i∗ k] is within a factor of 1 + 1/x of mini∗ k− 1 <i≤i∗ k U [i] + D[i] (where we set i∗−x = 0). By a similar analysis, we can show that for 0 ≤ k < x, U [i∗ k] + D[i∗ k] is within a factor of 1 + 1/x of mini∗ k ≤i<i∗ k+1 U [i] + D[i] (where we set i∗ x = n + 1). As before, then, it suffices to take the minimum among the sums U [i∗ k] + D[i∗ k] (which takes additional time Θ(x)).
Also, as before, if some of the i∗ k’s do not exist, the analysis above still works by just ignoring those intervals containing a “nonexistent” i∗ k.