Approximation Algorithms: Unrelated Machine Scheduling and Generalized Assignment
This is the lecture notes from Chandra Chekuri's CS583 course on Approximation Algorithms. Chapter 6: Unrelated Machine Scheduling and Generalized Assignment.
You can read Chapter 7: Congestion Minimization in Networks, here. Chapter 5: Load Balancing and Bin Packing, here.
Chapter 6
This chapter is based on notes first scribed by Alina Ene.
6.1 Scheduling on Unrelated Parallel Machines
We have a set of jobs, and a set of machines. The processing time of job is on machine . Let be a function that assigns each job to exactly one machine. The makespan of is , where is the total processing time of the jobs that are assigned to machine . In the Scheduling on Unrelated Parallel Machines problem, the goal is to find an assignment of jobs to machines of minimum makespan.
We can write an LP for the problem that is very similar to the routing LP from the previous lecture. For each job and each machine , we have a variable that denotes whether job is assigned to machine . We also have a variable for the makespan. We have a constraint for each job that ensures that the job is assigned to some machine, and we have a constraint for each machine that ensures that the total processing time of jobs assigned to the machines is at most the makespan .
The above LP is very natural, but unfortunately it has unbounded integrality gap. Suppose that we have a single job that has processing time on each of the machines. Clearly, the optimal schedule has makespan . However, the LP can schedule the job to the extend of on each of the machines, i.e., it can set for all , and the makespan of the resulting fractional schedule is only .
To overcome this difficulty, we modify the LP slightly. Suppose we knew that the makespan of the optimal solution is equal to , where is some fixed number. If the processing time of job on machine is greater than , job is not scheduled on machine , and we can strengthen the LP by setting to 0 or equivalently, by removing the variable. More precisely, let . Given a value , we can write the following LP for the problem.
Note that the LP above does not have an objective function. In the following, we are only interested in whether the LP is feasible, i.e, whether there is an assignment that satisfies all the constraints. Also, we can think of as a parameter and as a family of LPs, one for each value of the parameter. A useful observation is that, if is a lower bound on the makespan of the optimal schedule, is feasible and it is a valid relaxation for the Scheduling on Unrelated Parallel Machines problem.
Lemma 6.1. Let be the minimum value of the parameter such that is feasible. We can find in polynomial time.
Proof. For any fixed value of , we can check whether is feasible using a polynomial-time algorithm for solving LPs. Thus we can find using binary search starting with the interval .
In the following, we will show how to round a solution to in order to get a schedule with makespan at most . As we will see shortly, it will help to round a solution to that is a vertex solution.
Let be a vertex solution to . Let be a bipartite graph on the vertex set that has an edge for each variable . We say that job is fractionally set if for some . Let be the set of all jobs that are fractionally set, and let be a bipartite graph on the vertex set that has an edge for each variable ; note that is the induced subgraph of on . As shown in Lemma 6.2, the graph has a matching that matches every job in to a machine, and we will it in the rounding algorithm.
Lemma 6.2. The graph has a matching that matches every job in to a machine.
We are now ready to give the rounding algorithm.
SUPM-Rounding |
Theorem 6.1. Consider the assignment constructed by SUPM-Rounding. Each job is assigned to a machine, and the makespan of the schedule is at most .
Proof. By Lemma 6.2, the matching matches every fractionally set job to a machine and therefore all of the jobs are assigned. After assigning all of the integrally set jobs, the makespan (of the partial schedule) is at most . Since is a matching, each machine receives at most one additional job. Let be a fractionally set job, and suppose that is matched (in ) to machine . Since the pair is in , the processing time is at most , and therefore the total processing time of machine increases by at most after assigning the fractionally set jobs. Therefore the makespan of the final schedule is at most .
Exercise 6.1. Give an example that shows that Theorem 6.1 is tight. That is, give an instance and a vertex solution such that the makespan of the schedule SUPM-Rounding is at least .
Since is a lower bound on the makespan of the optimal schedule, we get the following corollary.
Corollary 6.2. SUPM-Rounding achieves a -approximation.
Now we turn our attention to Lemma 6.2 and some other properties of vertex solutions to . The following can be derived from the rank lemma which is described in Chapter A. Here we give a self-contained proof.
Lemma 6.3. If is feasible, any vertex solution has at most non-zero variables and it sets at least of the jobs integrally.
Proof. Let be a vertex solution to . Let denote the number of pairs in . Note that has variables, one for each pair . If is a vertex solution, it satisfies of the constraints of with equality. The first set of constraints consists of constraints, and the second set of constraints consists of constraints. Therefore at least of the tight constraints are from the third set of constraints, i.e., at least of the variables are set to zero.
We say that job is set fractionally if for some ; job is set integrally if for all . Let and be the set of jobs that are set integrally and fractionally (respectively). Clearly, . Any job that is fractionally set is assigned (fractionally) to at least two machines, i.e., there exist such that and . Therefore there are at least distinct non-zero variables corresponding to jobs that are fractionally set. Additionally, for each job that is integrally set, there is a variable that is non-zero. Thus the number of non-zero variables is at least . Hence and , which give us that is at least .
Definition 6.3. A connected graph is a pseudo-tree if the number of edges is at most the number of vertices. A graph is a pseudo-forest if each of its connected components is a pseudo-tree.
Lemma 6.4. The graph is a pseudo-forest.
Proof. Let be a connected component of . We restrict and to the jobs and machines in to get and . Note that is a feasible solution to . Additionally, is a vertex solution to . If not, is a convex combination of two feasible solutions and to . We can extend and to two solutions and to using the entries of that are not in . By construction, and are feasible solutions to . Additionally, is a convex combination of and , which contradicts the fact that is a vertex solution. Thus is a vertex solution to and, by Lemma 6.3, has at most non-zero variables, where and are the number of jobs and machines in . Thus has vertices and at most edges, and therefore it is a pseudo-tree.
Proof. of Lemma 6.2 Note that each job that is integrally set has degree one in . We remove each integrally set job from ; note that the resulting graph is . Since we removed an equal number of vertices and edges from , it follows that is a pseudo-forest as well. Now we construct a matching as follows.
Note that every job vertex has degree at least 2, since the job is fractionally assigned to at least two machines. Thus all of the leaves (degree-one vertices) of are machines. While has at least one leaf, we add the edge incident to the leaf to the matching and we remove both of its endpoints from the graph. If does not have any leaves, is a collection of vertex-disjoint cycles, since it is a pseudo-forest. Moreover, each cycle has even length, since is bipartite. We construct a perfect matching for each cycle (by taking alternate edges), and we add it to our matching.
Exercise 6.2. (Exercise in [1]) Give a proof of Lemma 6.2 using Hall's theorem.
6.2 Generalized Assignment Problem
The Generalized Assignment problem is a generalization of the Scheduling on Unrelated Parallel Machines problem in which there are costs associated with each job-machine pair, in addition to a processing time. More precisely, we have a set of jobs, a set of machines, and a target . The processing time of job is on machine , and the cost of assigning job to machine is . Let be a function that assigns each job to exactly one machine. The assignment is feasible if its makespan is at most (recall that is part of the input), and its cost is . In the Generalized Assignment problem, the goal is to construct a minimum cost assignment that is feasible, provided that there is a feasible assignment.
Remark 6.1. We could allow each machine to have a different capacity which is more natural in certain settings. However, since values are allowed to depend on we can scale them to ensure that for every without loss of generality.
In the following, we will show that, if there is an assignment of cost and makespan at most , then we can construct a schedule of cost at most and makespan at most . In fact the assignment will have a stronger property that the load on a a machine exceeds due to at most one job.
As before, we let denote the set of all pairs such that . We can generalize the relaxation from the previous section to the following LP.
Since we also need to preserve the costs, we can no longer use the previous rounding; in fact, it is easy to see that the previous rounding is arbitrarily bad for the Generalized Assignment problem. However, we will still look for a matching, but in a slightly different graph.
But before we give the rounding algorithm for the Generalized Assignment problem, we take a small detour into the problem of finding a minimum-cost matching in a bipartite graph. In the Minimum Cost Biparite Matching problem, we are given a bipartite graph with costs on the edges, and we want to construct a minimum cost matching that matches every vertex in , if there is such a matching. For each vertex , let be the set of all edges incident to . We can write the following LP for the problem.
The following is well-known in combinatorial optimization [2].
Theorem 6.4. For any bipartite graph , any vertex solution to BipartiteMatching is an integer solution. Moreover, given a feasible fractional solution , we can find in polynomial time a feasible solution such that is integral and
In the rest of the section we give two different proofs that establish our claimed result. One is based on the first work that gave this result [3], and the other is based on iterative rounding [4].
6.2.1 Shmoys-Tardos Rounding
Let be an optimal vertex solution to GAP-LP. As before, we want to construct a graph that has a matching that matches all jobs. The graph will now have costs on its edges and we want a matching of cost at most . Recall that for Scheduling on Unrelated Parallel Machines we defined a bipartite graph on the vertex set that has an edge for every variable that is non-zero. We can construct the same graph for Generalized Assignment, and we can assign a cost to each edge . If the solution was actually a fractional matching - that is, if was a feasible solution to BipartiteMatching - Theorem 6.4 would give us the desired matching. The solution satisfies the constraints corresponding to vertices , but it does not necessarily satisfy the constraints corresponding vertices , since a machine can be assigned more than one job. To get around this difficulty, we will introduce several nodes representing the same machine, and we will use to construct a fractional matching for the resulting graph.
The fractional solution assigns jobs to machine ; let . We construct a bipartite graph as follows. For each job , we have a node . For each machine , we have nodes . We can think of the nodes as slots on machine . Since now we have multiple slots on each of the machines, we need a fractional assignment that assigns a job to slots on the machines. More precisely, has an entry for each job and each slot that represents the fraction of job that is assigned to the slot. We give the algorithm that constructs from below. Once we have the solution , we add an edge between any job and any machine slot such that is non-zero. Additionally, we assign a cost to each edge of that is equal to .
for |
«pack |
if |
else |
return |
Figure 6.1: Constructing y from x.
When we construct , we consider each machine in turn. Let be the current machine. Recall that we want to ensure that assigns at most one job to each slot; as such, we will think of each slot on machine as a bin with capacity 1 . We "pack" jobs into the bins greedily. We only consider jobs such that is at most ; let denote the number of such jobs. We assume without loss of generality that these are labeled as , and . Informally, when we construct , we consider the jobs in this order. Additionally, we keep track of the bin that has not been filled and the amount of space available on that bin. When we consider job , we try to pack into the current bin: if there is at least space available, i.e., , we pack the entire amount into the current bin; otherwise, we pack as much as we can into the current bin, and we pack the rest into the next bin. (See Figure 1 for an example.)
Lemma 6.5. The solution constructed by GreedyPacking is a feasible solution to BipartiteMatching . Moreover,
Proof. Note that, by construction, . Therefore, for any job , we have
Additionally, since we imposed a capacity of on the bins associated with each slot, it follows that, for any slot ,
Therefore is a feasible solution to BipartiteMatching . Finally,
Theorem 6.4 gives us the following corollary.
Corollary 6.5. The graph has a matching that matches every job and it has cost at most . Moreover, we can find such a matching in polynomial time.
Theorem 6.6. Let . The schedule returned by GAP-Rounding has cost at most and makespan at most .
Proof. By Corollary 6.5, the cost of the schedule is at most . Therefore we only need to upper bound the makespan of the schedule.
Consider a machine . For any slot on machine , let
That is, is the maximum processing time of any pair such that job is assigned (in ) to the slot . It follows that the total processing time of the jobs that assigns to machine is at most .
Since GAP-LP has a variable only for pairs such that is at most , it follows that is at most . We restrict attention to the case when at least two slots are assigned to , for otherwise it is easy to see that the load is atmost . Therefore we only need to show that is at most as well. Consider a slot on machine such that . Recall that we labeled the jobs that are relevant to machine - that is, jobs such that is at most - as such that . Consider a job that is assigned to slot . Since GreedyPacking considers jobs in non-increasing order according to their processing times, the processing time of job is at most the processing time of any job assigned to the slot . Therefore is upper bounded by any convex combination of the processing times of the jobs that are assigned to the slot . Since the slot is full, and thus is at most . It follows that
By construction, , and therefore
Since is a feasible solution to the GAP-LP,
which completes the proof.
6.2.2 Iterative Rounding
Here we describe an alternative proof/algorithm that illustrates the iterative rounding framework that initially came out of Jain's seminal work [5]. Since then it has become a powerful technique in exact and approximation algorithms. We need some additional formalism to describe the algorithm. We will consider the input instance as being specified by a graph where an edge implies that is allowed to be schedule on and has size . It is also important to consider non-uniform capacities on the machines to allow for a recursive (or iterative) algorithm. Thus we will assume that each machine has a capacity . We will assume that for all ; in fact this assumption will not be needed until the very end when we analyze the approximation ratio. It is easy to generalize the LP relaxation for GAP-LP to handle non-uniform capacities and to handle the constraints specified by . We will use the notation and to denote the edges incident to job and machine respectively.
To explain the underlying intuition for iterated rounding approach in the specific context of GAP, consider the situation where each machine has infinite capacity. In this case it is easy to find the minimum cost assignment. We simply assign each job to the machine which is the cheapest one that it is allowed to be assigned to. We also observe that if we drop all the capacity constraints from GAP-LP, and only leave the assignment constraints ( for each ), then the optimum solution of this LP is the same as the one obtained by assigning each job to its cheapest allowed machine (one can also argue that the LP is an integer polytope). Now consider another scenario. Suppose each machine has in-degree at most in - that is, there are only jobs that can ever be assigned to any machine . Now suppose we assign each job to its cheapest allowed machine. Clearly the cost is at most the optimum cost of any feasible solution. But what about the load? Since each machine had in-degree at most we will load a machine to at most . Thus, if we will only violate the machine's load by a factor of . However, this seems to be very restrictive assumption. Now consider a less restrictive scenario where there is one machine such that its in-degree is at most . Then, in the LP relaxation, we can omit the constraint that limits its load since we are guaranteed that at most jobs can be assigned to it (note that we still have the job assignment constraints which only allow a job to be assigned to machines according to the edges of ). Omitting constraints in an iterative fashion by taking advantage of sparsity in the basic feasible solution is the key idea.
To allow dropping of constraints we need some notation. Given an instance of GAP specified by and , we let denote the LP relaxation for GAP where we only impose the load constraints for machines in . In other words we drop the load constraints for . Note that jobs are still allowed to be assigned to machines in .
The key structural lemma that allows for iterated rounding is the following.
Lemma 6.6. Let be a basic feasible solution to . Then one of the following properties holds:
1. There is some such or .
2. There is a machine such that .
3. There is a machine such that deg and .
Proof. Let be a basic feasible solution. If or for some edge we are done. Similarly if there is a machine with we are done. Thus we restrict our attention to the case when is strictly fractional for every edge and for each machine . Note that for each job ; otherwise and in that case for the lone edge incident to . We will prove that the third property holds.
1. |
2. While |
3. Output assignment |
Theorem 6.7. Given an instance of GAP that is feasible and has optimum cost , the algorithm GAP-Iter-Rounding outputs an assignment whose cost is at most and such that each machine has load at most .
The proof is by induction on the number of iterations. Alternatively, it is useful to view the algorithm recursively. We will sketch the proof and leave some of the formal details to the reader (who can also consult [4:1]). We observe that the algorithm makes progress in each iteration via Lemma 6.6. The analysis will consider the four cases that can happen in each iteration: (i) for some (ii) for some (iii) for some and (iv) and for some .
Thus the algorithm terminates in polynomial number of iterations. It is also not hard to see that corresponds to an assignment of jobs to machines.
Observation 6.8. The algorithm terminates and outputs an assignment of jobs to machines, and job is assigned to implies .
Now we prove that the assignment has good properties in terms of the cost and loads.
Lemma 6.7. The cost of the LP solution at the start of each iteration is at most . Hence, at the end of the algorithm the cost of the assignment is at most .
Proof. This is true in the first iteration since and the LP cost is less than that of an optimum integer feasible solution. Now consider an iteration assuming that the precondition holds.
If we remove from and we note that the cost of the LP for the next iteration does not increase since itself is feasible for the residual instance.
If and we add to , we can charge the cost of to what the LP has already paid on the edge , and the solution with removed is feasible to the residual instance obtained by removing job and reducing the capacity of to .
In the other cases we do not change but drop constraints so the LP cost can only decrease in the subsequent iteration.
Now we upper bound the load on each machine .
Lemma 6.8. For each machine . In fact, a stronger property holds: for each , its load at the end of the algorithm is at most or there is a single job assigned to such that removing it reduces the load of to at most .
Proof. The proof is by induction on iterations. We will sketch it. Consider a machine . If in some iteration we remove and the load on any machine does not change. If we add to but for subsequent iterations we reduce by hence we account for the increase in load of .
Thus, the only reason why the load of may exceed is because we drop the load constraint for in some iteration. If we drop it when , then at most one more job can be assigned to and hence its final load can be at most for some . Thus, if for all the load is at most . We can also drop the constraint for when . However, in this case we have the property that for some two jobs and which are the only edges incident to in that iteration. Since was feasible, we also had the constraint that where was the residual capacity of in that iteration. Assume without loss of generality that ; then it follows that . Thus the final load of is at most since both and can be assigned to . But this load is at most . We leave it to the reader to verify the refined property regarding the load claimed in the lemma.
Running time: The algorithm runs in polynomial number of iterations, and in each iteration it requires an optimum basic feasible solution to the . This can be done in polynomial time. We remark that the algorithm is deliberately described in a simple iterative fashion to make the proof easier. One can speed up the algorithm by considering all the cases together in each iteration. Although iterated rounding is a powerful technique, the running time is typically expensive. Finding faster algorithms that achieve similar guarantees is an open area of research.
6.3 Maximization version of GAP
We consider the maximization version which we refer to Max-GAP. We have items and bins (instead of jobs and machines) where is the size of item in bin . Each bin has a capacity and assigning item to bin yields a profit/weight . The goal is to assign items to bins to maximize the weight while not violating any capacities. When we obtain the Knapsack problem.
Multiple Knapsack Problem (MKP): MKP is a special case of Max-GAP in which for all and for all . In other words the item characteristics do not depend on where it is assigned to.
Exercise 6.3. Prove that MKP does not admit an FPTAS even for .
MKP admits a PTAS [6] and even an EPTAS [7]. Simply greedy algorithms that pack bins one by one using an algorithm for Knapsack as a black box yield a and approximation for MKP when the bins are indentical and when the bins are arbitrary [6:1].
In contrast to MKP, Max-GAP does not admit a PTAS. There is an absolute constant such that a approximation implies [6:2]. However, the following is known.
Theorem 6.9. For every fixed there is a PTAS for Max-GAP.
The preceding theorem can be shown by generalizing the ideas behind the PTAS for Knapsack we discussed in an earlier chapter. An interested reader may try to prove this by considering the case of .
A -approximation: There is a simple yet clever way to achieve a -approximation for Max-GAP via the 2-approximation for the min-cost version that we already saw. Recall that for the min-cost version the algorithm output a solution with cost no more than the optimum cost while violating the capacity of each bin by at most one item. We outline how one can use this to obtain a 2-approximation for Max-GAP and leave the details are an exercise to the reader.
-
Reduce the exact maximization version to the exact min-cost version in which all items have to be assigned by adding an extra dummy bin.
-
Use the result for min-cost version to obtain an assignment with weight at least that of the optimum while violating each bin's capacity by at most one item.
-
Use the preceding assignment to find a feasible packing of items that has profit at least
.
For Max-GAP one can use a stronger LP relaxation and obtain a -approximation. We refer the reader to [8] for this result, and also to [9] for connections to submodular function maximization. The latter connection allows one to obtain an extremely simple greedy approximation algorithm that is not obvious to discover.
6.4 Bibilographic Notes
The 2-approximation for unrelated machine scheduling is by Lenstra, Shmoys and Tardos [10]. The same paper showed that unless there is no -approximation for unrelated machine scheduling. Bridging this gap has been a major open problem in scheduling. A special case called restricted assignment problem has been extensively studied in this context; in such instances which means that a job specifies the machines it can be assigned to, but its processing time does not vary among the machines it can be assigned to. The hardness from [10:1] applies to restricted assignement problem as well. Svensson [11] showed that a strengthend form of LP relaxation (called the configuration LP) has an integrality gap better than 2 for restricted assignment problem but so far there is no polynomial time algorithm to actually output an assignment! The best algorithm that beats 2 for this case runs in quasi-polynomial time [12].
As we mentioned Shmoys and Tardos obtained the 2-approximation for GAP. The iterated rounding proof is from [4:2].
The approximability of Max-GAP when is not a fixed constant was studied in [6:3] although a PTAS for fixed was known quite early [13]. The current best approximation ratio is via a configuration LP [8:1]. The precise integrality gap of the configuration LP is an interesting open problem.
- Vijay V Vazirani. Approximation algorithms. Springer Science & Business Media, 2013. ↩︎
- Alexander Schrijver. Combinatorial optimization: polyhedra and efficiency. Vol. 24. Springer Science & Business Media, 2003. ↩︎
- David B Shmoys and Éva Tardos. “An approximation algorithm for the generalized assignment problem”. In: Mathematical programming 62.1 (1993), pp. 461–474. ↩︎
- Kamal Jain. “A factor 2 approximation algorithm for the generalized Steiner network problem”. In: Combinatorica 21.1 (2001), pp. 39–60. ↩︎
- Klaus Jansen. “Parameterized approximation scheme for the multiple knapsack problem”. In: SIAM Journal on Computing 39.4 (2010), pp. 1392– 1412. ↩︎
- Gruia Calinescu, Chandra Chekuri, Martin Pal, and Jan Vondrák. “Maximizing a monotone submodular function subject to a matroid constraint”. In: SIAM Journal on Computing 40.6 (2011), pp. 1740–1766. ↩︎
- Ola Svensson. “Santa claus schedules jobs on unrelated machines”. In: SIAM Journal on Computing 41.5 (2012), pp. 1318–1341. ↩︎
- Klaus Jansen and Lars Rohwedder. “A quasi-polynomial approximation for the restricted assignment problem”. In: International Conference on Integer Programming and Combinatorial Optimization. Springer. 2017, pp. 305–316. ↩︎
- Ashok K Chandra, Daniel S. Hirschberg, and Chak-Kuen Wong. “Approximate algorithms for some generalized knapsack problems”. In: Theoretical Computer Science 3.3 (1976), pp. 293–304. ↩︎
Recommended for you
High Dimension Data Analysis - A tutorial and review for Dimensionality Reduction Techniques
High Dimension Data Analysis - A tutorial and review for Dimensionality Reduction Techniques
This article explains and provides a comparative study of a few techniques for dimensionality reduction. It dives into the mathematical explanation of several feature selection and feature transformation techniques, while also providing the algorithmic representation and implementation of some other techniques. Lastly, it also provides a very brief review of various other works done in this space.