Lec 25
Lec 25
Lecture #25
Lecturer: Debmalya Panigrahi Scribe: Nisarg Raval
1 Overview
In this lecture we show how to solve online algorithms using linear programing (LP) and rounding mech-
anism. Specifically, we describe a method to solve online version of the “Set Cover” problem. Since, the
entire input is not known a priori, writing an LP for the problem itself is challenging. We present an LP
based fractional solution with (log m)OPT bounds on cost where OPT is the cost of the optimal solution.
We also give a rounding scheme to construct an integer solution which has at most (log n log m)OPT cost.
#25-1
(a) Competitive Ratio Example. (b) Illustrating cost of Greedy Algorithm.
However, in case of online set cover problem the competitive ratio is polynomial in n (Ω(n)). This can be
shown using a simple example illustrated in Figure 1a. Consider a universe U = {e1 , e2 , . . . en } and a set
system S = {S1 , S2 , ...Sn , Sn+1 } such that ∀i = 1 → n, Si = {ei } and Csi = 1. Also, Sn+1 = U and Csn+1 = 2.
In this case at each step the algorithm will choose the set Si for the new element ei since that is the set with
least cost. This leads to the cost of n. However, the optimal solution is Sn+1 which has cost of only 2.
Lemma 1. In any iteration of the greedy algorithm, the cost (ALGO) increases by at most 1.
Proof. We only increase the value of Xs if ∑S:e∈S Xs < 1. Hence, the change in the cost in one iteration is
∑S:e∈S (Xsnew − Xsold ) = ∑S:e∈S (2Xsold − Xsold ) = ∑S:e∈S Xsold < 1.
Theorem 2. The cost of a fractional solution of the greedy algorithm is at most (log m)OPT .
Proof. Since, in each iteration ALGO is increased by at most 1, we only need to count the number of
iterations taken by the greedy algorithm to compute ALGO. Consider a new element e which belongs to
#25-2
some subsets of S as shown in Figure 1b. The variables Xs corresponding to each of these subsets will be
doubled. In particular, the set Xse will also be doubled, where Xse is the variable corresponding to the subset
Se which in turn is the subset used by the optimal algorithm to cover e. Hence, the algorithm can not have an
iteration where no subset of OPT participate. Therefore, the question is how many iterations a subset S can
participate in? Since, we initialize each subset with 1/m and at each iteration (in which subset participates)
we double its value, a subset can participate in at most log m iterations because it can have value of at max
1. In worst case each subset in OPT participates in log m iterations. Hence, the total number of iterations is
at most (log m)OPT . In other words, ALGO ≤ (log m)OPT .
2.2 Rounding
In this subsection we show how to construct an integer solution from the fractional solution using rounding
technique. In case of offline set cover we perform rounding simply by setting Xs = 1 with probability
Xs∗ (log n) and 0 otherwise [BSN09], where Xs∗ is the fractional optimal solution. However, we can not
apply the same rounding technique in online version because it doesn’t ensure the monotonicity of the
solution. For example, some Xs may rounded to 1 in one iteration and 0 in later iterations. In order to
ensure monotonicity, we need to ensure that once Xs is rounded to 1, in any subsequent iterations it must be
rounded to 1. This can be achieved by monotone rounding scheme with Pr[Xs = 1] = Xs (log n), where Xs
is the boolean variable indicating whether set Xs is picked in the solution or not. The bound on the integer
solution is (log n log m)OPT which can be proved as follows:
E[IntegerSolution] = E[ ∑ Xs ]
S∈S
= ∑ E[Xs ] // by linearity of expectation
S∈S
= ∑ Xs log n
S∈S
≤ (log n log m)OPT
Next, we show with what probability we should perform rounding in every iteration to achieve the
overall probability of Xs (log n). Let X−e +e
s and Xs be the respective values of S before and after e arrives.
Suppose for element e, Xs increases by ∆Xs , then there are two possible cases.
−e −e −e −e
Pr[X+e +e +e
s = 1] = Pr[Xs = 1/Xs = 1]Pr[Xs = 1] + Pr[Xs = 1/Xs = 0]Pr[Xs = 0]
∆Xs log n
= Xs log n + (1 − Xs log n)
1 − Xs log n
= (Xs + ∆Xs ) log n
#25-3
Since, Pr[Xs = 1] = Xs log n, we can show that all elements are covered in integer solution with high
probability using the similar analysis performed in an offline case. The given algorithm is a Monte Carlo
algorithm which can be easily converted into Las Vegas algorithm. The idea is at each step, look at the
elements which are not covered and cover them using greedy approach (select the subset which cover most
uncovered elements with minimum cost).
3 Summary
We introduced online set cover problem and gave an LP based technique to find fractional solution. We
proved (log m)OPT bound on cost of the fractional solution. We also gave monotone rounding scheme to
find an integer solution having cost of at most (log n log m)OPT . It is possible to de-randomized the given
algorithm to find a deterministic algorithm for online set cover problem [BSN09]. The method describe
in this lecture is more general and can be applied to many online problems like Stiner Forest, Metric/Non-
metric Facility Location, Weighted Paging etc.
References
[BSN09] Niv Buchbinder and Joseph (Seffi) Naor. The design of competitive online algorithms via a primal:
Dual approach. Found. Trends Theor. Comput. Sci., 3:93–263, February 2009.
#25-4