Approximation Algorithms: Packing Problems
This is the lecture notes from Chandra Chekuri's CS583 course on Approximation Algorithms. Chapter 4: Packing Problems.
You can read Chapter 5: Load Balancing and Bin Packing, here. Chapter 3: Knapsack, here.
Chapter 4
In the previous lecture we discussed the Knapsack problem. In this lecture we discuss other packing and independent set problems. We first discuss an abstract model of packing problems. Let be a finite ground set. A collection of of subsets of is said to be down closed if the following property is true: implies that for all . A down closed collection is also often called and independence system. The sets in are called independent sets. Given an independence family and a non-negative weight function the maximum weight independent set problem is to find . That is, find an independent set in of maximum weight. Often we may be interested in the setting where all weights are in which case we wish to find the maximum cardinality independent set. We discuss some canonical examples.
Example 4.1. Independent sets in graphs: Given a graph
Example 4.2. Matchings in graphs: Given a graph let . Here the ground set is .
Example 4.3. Matroids: A matroid is defined as a system where is down closed and in addition satisfies the following key property: if and then there is an element such that . There are many examples of matroids. We will not go into details here.
Example 4.4. Intersections of independence systems: given some independence systems on the same ground set the system defined by is also an independence system. Well-known examples include intersections of matroids.
4.1 Maximum Independent Set Problem in Graphs
A basic graph optimization problem with many applications is the maximum (weighted) independent set problem ( ) in graphs.
Definition 4.1. Given an undirected graph a subset of nodes is an independent set (stable set) iff there is no edge in between any two nodes in . A subset of nodes is a clique if every pair of nodes in have an edge between them in .
The problem is the following: given a graph find an independent set in of maximum cardinality. In the weighted case, each node has an associated non-negative weight and the goal is to find a maximum weight independent set. This problem is -Hard and it is natural to ask for approximation algorithms. Unfortunately, as the famous theorem below shows, the problem is extremely hard to approximate.
Theorem 4.2 (Håstad [1]). Unless there is no -approximation for for any fixed where is the number of nodes in the given graph.
Remark 4.1. The maximum clique problem is to find the maximum cardinality clique in a given graph. It is approximation-equivalent to the problem; simply complement the graph.
The theorem basically says the following: there are a class of graphs in which the maximum independent set size is either less than or greater than and it is -Complete to decide whether a given graph falls into the former category or the latter.
The lower bound result suggests that one should focus on special cases, and several interesting positive results are known. First, we consider a simple greedy algorithm for the unweighted problem.
- While
is not empty do - A.Let
be a node of minimum degree in - B.
- C.Remove
and its neighbors from - Output
Theorem 4.3. Greedy outputs an independent set such that where is the maximum degree of any node in the graph. Moreover where is the cardinality of the largest independent set. Thus Greedy is a approximation.
Proof. We upper bound the number of nodes in as follows. A node is in because it is removed as a neighbor of some node when Greedy added to . Charge to . A node can be charged at most times since it has at most neighbors. Hence we have that . Since every node is either in or we have and therefore which implies that .
We now argue that . Let be a largest independent set in . As in the above proof we can charge each node in to a node which is a neighbor of . The number of nodes charged to a node is at most . Thus .
Exercise 4.1. Show that Greedy outputs an independent set of size at least where is the average degree of .
Remark 4.2. The well-known Turan's theorem shows via a clever argument that there is always an independent set of size where is the average degree of .
Remark 4.3. For the case of unweighted graphs one can obtain an approximation ratio of where is the average degree. Surprisingly, under a complexity theory conjecture called the Unique-Games conjecture it is known to be -Hard to approximate to within a factor of in graphs with maximum degree when is sufficiently large.
Exercise 4.2. Consider the weigthed problem on graphs of maximum degree . Alter Greedy to sort the nodes in non-increasing order of the weight and show that it gives a -approximation. Can one obtain an -approximation for the weighted case where is the average degree?
LP Relaxation: One can formulate a simple linear-programming relaxation for the (weighted) problem where we have a variable for each node indicating whether is chosen in the independent set or not. We have constraints which state that for each edge only one of or can be chosen.
Although the above is a valid integer programming relaxation of when the variabels are constrained to be in , it is not a particularly useful formulation for the following simple reason.
Claim 4.1.1. For any graph the optimum value of the above LP relaxation is at least . In particular, for the unweighted case it is at least .
Simply set each to !
One can obtain a strengthened formulation below by observing that if is clique in then any independent set can pick at most one node from .
The above linear program has an exponential number of constraints, and it cannot be solved in polynomial time in general, but for some special cases of interest the above linear program can indeed be solved (or approximately solved) in polynomial time and leads to either exact algorithms or good approximation bounds.
Approximability of Vertex Cover and : The following is a basic fact and is easy to prove.
Fact 4.1. In any graph is a vertex cover in if and only if is an independent set in . Thus where is the size of a maximum independent set in and is the size of a minimum vertex cover in .
The above shows that if one of Vertex Cover or is -Hard then the other is as well. We have seen that Vertex Cover admits a -approximation while admits no constant factor approximation. It is useful to see why a -approximation for Vertex Cover does not give any useful information for even though . Suppose is an optimal vertex cover and has size . Then a -approximation algorithm is only guaranteed to give a vertex cover of size ! Hence one does not obtain a non-trivial independent set by complementing the approximate vertex cover.
Some special cases of : We mention some special cases of that have been considered in the literature, this is by no means an exhaustive list.
-
Interval graphs; these are intersection graphs of intervals on a line. An exact algorithm can be obtained via dynamic programming and one can solve more general versions via linear programming methods.
-
Note that a maximum (weight) matching in a graph
can be viewed as a maximum (weight) independent set in the line-graph of and can be solved exactly in polynomial time. This has been extended to what are known as claw-free graphs. -
Planar graphs and generalizations to bounded-genus graphs, and graphs that exclude a fixed minor. For such graphs one can obtain a
due to ideas originally from Brenda Baker. -
Geometric intersection graphs. For example, given
disks on the plane find a maximum number of disks that do not overlap. One could consider other (convex) shapes such as axis parallel rectangles, line segments, pseudo-disks etc. A number of results are known. For example a is known for disks in the plane. An -approximation for axis-parallel rectangles in the plane when the rectangles are weighted and an approximation for the unweighted case. For the unweighted case, very recently, Mitchell obtained a constant factor approximation!
4.1.1 Elimination Orders and MIS
We have seen that a simple Greedy algorithm gives a -approximation for in graphs with max degree . One can also get a approximation for a larger class of -degenerate graphs. To motivate degenerate graphs consider the class of planar graphs. The maximum degree of a planar graph need not be small. Nevertheless, via Euler's theorem, we know that every planar graph has a vertex of degree at most since the maximum number of edges in a planar graph is at most . Moreover, every subgraph of a planar graph is planar, and hence the Greedy algorithm will repeatedly find a vertex of degree at most 5 in each iteration. From this one can show that Greedy gives a -approximation for in planar graphs. Now consider the intersection graph of a collection of intervals on the real line. That is, we are given intervals where each for real numbers . The goal is to find a maximum number of the intervals in the given set of intervals which do not overlap. This is the same as finding in the intersection graph of the intervals - the graph is obtained by creating a vertex for each , and by adding edges if and overlap. It is well-known that greedily picking intervals in earliest finish time order (ordering them according to values) is optimal; the reader should try to prove this. Can one understand the analysis of all these examples in a unified fashion? Yes. For this purpose we consider the class of inductive -independent graphs considered by by Akcoglu et al.[2] and later again by Ye and Borodin[3].
For a vertex in a graph we use denote the neighbors of (not including itself). For a graph and we use to denote the subgraph of induced by .
Definition 4.4. An undirected graph is inductive -independent if there is an ordering of the vertices such that for .
Graphs which are inductively -independent have a perfect elimination ordering and are called chordal graphs because they have an alternate characterization. A graph is chordal iff each cycle in has a chord (an edge connecting two nodes of which is not an edge of ), or in other words there is no induced cycle of length more than .
Exercise 4.3. Prove that the intersection graph of intervals is chordal.
Exercise 4.4. Prove that if then is inductively -independent. Prove that if is -degenerate then is inductively -independent.
The preceding shows that planar graphs are inductively -independent. In fact, one can show something stronger, that they are inductively -independent. Given a graph one can ask whether there is an algorithm that checks whether is inductively -independent. There is such an algorithm that runs in time [3:1]. A classical result shows how to recognize chordal graphs in linear time. However, most of the useful applications arise by showing that a certain class of graphs are inductively -independent for some small value of . See [3:2] for several examples.
Exercise 4.5. Prove that the Greedy algorithm that considers the vertices in the inductive -independent order gives a -approximation for .
Interestingly one can obtain a -approximation for the maximum weight independent set problem in inductively -independent graphs. The algorithm is simple and runs in linear time but is not obvious. To see this consider the weighted problem for intervals. The standard algorithm to solve this is via dynamic programming. However, one can obtain an optimum solution for all chordal graphs (given the ordering). We refer the reader to [3:3] for the algorithm and proof (originally from [2:1]). Showing a -approximation is easier.
4.2 The efficacy of the Greedy algorithm for a class of Independence Families
The Greedy algorithm can be defined easily for an arbitrary independence system. It iteratively adds the best element to the current independent set while maintaining feasibility. Note that the implementation of the algorithm requires having an oracle to find the best element to add to a current independent set .
- While (TRUE)
- A.Let
- B.If
break - C.
- D.
- Output
Exercise 4.6. Prove that the Greedy algorithm gives a -approximation for the maximum weight matching problem in a general graph. Also prove that this bound is tight even in bipartite graphs. Note that max weight matching can be solved exactly in polynomial time.
Remark 4.4. It is well-known that the Greedy algorithm gives an optimum solution when is a matroid. Kruskal's algorithm for min/max weight spanning tree is a special case of this fact.
It is easy to see that Greedy does poorly for problem in general graphs. A natural question is what properties of enable some reasonable performance guarantee for Greedy. A very general result in this context has been established due to Jenkyn's generalizing several previous results. In order to state the result we set up some notation. Given an independence system we say that a set is a base if it is a maximal independent set. It is well-known that in a matroid all bases have the same cardinality. However this is not true in general independence system.
Definition 4.5. An independence system is a -system if for any two bases . That is, the ratio of the cardinality of a maximum base and the cardinality of a minimum base is at most .
The following theorem is not too difficult but not so obvious either.
Theorem 4.6. Greedy gives a -approximation for the maximum weight independent set problem in a -system.
The above theorem generalizes and unifies several examples that we have seen so far including in bounded degree graphs, matchings, matroids etc. How does one see that a given independence system is indeed a -system for some parameter ? For instance matchings in graphs form a -system. The following simple lemma gives an easy way to argue that a given system is a -system.
Lemma 4.1. Suppose is an independence system with the following property: for any and there is a set such that and . Then is a -system.
We leave the proof of the above as an exercise.
4.3 Randomized Rounding with Alteration for Packing Problems
The purpose of this section to highlight a technique for rounding relaxations for packing problems. We will consider a simple example, namely the maximum weight independent set problem in interval graphs. Recall that we are given intervals with non-negative weights and the goal is to find a maximum weight subset of them which do not overlap. Let and let be the collection of end points of the intervals. We can write a simple relaxation for this problem. For each interval we have a variable to indicate whether is chosen or not. For each point , among all intervals that contain it, at most one can be chosen. These are clique constraints in the underlying interval graph.
Note that it is important to retain the constraint that . Interestingly it is known that the relaxation defines an integer polytope and hence one can solve the integer program by solving the relaxation! This is because the incidence matrix defining the is totally unimodular ( ). We refer the reader to books on combinatorial optimization for further background on this topic. Here we assume that we do not know the integer properties of the . We will round it via a technique that is powerful and generalizes to -Hard variants of the interval scheduling problem among many others.
Suppose we solve the and obtain an optimum fraction solution . We have . How do we round to obtain an integer solution whose value is close to that of ? Suppose we randomly choose with probablility for some . Let be the random set of chosen intervals. Then the expected weight of , by linearity of expectation, is . However, it is highly likely that the random solution is not going to be feasible. Some constraint will be violated. The question is how we can fix or alter to find a subset such that is a feasible solution and the expected value of is not too much smaller than that of . This depends on the independence structure.
Here we illustrate this via the interval problem. Without loss of generality we assume that are sorted by their right end point. In other words the order is a perfect elimination order for the underlying interval graph.
- Let
be an optimum fractional solution - Round each
to independently with probability . Let be rounded solution. - For
down to do - A.If
and ( is feasible) then - Output feasible solution
The algorithm consists of two phases. The first phase is a simple selection phase via independent randomized rounding. The second phase is deterministic and is a greedy pruning step in the reverse elimination order. To analyze the expected value of we consider two binary random variables for each and is if and otherwise. is if and otherwise.
By linearity of expectation,
Claim 4.3.1. .
Via the independent randomized rounding in the algorithm.
Claim 4.3.2. .
How do we analyze ? The random variables are not independent and could be highly correlated even though are independent. For this purpose we try to understand which is the conditional probability that an interval that is chosen in the first step is rejected in the pruning phase. We often would not be able to get an exact estimate of this quantity but we can upper bound it as follows. Here the ordering plays a crucial role. Why would be rejected in the pruning phase? Note that when is considered in the pruning phase, the only intervals that have been considered have their right end points after the right end point of . Let and and intersect at be the potential set of intervals that can cause to be rejected. Recall that the implies the following constraint:
at the point . Let be the event that is rejected in the pruning phase. Let be the event that at least one of the intervals in is selected in the first phase. Note that can happen only if happens. Thus . In general we try to upper bound . In this simple case we have an exact formula for it.
We claim that . One can derive this by showing that subject to is at least . Another way of doing this is via Markov's inequality. Let be the number of intervals from selected in the first phase. . By Markov's inequality . is the event that .
Using the claim,
This allows us to lower bound the expected weight of the solution output by the algorithm, and yields a randomized approximation.
Claim 4.3.3. .
Proof. We have
This type of rounding has applications to a variety of settings - see for applications and the general framework called contention resolution schemes.
4.4 Packing Integer Programs (PIPs)
We can express the Knapsack problem as the following integer program. We scaled the knapsack capacity to without loss of generality.
More generally if have multiple linear constraints on the "items" we obtain the following integer program.
Definition 4.7. A packing integer program ( ) is an integer program of the form where is a non-negative vector and is a matrix with entries in . We call it a if all entries are in .
In some cases it is useful/natural to define the problem as where entries in and are required to rational/integer valued. We can convert it into the above form by dividing each row of by .
When the number of rows of (equivalently the constraints) is small the problem is tractable. It is some times called the -dimensional knapsack and one can obtain a for any fixed constant . However, when is large we observe that can be cast as a special case of . It corresponds exactly to the simple integer/linear program that we saw in the previous section. Therefore the problem is at least as hard to approximate as . Here we show via a clever -rounding idea that one can generalize the notion of bounded-degree to column-sparsity in s and obtain a related approximation. We will then introduce the notion of width of the constraints and show how it allows for improved bounds.
Definition 4.8. A PIP is -column-sparse if the number of non-zero entries in each column of is at most . A PIP has width if .
4.4.1 Randomized Rounding with Alteration for PIPs
We saw that randomized rounding gave an approximation algorithm for the Set Cover problem which is a canonical covering problem. Here we will consider the use of randomized rounding for packing problems. Let be an optimum fractional solution to the natural relaxation of a where we replace the constraint by . Suppose we apply independent randomized rounding where we set to with probability . Let be the resulting integer solution. The expected weight of this solution is exactly which is the solution value. However, may not satisfy the constraints given by . A natural strategy to try to satisfy the constraints is to set to with probability where is some scaling constant. This may help in satisfying the constraints because the scaling creates some room in the constraints; we now have that the expected solution value is , a loss of a factor of . Scaling by itself does not allow us to claim that all constraints are satisfied with good probability. A very useful technique in this context is the technique of alteration; we judiciously fix/alter the rounded solution to force it to satisfy the constraints by setting some of the variables that are in to . The trick is to do this in such a way as to have a handle on the final probability that a variable is set to . We will illustrate this for the Knapsack problem and then generalize the idea to -sparse s. The algorithms we present are from[6]. See for further applications and related problems.
Rounding for Knapsack: Consider the Knapsack problem. It is convenient to think of this in the context of s. So we have where now represents the size of item and the knapsack capacity is is the weight of item. Suppose is a fractional solution. Call an item "big" if and otherwise it is "small". Let be the indices of small items and the indices of the big items. Consider the following rounding algorithm.
- Let
be an optimum fractional solution - Round each
to independently with probability . Let be rounded solution. - If
for exactly one big item - A.For each
set - Else If
or two or more big items are chosen in - A.For each
set - Output feasible solution
In words, the algorithm alters the rounded solution as follows. If exactly one big item is chosen in then the algorithm retains that item and rejects all the other small items. Otherwise, the algorithm rejects all items if two or more big items are chosen in or if the total size of all small items chosen in exceeds the capacity.
The following claim is easy to verify.
Claim 4.4.1. The integer solution is feasible.
Now let us analyze the probability of an item being present in the final solution. Let be the event that , that is the sum of the sizes of the small items chose in exceeds the capacity. Let be the event that at least one big item is chosen in .
Claim 4.4.2. .
Proof. Let be the random variable that measures the sum of the sizes of the small items chosen. We have, by linearity of expectation, that
By Markov's inequality, .
Claim 4.4.3. .
Proof. Since the size of each big item in is at least , we have . Therefore . Event happens if some item is chosen in the random selection. Since is chosen with probability , by the union bound, .
Lemma 4.2. Let be the indicator random variable that is if and otherwise. Then .
Proof. We consider the binary random variable which is if . We have . We write
To lower bound we upper bound the probability , that is, the probability that we reject conditioned on the fact that it is chosen in the random solution .
First consider a big item that is chosen in . Then is rejected iff if another big item is chosen in ; the probability of this can be upper bounded by . If item is small then it is rejected if and only if happens or if a big item is chosen which happens with . In either case
Thus,
One can improve the above analysis to show that .
Theorem 4.9. The randomized algorithm outputs a feasible solution of expected weight at least .
Proof. The expected weight of the output is
where we used the previous lemma to lower bound .
Rounding for -sparse PIPs: We now extend the rounding algorithm and analysis above to -sparse PIPs. Let be a feasible fractional solution to . For a column index we let be the indices of the rows in which has a non-zero entry. Since is column-sparse we have that for . When we have more than one constraint we cannot classify an item/index as big or small since it may be big for some constraints and small for others. We say that is small for constraint if otherwise is big for constraint . Let , and small for be the set of all small columns for and , and small for be the set of all big columns for . Note that is the set of all with .
- Let
be an optimum fractional solution - Round each
to 1 independently with probability . Let be rounded solution. - For
to do - A.If
for exactly one 1. For each and set - B.Else If
or two or more items from are chosen in 1. For each set - Output feasible solution
The algorithm, after picking the random solution , alters it as follows: it applies the previous algorithm's strategy to each constraint separately. Thus an element can be rejected at different constraints . We need to bound the total probability of rejection. As before, the following claim is easy to verify.
Claim 4.4.4. The integer solution is feasible.
Now let us analyze the probability of an item being present in the final solution. Let be the event that , that is the sum of the sizes of the items that are small for in exceed the capacity. Let be the event that at least one big item for is chosen in . The following claims follow from the same reasoning as the ones before with the only change being the scaling factor.
Claim 4.4.5. .
Claim 4.4.6. .
Lemma 4.3. Let be the indicator random variable that is if and otherwise. Then .
Proof. We consider the binary random variable which is if after the randomized rounding. We have . We write
We upper bound the probability , that is, the probability that we reject conditioned on the fact that it is chosen in the random solution . We observe that
We used the fact that and the claims above. Therefore,
The theorem below follows by using the above lemma and linearity of expectation to compare the expected weight of the output of the randomized algorithm with that of the fractional solution.
Theorem 4.10. The randomized algorithm outputs a feasible solution of expected weight at least . There is -approximation for -sparse PIPs.
Larger width helps: We saw during the discussion on the Knapsack problem that if all items are small with respect to the capacity constraint then one can obtain better approximations. For s we defined the width of a given instance as if ; in other words no single item is more than times the capacity of any constraint. One can show using a very similar algorithm and anaylisis as above that the approximation bound improves to for instance with width . Thus if we get a approximation instead of -approximation. More generally when for some sufficiently large constant we can get a -approximation. Thus, in the setting with multiple knapsack constraints, the notion of small with respect to capacities is that in each constraint the size of the item is times the capacity of that constraint.
- Johan Hastad. “Clique is hard to approximate within n/sup 1-/spl epsiv”. In: Proceedings of 37th Conference on Foundations of Computer Science. IEEE. 1996, pp. 627–636. ↩︎
- Moran Feldman, Joseph Seffi Naor, Roy Schwartz, and Justin Ward. “Improved approximations for k-exchange systems”. In: European Symposium on Algorithms. Springer. 2011, pp. 784–798. ↩︎
- Julián Mestre. “Greedy in approximation algorithms”. In: European Symposium on Algorithms. Springer. 2006, pp. 528–539. ↩︎
- Nikhil Bansal, Nitish Korula, Viswanath Nagarajan, and Aravind Srinivasan. “Solving packing integer programs via randomized rounding with alterations”. In: Theory of Computing 8.1 (2012), pp. 533–565. ↩︎
Recommended for you
Group Equivariant Convolutional Networks in Medical Image Analysis
Group Equivariant Convolutional Networks in Medical Image Analysis
This is a brief review of G-CNNs' applications in medical image analysis, including fundamental knowledge of group equivariant convolutional networks, and applications in medical images' classification and segmentation.