Linear Time Algorithms for Multiple Cluster Scheduling and Multiple Strip Packing
Klaus Jansen, Malin Rau

TL;DR
This paper introduces an optimal linear-time approximation algorithm for multiple cluster scheduling and strip packing problems, improving computational efficiency while maintaining a 2-approximation ratio, and explores practical heuristics with better ratios in specific cases.
Contribution
The authors develop an $O(n)$ time algorithm achieving a 2-approximation for both problems, improving over previous algorithms with much higher running times, and propose practical heuristics with improved ratios for certain instances.
Findings
An $O(n)$ algorithm with a 2-approximation ratio for both problems.
A practical $O(n \log n)$ algorithm with a 9/4-approximation for specific instances.
The approach of scheduling on one cluster then distributing can be applied broadly.
Abstract
We study the Multiple Cluster Scheduling problem and the Multiple Strip Packing problem. For both problems, there is no algorithm with approximation ratio better than unless . In this paper, we present an algorithm with approximation ratio and running time for both problems. While a approximation was known before, the running time of the algorithm is at least in the worst case. Therefore, an algorithm is surprising and the best possible. We archive this result by calling an AEPTAS with approximation guarantee and running time of the form with a constant to schedule the jobs on a single cluster. This schedule is then distributed on the clusters in . Moreover, this distribution technique can be applied to any variant of of Multi Cluster…
| Problem | Ratio | Remarks | Source |
| MCS, MSP | Needs solving of Scheduling on Identical Machines with ratio | [24] | |
| MCS | Worst case running time at least ; can handle clusters with different sizes | [17] | |
| MSP | Worst case running time at least | [2] | |
| MCS, MSP | AFPTAS | Additive constant in , and for large values for | [2] |
| MCS | Fast algorithm that can handle clusters with different sizes | [19] | |
| MCS | Fast algorithm | [3] | |
| MCS | Fast algorithm | [5] | |
| MCS | Fast algorithm; requires | [5] | |
| MCS, MSP | Running time for and for MCS and , for MSP and | This paper | |
| MCS, MSP | AEPTAS | Additive term ; linear in | This paper |
| MCS | Approximation ratio if and if is large | This paper | |
| PTS, SP | AEPTAS | Additive term ; linear in | This paper |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Linear Time Algorithms for Multiple Cluster Scheduling and Multiple Strip Packing ††thanks: Research was supported by German Research Foundation (DFG) project JA 612 /20-1
Klaus Jansen, Malin Rau
Institute of Computer Science, University of Kiel, 24118 Kiel, Germany
{kj,mra}@informatik.uni-kiel.de
Abstract
We study the Multiple Cluster Scheduling problem and the Multiple Strip Packing problem. For both problems, there is no algorithm with approximation ratio better than unless . In this paper, we present an algorithm with approximation ratio and running time for both problems. While a approximation was known before, the running time of the algorithm is at least in the worst case. Therefore, an algorithm is surprising and the best possible. We archive this result by calling an AEPTAS with approximation guarantee and running time of the form with a constant to schedule the jobs on a single cluster. This schedule is then distributed on the clusters in . Moreover, this distribution technique can be applied to any variant of of Multi Cluster Scheduling for which there exists an AEPTAS with additive term .
While the above result is strong from a theoretical point of view, it might not be very practical due to a large hidden constant caused by calling an AEPTAS with a constant as subroutine. Nevertheless, we point out that the general approach of finding first a schedule on one cluster and then distributing it onto the other clusters might come in handy in practical approaches. We demonstrate this by presenting a practical algorithm with running time , with out hidden constants, that is a -approximation for one third of all possible instances, i.e, all instances where the number of clusters is dividable by , and has an approximation ratio of at most for all instances with at least clusters.
MCS Multiple Cluster Scheduling PTS Parallel Task Scheduling MSP Multiple Strip Packing SP Strip Packing
1 Introduction
In this paper, we study two problems Multiple Cluster Scheduling and Multiple Strip Packing. In the optimization problem Multiple Cluster Scheduling (MCS), we are given parallel jobs and clusters. Each cluster consists of identical machines and each job has a processing time as well as a machine requirement . We define the work of a job as and define the work of a set of jobs as . A schedule of the jobs consists of two functions which assigns jobs to starting points and , which assigns jobs to the clusters. The objective is to find a feasible schedule of all the jobs, which minimizes the makespan, i.e., which minimizes . A schedule is feasible if at every time and any Cluster the number of used machines is bounded by , i.e., if for all and . If the number of clusters is bounded by one, the problem is called Parallel Task Scheduling (PTS). Note that we can assume that since otherwise an optimal schedule would place each job alone on a personal cluster and thus the problem is not hard.
The other problem that we consider is a closely related variant of MCS, called Multiple Strip Packing (MSP). The main difference is that the jobs have to be allocated on contiguous machines. In the Problem MSP, we are given rectangular items and strips. Each strip has an infinite height and the same width . Each item has a width and a height . The objective is to find a feasible packing of the items into the strips such that the packing height is minimized. A packing is feasible if all the items are placed overlapping free into the strips. If the number of clusters is bounded by one, the problem is called Strip Packing (SP).
Strip Packing and Parallel Task Scheduling are classical optimization problems and the extension of these problems to multiple strips or clusters comes natural. Furthermore, these problems can be motivated by real world problems. One example, as stated in [24], is the following: In operating systems, MSP arises in the computer grid and server consolidation [18]. In the system supporting server consolidation on many-core chip multi processors, multiple server applications are deployed onto virtual machines. Every virtual machine is allocated several processors and each application might require a number of processors simultaneously. Hence, a virtual machine can be regarded as a cluster and server applications can be represented as parallel tasks. Similarly, in the distributed virtual machines environment, each physical machine can be regarded as a strip while virtual machines are represented as rectangles. It is quite natural to investigate the packing algorithm by minimizing the maximum height of the strips. This is related to the problem of maximizing the throughput, which is commonly used in the area of operating systems.
In this paper, we consider approximation algorithms for MCS and Multiple Strip Packing (MSP). We say an approximation algorithm has an (absolute) approximation ratio , if for each instance of the problem it holds that . If an algorithm has an approximation ratio of , we say its result is an -approximation. A family of algorithms consisting of algorithms with approximation ratio is called polynomial time approximation scheme (PTAS), and a PTAS whose running time is bounded by a polynomial in both the input length and is called fully polynomial (FPTAS). If the running time of a PTAS is bounded by a function of the form , where is an arbitrary function, we say the running time is efficient and call it an efficient PTAS or EPTAS. An algorithm has an asymptotic approximation ratio if there is a constant such that and we denote a polynomial time approximation scheme with respect to the asymptotic approximation ratio as an A(E)PTAS.
Zhuk [26] proved that MCS and MSP cannot be approximated better than unless . There is an algorithm by Ye, Han and Zhang [24] which finds a -approximation to the optimal solution for each instance of MCS or MSP. This algorithm needs to solve an EPTAS for Scheduling On Identical Machines as a subroutine. The algorithm with the best running time for this problem is currently given by [15] and it is bounded by . As a result the running time of the algorithm from Ye, Han and Zhang [24] is bounded by , using [15] and corresponding 2-approximation algorithms for Parallel Task Scheduling , e.g., the List-Scheduling algorithm by Garay and Graham [9], and Strip Packing, e.g., Steinbergs-algorithm [20]. For MCS, the approximation ratio of was improved by Jansen and Trystram [17] to an algorithm with approximation ratio of 2 and it has a worst case running time of since it uses an algorithm with running time with constant as a subroutine. Furthermore, for MSP there is an algorithm by [2] that has a ratio of as well. The worst case running time of this algorithm is of the form as well, for the same reasons.
However, since the worst-case running time for these algorithms with an approximation ratio close to or exactly is so large, work has been done to improve the runtime at the expense of the approximation ratio. There is a faster algorithm by Bougeret et al. [3] which guarantees an approximation ratio of and has a running time of . Note that the Multifit algorithm for Schedulin On Identical Machines has an approximation ratio of and a running time of at most , see [25]. Hence using this algorithm as a subroutine in [24], we find a approximation. In [5] they present an algorithm with approximation ratio with running time . Furthermore, they present a fast algorithm with approximation ratio and the same running time for the case that the job with the largest machine requirement needs less than machines. For MCS and MSP, we present -approximations, where we managed to improve the running time drastically with regard to the -notation.
Theorem 1**:**
There is an algorithm for MCS with approximation ratio and running time if , and running time if .
Theorem 2**:**
There is an algorithm for MSP with approximation ratio and running time if , and running time if .
Note that the running time of these algorithms is the best possible from a theoretical point of view with respect to the -notation for . Since we need to assign a start point to each job, we cannot assume that there is an algorithm for MCS with running time strictly faster than .
To achieve these results, we use as a subroutine an AEPTAS for the optimization problem Parallel Task Scheduling (PTS) and Strip Packing (SP) respectively. PTS is similar to the problem MCS for the special case that only one cluster is given, while Strip Packing (SP) corresponds to MSP where . Regarding PTS, we improved the running time of an algorithm by Jansen [11] and developed an AEPTAS. For Strip Packing (SP), we find an AEPTAS as well. However, the running time depending on is worse than in the AEPTAS for PTS. Note that this algorithm is the first AEPTAS for SP that has an additive term of .
Theorem 3**:**
There is an algorithm for PTS with ratio and running time .
Theorem 4**:**
There is an algorithm for SP with ratio and running time .
This algorithms can be used to find an AEPTAS for MCS and MSP as well by cutting the solution for one cluster or strip into segments of height . The jobs overlapping the cluster borders add further to the approximation ratio resulting in a additional algorithm for MCS with approximation guarantee .
Theorem 5**:**
There are algorithms for MCS and MSP with ratio and running time .
The algorithm from Theorem 1 uses the algorithm from Theorem 3 as a subroutine with a constant value if , if , and otherwise. As a result, the running time of the algorithm can be rather large, while the -notation suggests otherwise since it hides all the constants. Due to this fact, we have developed a truly fast algorithm where the most expensive part is sorting the jobs. However, this improved running time yields a slight loss in the approximation factor.
Theorem 6**:**
There is a fast algorithm for MCS with approximation ratio if , if , and if for some .
Note that the approximation ratio of the algorithm from Theorem 6 is worse than for the cases that and exactly for the case that . However if , the approximation ratio is bounded by , and as well as converge to for .
1.1 Related Work
We repeat and summarize the results for the variant of MCS and MSP studied in this paper in Table 1.
MCS has also been studied for the case that clusters do not need to have the same number of machines. It is still -hard to approximate this problem better than [26]. Furthermore, it was proven in [19] and [21] that the List Schedule even cannot guarantee a constant approximation ratio for this problem.
The first algorithm was presented by Tchernykh et al. [21] and has an approximation ratio of . This ratio was improved to a -approximation by Schwiegelshohn et al. [19], which is given by an online non-clairvoyant algorithm where the processing times are not known beforehand. Later, the algorithm was extended by Tchernykh et al. [22] to the case where jobs have release dates changing the approximation ratio to . Bougeret et al. [4] developed an algorithm with approximation ratio for this case. This algorithm needs the constraint that the largest machine requirement of a job is smaller than the smallest number of machines available in any given cluster. This ratio was improved by Dutot et al. [8] by presenting an algorithm with approximation ratio . The currently best algorithm for this problem matches the lower bound of [17], but has a large running time of .
Organization of this Paper
The algorithm consists of two steps. First, we use an AEPTAS for MCS or MSP to find a schedule on two clusters, one with makespan at most and the other with mackespan at most . This schedule on the two clusters is then distributed onto the clusters using a partitioning technique, as we call it. This partitioning technique is the main accomplishment of this paper and presented in Section 2. The AEPTAS for MCS can be found in Section 3 while the AEPTAS for Multiple Strip Packing can be found in Section 5. In Section 4, we present the algorithm from Theorem 6 that finds an approximation without the need to call the AEPTAS as a subroutine but uses te partitioning technique as well.
2 Partitioning Technique
In this section, we describe the central idea which leads to a linear running time algorithm. Indeed this technique can be used for any problem setting where there is an AEPTAS with approximation ratio for the single cluster version. In this context is the largest occurring size in the minimization dimension, e.g. the maximal processing time or maximal height of the packing.
Instead of scheduling the jobs on clusters, we first schedule them on two clusters and . In a second step, we distribute the scheduled jobs to clusters. In the following, let be the height of an optimal schedule on clusters for a given instance . Since there is a schedule with makespan on clusters, there exists a schedule on one cluster with makespan at most . Assume there is an algorithm Alg which schedules the jobs on two clusters and such that the makespan of is at most and has a makespan of at most . The algorithm mentioned in Theorem 3 is an example of such an algorithm and we will present it in Section 3.
Lemma 1**:**
Let an algorithm Alg be given that schedules the jobs on two clusters and such that the makespan of is at most and has a makespan of at most and which has a running time of . Furthermore, let Alg2 be an algorithm that finds for the single cluster variant a schedule or packing with height at most in time for any given set of jobs .
We can find a schedule on clusters with makespan in operations if and operations if . (Note that , and hence can be handled as a constant)
The case
In the following, we will describe how to distribute a schedule given by Alg to new clusters, and which value we have to choose for in Alg to get the desired approximation ratio of . The partitioning algorithm distinguishes three cases: and for some and chooses the value for dependent on this , such that . In the following, when speaking of a schedule the processing time is on the vertical axis while the machines are displayed on the horizontal axis, see Figure 1.
In the following distributing algorithm, we draw horizontal lines at each multiple of , where is a value which depends on the makespan of the schedule defined by Alg and will be specified dependent on in the later paragraphs. Let and consider the jobs which start at or after and end at or before . We remove these jobs from and schedule them on a new cluster such that they keep their relative position. We say these new clusters have type .
Next, consider the set of jobs cut by the horizontal line at . All these jobs have a processing time of at most and they can be scheduled at the same time without violating the machine constraint. In a new cluster, we can schedule two of these sets of jobs with makespan , by letting the first set of jobs start at [math] and the second set start at . We say, these clusters have type B.
Case 1: .
If , we choose : As a result, the schedule on given by Alg has a makespan of and we define . We partition the given schedule as described above. Since it has a height of , we get clusters of type A, see Figure 1. There are lines at multiples of . Hence, we get clusters of type B. The jobs intersecting the last line can be scheduled on one new cluster with makespan . On this last cluster after the point in time , we schedule the jobs from the Cluster . Remember, the schedule on has a makespan of at most and, hence, the makespan of this last cluster is bounded by as well. In total, we have partitioned the schedule into clusters each with makespan at most .
Case 2: .
If for some , we choose . As a result, the makespan of generated by the algorithm Alg is given by and we define . There are multiples of smaller than , see Figure 2. Above the last multiple of smaller than namely , the schedule has a height of at most left. Hence using the above-described partitioning, we generate clusters of type A. The jobs intersecting the multiples of can be placed into clusters of type B. We have left the jobs above , which can be scheduled in a new cluster with makespan . Last, we place the jobs from cluster on top of the schedule in the new cluster, such that it has a makespan of at most in total. Altogether, we have distributed the given schedule on clusters, such that each of them has a makespan bounded by .
Case 3: .
If , we choose : As a result, the makespan on generated by Alg is bounded by and we define . Thus, there are vertical lines at the multiples of , which are strictly larger than [math] and strictly smaller than , see Figure 3. As a consequence, we construct clusters of type A and clusters of type B. The cluster defines one additional cluster of this new schedule. In total, we have a schedule on clusters with makespan bounded by .
This distribution can be made in steps since we have to relocate each job at most once. Therefore the algorithm has a running time of at most since is a constant of size at least .
The case
To find a distribution for this case, we need to make a stronger assumption to the solution of the algorithm Alg. Namely, we assume that the second cluster has just machines. As a consequence, the total work of the jobs contained on is bounded by .
Let us consider the schedule on cluster with makespan . In the following, we will assume that since otherwise we have and we do not need to reorder the schedule any further. We draw horizontal lines at and at . Next, we define two sets of jobs and . contains all jobs starting before and contains all jobs ending after . Note that since , we have that . Furthermore, and are disjoint if since and therefore . Note that the total work of the jobs is bounded by and, hence, . We distinguish two cases:
Case 4: or .
Let w.l.o.g . We remove all jobs in from the cluster . As a result this cluster has a makespan of . The total work of the jobs contained in combined with the jobs in is at most . Therefore, we can use the algorithm Alg2 (for example the List-Scheduling algorithm by Garay and Graham [9]) to find a schedule with makespan at most . Hence, we can find a schedule on two clusters in at most for this case.
Case 5: and .
Consider the set of jobs scheduled on but not contained in or . Since the total work of the jobs is at most it holds that . Let be the set of jobs scheduled on and be the set of jobs scheduled on . We define and . Clearly, both sets have a total work of at most and therefore . If , these jobs have a total work of at most and are scheduled with the algorithm Alg2 to find a schedule on one cluster with makespan at most .
To this point, we have scheduled all jobs except the ones cut by the line and the jobs cut by the line . We schedule them in the second cluster by starting all the jobs cut by the first line at start point [math] and the second set of jobs at the start point . Note that the partition into the sets can be done in and hence the partitioning step is dominated by the running time of the algorithm Alg2.
In both cases for , we choose and, hence, can bound the running time of the algorithm by .
This concludes the proof of Lemma 1. However, to prove Theorem 1, we need to prove the existence of the algorithm Alg, which finds the schedule on the clusters and . In the next section, we will see one example of such an algorithm.
As Alg2, we can choose Steinbergs-Algorithm [20] in the case of SP. It has a running time that is bounded by . On the other hand for PTS, we can use the algorithm by Garay and Graham [9], which was optimized by Turek et al. [23] to have a running time of .
A direct conclusion of the lemma is the following corollary.
Corollary 1**:**
For all , given a schedule on two clusters and such that the makespan of is at most and has a makespan of at most , we can find a schedule on clusters with makespan at most in at most additional steps.
Instead of using the algorithm in the next section, first, we can try to use any heuristic or other (fast) approximation algorithm. More precisely, we can do the following: Given a schedule by any heuristic, we remove all the jobs that end after the point in time at which the last job is started and place them on the cluster , by starting them all at the same time. The schedule on obviously has a makespan bounded by . Next, we check weather the residual schedule on has a makespan of at most . For example, this can be done by comparing the makespan on to the lower bound on the optimal makespan , where is the set of all jobs with machine requirement larger than . If the makespan is small enough, i.e., if , we will find a -approximation by using the partitioning technique from above. Otherwise, we need to use the algorithm from the next section.
3 An AEPTAS for Parallel Task Scheduling
In this section, we will present an for Parallel Task Scheduling (PTS) with an approximation ratio and running time . We can use this algorithm to find a schedule on the two clusters and needed for the algorithm in Section 2. It is inspired by the algorithm in [11] but contains some improvements. Furthermore, note the fact that in the following algorithm the processing times of the jobs do not have to be integral. Instead, we will discretize them by rounding.
The algorithm works roughly in the following way. The set of jobs is partitioned into large, medium, and small jobs, depending on their processing times. The medium jobs have a small total work and therefore can be scheduled at the end of the schedule using a 3-approximation algorithm without doing too much harm. The large jobs are partitioned into two sets: wide jobs and narrow jobs depending on their machine requirement. There are few large wide jobs which makes it possible to guess their starting times. The narrow jobs are placed with a linear program for which we guess the number of required machines for each occurring processing time at each possible start point of the schedule. After solving this linear program, a few jobs are scheduled fractionally. These jobs have a total number of required machines of at most for any chosen value . Notice that the choice of will affect the running time. We place these jobs on top of the schedule to gain a approximation, or into an extra cluster to find a solution needed for the algorithm in Section 2. The small jobs are scheduled with a linear program. An overview of the algorithm can be found in Section 3.5.
We will now present a more detailed approach. We use an improved rounding strategy for large jobs compared to [11], which enables us to improve the running time. Further, we present a different linear programming approach to schedule the narrow tall jobs.
3.1 Simplify
Let an instance be given. Note that the value is a lower bound on the makespan of the schedule. On the other hand, we know by Turek et al. [23] that is an upper bound on the optimal makespan. We can find in .
Let and be values dependent on . We partition the set of jobs into small , medium , and large ones . Consider the sequence , . By the pigeonhole principle there exists an such that , when defining and . We can find these values for and in . Note that .
Resulting in a loss of at most in the approximation ratio, we can assume that the smallest processing time is at least since adding to each processing time adds at most to the total makespan. Therefore, the largest such that is bounded by and we know . We round the sizes of the jobs by using the following lemma.
Lemma 2** (See [14]):**
At a loss of a factor of at most in the approximation ratio, we can ensure that each job with for some has processing time for and a starting time, which is a multiple of as well.
This rounding can be done in . Afterward, there are at most different processing times between and for each . Therefore, the number of different processing times of large jobs is bounded by since . Further, the number of different processing times for medium jobs is bounded by since the medium jobs have processing times in . Note that the number of different processing times of small jobs is bounded by since the smallest job has processing time . Additionally, there are at most possible starting points for the large jobs. We denote the set of starting points for large jobs as and the set of their processing times as . After this step, we will only consider the rounded processing times and will denote them as for each job .
3.2 Large Jobs
Let be the width of the second cluster and let be a constant dependent on and , which we will specify later on. We say a job is wide if it uses at least machines, and we denote the set of large wide jobs by . Note that large wide jobs have a processing time larger than and need at least machines while the total work of all jobs in is bounded by . Hence, the total number of them is bounded by . Therefore, there are at most possibilities to schedule the jobs in . In the algorithm, we will try each of these options.
In the next step, we deal with the large narrow jobs . Consider an optimal schedule , where we have rounded the processing times of the jobs as described in Lemma 2. For the schedule and each starting time , let be the number of machines used by jobs in that are processed (not only started) at that time, i.e., we define where is the set of jobs , which have both a start point and an endpoint . Note that jobs ending at , i.e., jobs with , are not part of the set .
For each processing time let be the total number of machines used by jobs with this processing time, i.e . Consider the following linear program :
[TABLE]
The variable defines for each start point and each processing time how many machines are used by jobs with processing time starting at . The first inequality ensures that the number of machines required by jobs scheduled at a start point , i.e., jobs from the set , equals the number of used machines in the considered optimal schedule. The second inequality ensures that for each processing time all the jobs are scheduled. Given the considered optimal solution, we generate a solution to this linear program by counting for each starting time and each processing time how many machines are used by jobs with processing time starting at . This linear program has conditions and variables. Since we have conditions, there are at most non zero components in a basic solution and for each there has to be at least one non zero component.
In the algorithm, we guess, (i.e., we try out all the possibilities) which variables are non zero variables in the basic solution. There are at most options. We cannot guess the exact values of the variables in polynomial time. Instead, we guess for each non zero variable the smallest multiple of that is larger than the value of in the basic solution. This can be done in . So to find a schedule for the large jobs , we use at most guesses in total.
Note that this optimistic guessing, i.e., using the rounded up values for , on the one hand ensures that all the narrow large jobs can be scheduled but on the other hand can cause violations to the machine constraints. To prevent this machine violation, the algorithm test for each guess whether the job condition (2) is fulfilled for each processing time. If this is the case, each value of a non-zero component is reduced by . For these down-sized values, the algorithm test the machine constraint (1) for each starting point . Note that the validation whether the constraints are fulfilled is possible in since for each of the constraints, we have to add at most values for each constraint. If both conditions are fulfilled, the algorithm tries to schedule the small jobs, see Subsection 3.3. If the small jobs can be scheduled the guess was feasible.
The actual narrow large jobs from the set are scheduled only once in the final phase of the algorithm. When scheduling the jobs in , we use the reduced guessed values. We greedily fill the jobs into the guessed starting positions , while slicing jobs vertical if they do not fit totally at that starting position (i.e., if the total number of machines required by jobs with processing time starting at is larger than when adding the machine requirement of the currently considered job) and placing the rest of the job at the next starting position for the processing time . We schedule the jobs which cannot be placed at the starting points defined by the values of (because we reduced these values) either on top of the schedule or on the second cluster depending on what is wanted: the algorithm described in Theorem 3 or the algorithm needed for Lemma 1. The total width of these jobs shifted to the end of the schedule or to Cluster is bounded by since there are at most non zero components and before the reduction by all the jobs could be scheduled because the job constraint (2) was fulfilled.
In the described placement of the narrow large jobs, we have introduced at most one fractional job for each non zero variable and it has a width of at most . We remove all these fractional jobs and place them next to the jobs which did not fit. The machine requirement of the removed fractional jobs can be bounded by . Hence, if , we have , and we can schedule all the removed jobs (non-fitting ones and fractional ones) at the same time at the end of the schedule without violating the machine constraint, adding at most to the makespan. On the other hand, if , it follows that , and we can schedule all the removed jobs inside the extra cluster with makespan at most and machine requirement at most . In the algorithm, we choose as needed for the corresponding application. We need at most operations to place the narrow large jobs.
3.3 Small Jobs
We define a layer as the horizontal strip between two consecutive starting points in and say layer is the layer between and . Note that during the processing time of a layer the machine requirement of large jobs will not change since large jobs start and end at multiples of . Let be the number of machines left for small jobs in layer . Note that this number is fixed by the guesses for the large jobs.
We will partition the small jobs into wide and narrow jobs. A small job is wide if it requires at least machines and narrow otherwise. Let be the set of small wide jobs and be the set of small narrow jobs. We will round the machine requirements of the wide jobs using linear grouping, which was first introduced by Fernandez de la Vega [7]. The idea of this technique is to sort all the wide jobs by size and stack them on top of each other, such that the widest job is at the bottom and the narrowest job is at the top, see Figure 5. Let be the total processing time of all the small wide jobs. We will round the machine requirements of the wide jobs to sizes. For this purpose consider the multiples of . We draw a horizontal line at each of these multiples of and define for each job intersected by one of these lines two new jobs, by cutting this job at that line in two parts (for the analysis and description of the rounding; in the algorithm no job will be cut). The jobs between two consecutive lines at and are called jobs of group . For each group , we generate one new job that has processing time and the machine requirement of the widest job in this group. We call this job a size defining job for the group. Let be the set of rounded small wide jobs.
When we round the wide jobs as described, we need operations, since we sort the jobs. However, we do not need to sort the jobs since we are just interested in the size defining job of each group.
Lemma 3**:**
We can generate the rounded jobs in operations.
Proof.
Define for a given job the set and analogously . For each group, we find the size defining job, by using a modified median algorithm with running time . Instead of searching for the th largest job, we search for a job with and for each in . Simply using this modified median algorithm for each group leads to operations.
However, we improve this approach. First, we search for the job with the median machine requirement in . Afterward, we search for the group size of the group containing this job in and the group size above this group (if existing) in as well. The set of jobs, where we do not know the rounded sizes, is now partitioned into two sets containing at most jobs each. We iterate the process on both sets separately until each group size is found.
Since there are at most groups, this search can be done in operations. To see this, we consider the following recurrence equation
[TABLE]
where denotes the number of jobs and denotes the number of values we search for and . To find the job with the median machine requirement and the group sizes of the group containing this item and the group above we need operations and hence there is a with these properties. After the set of jobs is partitioned into two sets such that each set contains at most jobs. The total number of sizes we search for is reduced by at least one since in this step we find one or two of them. However, the values we search for do not have to be distributed evenly to the sets. Therefore, this recurrence equation represents the running time of the described algorithm adequately.
We claim that . We have and hence the claim is true for . For it follows that
[TABLE]
Since in our case we have , this concludes the proof. ∎
Remark 1*.*
If we schedule the rounded jobs fractionally instead of the original jobs , we need to add at most to the makespan of the schedule.
Proof.
Consider an optimal schedule of the original small jobs. We can schedule the new jobs fractionally, by replacing all jobs contained in group by the new job generated for the jobs in the group . The widest rounded job cannot be scheduled instead of the original jobs, because the machine requirement might be too large. We schedule this job at the end of the schedule. This job has a processing time of . We know that since and each wide job needs at least machines to be scheduled. Hence, it holds that . ∎
We say a configuration of wide jobs is a multiset of wide jobs . We say a configuration requires at most machines, if and define . Let be the set of configurations with machine requirement at most , i.e., .
Consider the following linear program .
[TABLE]
The variable defines the processing time of the configuration in layer . The condition (5) ensures that we do not give a too large processing time to the configurations used in Layer , while condition (6) ensures that the processing time of each job is covered. Condition (4) is added to place the rounded jobs inside the extra box. This linear program has conditions and at most variables. If the values are derived from an optimal solution (or are larger than in the corresponding optimal solution), the linear program above has a solution.
To speed up the running time of our algorithm, we do not find a solution to . Instead, we find a solution to a relaxed version of the linear program, where we allow a slightly increased processing time per layer. This linear program is called and is the same as but we replace equation (5) by
[TABLE]
while equation (4) is replaced by
[TABLE]
Lemma 4**:**
If there is a solution to , we can find a basic solution to in operations.
Proof.
To solve this linear program, we translate it to a Max-Min-Resource-Sharing problem and solve it with approximation ratio for such that .
In the Max-Min-Resource-Sharing problem, we are given a nonempty convex compact set , and a vector of non-negative continuous concave functions . The objective is to find the value , where is the vector of dimension with all entries one. In our translation, we define for all , i.e., and
[TABLE]
We use the algorithm by Grigoriades et al. [10] to solve this problem. This algorithm finds an that satisfies . To find this solution a so called approximate block solver () has to be provided, where . has to solve for each the problem
[TABLE]
Intuitively, computes one configuration for each layer, which is added to the solution in the next step of the algorithm.
The above integer program is equivalent to the integer program of the Unbounded Knapsack problem and therefore can be solved approximatively with approximation ratio in operations [12]. The algorithm needs at most steps where it calls the exactly times. Hence the total running time to find is bounded by
[TABLE]
since and
Note that if the linear program has a solution, there exists an with for each . However, we solved the Max-Min-Resource-Sharing problem just approximately, i.e., if there exist such an with , it holds for the calculated that . We scale with and call it . If we have that for at least one , we know that the liner program has no feasible solution and stop. This scaling step extends each layer to and therefore it extends the generated schedule by at most .
Another obstacle why the given solution is not a solution to the linear program , is that the total reserved processing time for a job in could be too large, i.e., it could be that for some . To subduct this surplus, we remove a total processing time of from the configurations for each . By this step, we create at most one more configuration for each job in . The vector changed in this way, from now on called , is a solution to .
Since the algorithm in [10] calls the block solver at most times, the generated solution uses at most configurations in total. We use the algorithm by Beling and Megiddo [1] to find a basic solution with at most non zero components in
[TABLE]
operations. Hence the total running time needed to find the basic solution to is bounded by
[TABLE]
This concludes the prove. ∎
We will find a schedule of the jobs , by placing the configurations into the corresponding layers and greedily filling the jobs into the configurations, see Figure 6. To ensure that each job can be scheduled integrally, we extend each configuration, by , which is the tallest height a small job can have. Since there are at most configurations we extend the schedule by at most . Note that after this extension the size defining job, which might has been cut for the analysis, can be scheduled in the group where it first appears.
To schedule the small jobs, we use the next fit decreasing height (NFDH) algorithm to place them next to the configurations. We can sort the small jobs by height in since there are at most possible processing times.
Note that the total work of the small jobs has to fit next to the configurations. The reason is that the configurations have a total work which equals the total work of the wide jobs. Furthermore after scheduling the large jobs, the total idle time of the machines was at least as large as the total work of the small jobs.
The NFDH algorithm sorts the small jobs by height and places them into shelves starting with the tallest job, see Figure 6. In each shelf there are at most machines which are completely idle since each narrow job requires at most machines. If there would be more idle machines, another job would have fitted in this shelf.
Furthermore, there can be machines that start to idle before the starting time of the next shelf, namely in the moment when a job with a processing time smaller than the first job in this shelf has finished its processing time. Let be the largest processing time in shelf , then the idle time of the machines which start to idle in shelf is bounded by . Therefore in total the processing time of machines starting to idle over all shelves is bounded by while the total idle time of machine being idle during the whole shelf is bounded by . Hence the total work of narrow small jobs that cannot be scheduled next to the configurations, is bounded by . By using NFDH again to schedule these jobs, we add at most to the makespan.
3.4 Medium Jobs
In the last step, we schedule the medium sized jobs. First, we sort them by their processing time. This can be done in since there are at most different processing times between and . Afterward, we use the NFDH algorithm to place the jobs. Hence, we start with the tallest one and place the jobs one by one in shelves. Coffman et al. [6] have shown the following (slightly adapted) Lemma:
Lemma 5** (See [6]):**
For any list ordered by nonincreasing height,
[TABLE]
We know that is bounded by and is bounded by . Therefore, we add at most to the makespan, by scheduling the medium sized jobs this way.
3.5 Summary
Given , and the algorithm can be summarized as follows:
In the first step of the algorithm, we simplify the instance. We define the lower bound and round the processing times such that they are multiples of . Next, we find the correct values for and and partition the jobs into accordingly. Afterward, we round the processing times of all jobs using Lemma 2 and generate . Last, we generate , i.e., we round the machine requirements of the horizontal jobs. 2. 2.
After the simplification steps area done, we start a binary search for the correct size of for the rounded instance. Note that to find the correct value for for the rounded instance, we are only interested in the number of layers needed to place the jobs in . We know that we need at least layer but at most layer. We start our binary search using layers. 3. 3.
Given a number of layers , we try each possibility to schedule using at most this number of layers. For each of these possibilities, we try to solve for with last allowed layer . If is solvable, we save the -solution and the choice for and set the upper bound update accordingly. Otherwise, we try the next choice for . If all the possibilities to schedule these jobs fail, we set and update accordingly. 4. 4.
The binary search part is finished as soon as . When this is the case, we consider the last solution for and the corresponding choice for and . we scale back all the processing times and assign the jobs and to this solution and shift the fractional placed jobs to the top or the extra cluster as described in Section 3.2 and Section 3.3. We schedule the jobs next to the configurations for using the NFDH algorithm. Finally, we schedule the medium sized jobs on top of the schedule using the NFDH algorithm.
In most of the simplification steps, we have some loss in the approximation ratio of size . Since it holds that the algorithm has an approximation ratio of the form . To reach a algorithm the value has to be scaled accordingly. Note that for the sake of simplicity, we did not optimize the above algorithm to guarantee the best possible running time with regard to the added .
The total running time of the algorithm is bounded by
[TABLE]
which concludes the proof of Theorem 3.
Next, we describe how this leads to the algorithm from Theorem 1. As described, we can use this algorithm to find the schedule on the clusters and as needed for the algorithm described in the proof of Lemma 1. Both algorithms combined have the properties of the algorithm needed for the proof of Theorem 1. The algorithm from Lemma 1 will call the above algorithm with if or for the case that . Hence in the worst case the additive constant becomes something like for and for . However, note that the above running time is a worst case running time and that, depending on the instance, we might have rather than , what will reduce the additive constant significantly.
To prove the MCS part of Theorem 5 note that we can use the algorithm described in this section to find a schedule on clusters with ratio in the same running time. Let be the makespan of an optimal schedule on clusters. Consider a solution for an instance of Parallel Task Scheduling generated by the algorithm above. It has a makespan of . Define . We partition the schedule at multiples of , and schedule each job starting between two of these multiples on the same cluster, such that the jobs remain their relative starting positions. Since , each of these parts has a height of at most . This concludes the proof of Theorem 5.
4 A Faster Algorithm for a Practical Number of Jobs
Note that in the algorithm described above, we have a running time of , but the hidden constant can be extremely large. Hence, in practical applications it can be more useful to use an algorithm with running time or , to find an approximation for Parallel Task Scheduling (PTS). For , we use and, hence, a fast algorithm without large hidden constants and approximation ratio would bring an significant improvement for the vast majority of cluster numbers with and being the only exceptions. Even an algorithm with approximation ratio would speed up the algorithm for one third of all the possible instances, namely all the instances where the number of clusters is dividable by three.
To this point, we did not find either of the algorithms, and we leave this as an open question. Instead, we present a fast algorithm with approximation ratio . This algorithm for PTS leads to an algorithm for MCS with approximation ratio for all instances where .
In the description of the following algorithm, we need the concept of an idle machine. A machine is idle at a time if it does not processes any job at that time. Given a point in time the number of idle machines at that time is given by
[TABLE]
and the total idle time up to is defined by
[TABLE]
Lemma 6**:**
There is an algorithm for PTS with approximation guarantee and running time . This schedule can be divided into two clusters and , where the schedule on has a makespan of at most and the makespan of is bounded by .
Proof.
In the following, we describe the steps of the algorithm. The first part of the algorithm is to find a schedule for the jobs with machine requirement larger than . In the second part, we schedule the jobs with machine requirement at most in a best fit manner. This second part depends on one property from the schedule for the jobs with resource requirement larger than , as we will see later. This algorithm uses the following optimized variant of List-Scheduling as described in Turek et al [23]: Starting at time for every endpoint of a job, schedule the widest job that can be started at this point if there is one; otherwise, go to the next endpoint and proceed as before.
The first part of the algorithm can be summarized as follows:
For a given set of jobs , first consider the jobs with and sort them by decreasing size of the machine requirement . 2. 2.
We stack all the jobs with ordered by their machine requirement such that the largest starts at time [math], see Figure 7. 3. 3.
Look at the job with the smallest requirement of machines larger than and place it at the first possible point in the schedule next to the jobs with machine requirement larger than . We call this point in time . 4. 4.
Schedule all the other jobs with machine requirement at least with the optimized List-Schedule starting at . The List-Schedule includes the endpoints of the already scheduled jobs.
Let be the point in time, where the last job ends, which needs more than machines and define to be the first point in time where both jobs scheduled at have ended. Furthermore, let be the last point in the schedule where two jobs are processed and define . Note that at each point in the schedule between and there will be scheduled exactly two jobs with machine requirement in , while between and it can happen that there is no job from this set.
We claim that . If , this is obvious since we never can schedule jobs with machine requirement larger than at the same time. Consider the case that . Between and there will be scheduled two jobs at each point in the processing time. Hence if is larger than there has to be a schedule, where one more of the jobs between this points of time is scheduled below . But since each job is scheduled as early as possible, there can be no such job, which proves the claim.
In the next step, we are going to schedule the residual jobs, which have a machine requirement of at most . In order to schedule these jobs, we might reconstruct the schedule generated so far. This reconstruction is necessary, if the schedule generated so far has a to large amount of idle time on the machines. As a result of this large amount of idle time, we cannot guarantee a small approximation ratio, when scheduling the residual jobs. Furthermore, note that if there are no jobs with machine requirement at most , we do not need to add further steps and have found a schedule with approximation guarantee .
Let be the total processing time before , where only one job is scheduled. This job has to be a job with machine requirement larger than . Let be the total processing time, where just two jobs are scheduled. We will now consider two cases: and . In the first case, we have to reconstruct the schedule found so far, while in the second case this is not necessary.
We can summarize the second part of the algorithm, where we schedule the jobs with machine requirement at most , as follows:
Find and 2. 6.
If , dismantle the schedule and stack all the jobs with machine requirement larger than on top of each other, sorted by machine requirement such that the widest one starts at [math]. Schedule the residual jobs with the modified List-Schedule starting at [math] and using the endpoints of all jobs. 3. 7.
Else if , determine and use the optimized List-Schedule to schedule the remaining starting at while using the endpoints of all scheduled jobs.
In the following, we will argue that the second part of the described algorithm delivers a schedule with approximation guarantee
Case 6: .
In this case, the algorithm performs the following steps: We stack all the jobs with machine requirement larger than on top of each other sorted by decreasing number of required machines. This stack has a height of at most and the last job of this stack is starting before or at . For the remaining jobs, i.e., the jobs with machine requirement at most , we us the the improved List-Schedule algorithm as described in Turek et al. [23]. This means, we go through the schedule from the bottom to the top and look for each end point of jobs , starting with , at the number of idle machines . We search for the widest unscheduled job with and start it at this time, if one exists, and calculate the new number of idle machines at this point in time. If no such job exists, we go to the next end point of a job since the number of idle machines only changes at these points.
We claim that this schedule has a makespan of at most . Let be the last starting point of a job in this schedule. If this point is larger than , the last scheduled job has a machine requirement of at most . By construction of the schedule, this job could not be scheduled at any earlier time. Hence at each time in the schedule before , we use at least machines and therefore . Furthermore, we know that . As a consequence it holds that . Since is the last starting position of all jobs, the makespan of the schedule is bounded by .
On the other hand if , the last starting job can be a job with machine requirement larger than . However, the schedule is then bounded by . Since and it holds that and therefore .
Case 7: .
We now consider the case that . In this scenario, we do not dismantle the given schedule as we do in Case 1. Instead, we use the improved List-Schedule algorithm as described in Turek et al. [23] to schedule the remaining jobs. To prove that the resulting algorithm has an approximation guarantee of , we analyze the total idle time up to the point before we schedule the residual jobs.
Let be an arbitrary point in time before where only one job is scheduled and let be an arbitrary point in time where two jobs are scheduled. Note that since both jobs scheduled at this time have a machine requirement of at least . We differentiate two cases and and claim that in both cases the sum of numbers of idle machines at and is bounded by . As a a consequence of this claim, the average number of idle machines at all of these pairs of points is bounded by and hence, the total idle time up tp the point is bounded by because and at each point the idle time is bounded by .
Case 7.1: .
In the case that , the number of idle machines is bounded by since there is scheduled one job with machine requirement at least and one job with machine requirement at least . On the other hand, is bounded by . Therefore, the sum of free machines on both points is bounded by and hence the average is bounded by .
Case 7.2: .
If , there are two jobs with machine requirement at least scheduled at this point in time and hence . Remember that since at each point in time after the point up to the point there will be two jobs scheduled. Therefore, and the jobs scheduled at did not fit at the time since otherwise they would have been scheduled there. As a consequence, it holds that because the job with the smaller machine requirement scheduled at has a machine requirement of at most . Hence it holds that . Since , we have .
In conclusion, we have in both cases and . Hence the average number of idle machines for each pair of two points and is bounded by . Since and at each point , where two jobs are scheduled, there are at most machines idle, the total idle time below is bounded by . The residual jobs are scheduled by the best fit algorithm in [23]. Let be the first point in time where both jobs scheduled at have ended. Note that after this point in time the number of idle machines is monotonically increasing per time step. Hence, we can use the improved List-Schedule algorithm without constructing any machine conflicts.
To analyze the approximation ratio after adding the residual jobs, let be the last point in the schedule where a job is started. If this job has a width of at most at every time before and after the number of idle machines is at most since otherwise this job would have been started earlier. If this job has a machine requirement larger than it has been started before . In both cases the total idle time up to is bounded by . As a consequence, we have since all jobs start before and . Therefore, the schedule has a makespan of at most .
We have proven that in both cases and the described algorithm produces a schedule with makespan at most . This algorithm has a running time of the form : The sorting of the items is possible in ; each of the values , and can be found in ; and last the optimized List-Schedule can be implemented to be in by organizing the relevant points in time as well as the set of items inside a search tree.
Last, we describe how to partition this schedule into the schedule on the two clusters and as needed for the algorithm in Lemma 1. Note that in all the described cases the additional is added by the last started job. To partition this schedule such that it is scheduled on the two clusters and , we look at the starting time of the last started job. We remove this last started job and all the jobs which end strictly after and place them into the second cluster and leave the rest untouched to be the schedule for . As we noted before the schedule up to has a height of at most . Furthermore, since the last job starts at , all the removed jobs have a total machine requirement of at most , and, hence, we can start them all at the same time. The resulting schedule on has a height of at most . ∎
In the next step, we present the technique to divide this schedule on and to clusters and prove Theorem 6 in this way. The used technique is similar to the technique in Section 2. However, it is no longer possible to partition the schedule into sections of height at most .
4.1 Proof of Theorem 6
In this section, we prove Theorem 6. We start with the schedule given by the algorithm from Lemma 6 and its partition onto the two clusters and . To partition the schedule on onto the different clusters, we differentiate the three cases , and .
Case 8:
In this case, the schedule on has a height of . We partition it into parts of equal height . During this partition step, we cut the schedule times. The jobs intersected by this cut have to be scheduled separately using height . Together with the jobs in , we have sets of jobs with height bounded by and machine requirement bounded by . We schedule these sets pairwise in additional clusters analogously to the clusters of type B in Section 2. In total, we use Clusters and the largest one a has height of at most .
Case 9:
In this case, the schedule on has a height of . We partition the schedule into parts of equal height and one part with a smaller height. On this part, we schedule the jobs from as well. Let . The parts of equal height have a size of and the last part has a height of . It is easy to verify the and hence we have partitioned the complete schedule on . By partitioning the schedule on into these parts, we have cut the schedule times. Therefore, together with the jobs on , we have to schedule parts of height . We schedule on the cluster with current makespan resulting in a schedule of height , (since ). We pair the other parts and schedule them on distinct clusters. In total, we generate cluster and the largest occurring makespan is bounded by .
Case 10:
In this case, the schedule on has a height of . Again, we partition this schedule into parts of equal height and one part with a smaller height. On top of this part, we will schedule two parts with processing time . Let . The first parts of have a height of and the last part has a height of at most . It is easy to verify that and, hence, we have scheduled all parts of . Since , we can schedule two parts with processing time at most on this cluster. We have cut the schedule on exactly times. Together with the jobs from , we have parts with processing time at most we have to schedule inside the other clusters. Since we already have scheduled two of these parts, we pair the residual parts and generate new clusters with makespan at most . In total, we generated clusters and the largest makespan occurring on the clusters is bounded by .
For each of the three cases , , and , we have presented a partitioning strategy which partitions the schedule from clusters and onto clusters such that each cluster has a makespan of at most , or respectively. Hence, we have proven Theorem 6.
5 An AEPTAS for Strip Packing
In this section, we present an algorithm for Strip Packing (SP) with running time proving Theorem 4. It is inspired by the algorithm in [16]. However, we made some improvements to guarantee an efficient running time. In the description of this algorithm, we will assume that .
This algorithm combined with the techniques from Section 2 delivers a 2-approximation algorithm for Multiple Strip Packing (MSP). To prove Theorem 2, we need to place some of the jobs on another strip named , which has a width of at most . We have either for the case or for the case that . In the following description of the algorithm, we proof that the total width of the items placed on top of the packing can be bounded by , and hence it is possible to place them inside the extra cluster instead of at the top of the packing. When interested solely in the AEPTAS the value can be set to .
To find the algorithm for Theorem 5 for the MSP case, we call the algorithm from this section with and cut the resulting schedule with makespan into parts of height , such that the items overlapping the cut stick together with the part below the cut. As a result each part has a height of at most .
5.1 Simplify
Similar as in Section 3, we start with defining an upper and a lower bound for the approximation ratio. Let be the total area of all the items and let be the largest occurring height in . By Steinberg [20], we now that and we define .
In the first step, we partition the items by their size. Other than in the algorithm for Parallel Task Scheduling (PTS), we need a gap between wide and narrow items as well. Hence, we partition the items into large , vertical , horizontal , small and medium sized items for some , see Figure 8.
We will discard the medium sized items and place them at the end of the packing. To make this possible the total area of the medium sized items has to be small. In the next lemma, we show that we can find values for and which guarantee this property.
Lemma 7**:**
Consider the sequence , . There exists an such that when defining and the total area of the medium sized items is bounded by .
Proof.
This Lemma follows by a direct application of the pigeon hole principle. Let be the set of medium sized items when defining and . Each item can appear in at most two of these sets, in the first because its width is between and and in the second, because its height is between and . Assume that all the sets have an area . As a consequence the total area of all these sets is at least , a contradiction since the total area of all the items is bounded by . ∎
Furthermore, it holds that . We define as the maximum number such that . Note that and use for the partitioning of the items. As a consequence, the the area of the medium items is still at most , but the distance between and is reduced, i.e. we have . However, for simplicity of notation, we will write instead of in the following and use respectively.
In the second step, we round the heights of the items. By increasing the packing height by at most , we can round the heights of the items to multiples of , because adding to each processing time lengthens the packing by at most . Hence after this rounding step, we have . Since each item has a height of at most , there are at most different item sizes, and hence, sorting them by height can be done in using Bucket-Sort. Furthermore, the largest such that is bounded by .
In the next step, we scale the instance with . As a result all the items have a height that is one of the integral values and the optimal packing height for this scaled instance is one of the integral values , because for the rounded instance it holds that and the optimal packing height has to be integral since all the item heights are integral. We scale accordingly such that . In the algorithm, we will do a binary search over the packing heights.
In the next step, we use the same geometric rounding as above to round the heights of the items to fewer different sizes using Lemma 2 and loose a factor of at most in the approximation ratio with regard to the scaled instance. Now the items have at most possible different sizes and, without any further loss, we can assume that all large and vertical items start at multiples of . We call the area between two consecutive multiples of a layer and number them starting at zero. To ensue the integrity of the item heights, we scale the instance with before the rounding step and scale accordingly such that . Note that since To this point, we know that with out all the scaling steps it holds that . Hence the number of layers in an optimal solution is at least and at most for .
In the next step, we remove all small and medium sized items from the optimal packing and use a Lemma from [13] which states that we can partition any optimal packing into a constant number of sub areas, such that each subarea contains just one type of item.
Lemma 8** (See [14]):**
We can partition the area into rectangular areas called boxes.
- •
Each large item is contained in its personal box of height and width .
- •
There are at most many boxes containing horizontal items . Each of them has a height of and a width larger than .
- •
There are at most many boxes containing vertical items .
- •
No item in is intersected vertically by any box border, but can be intersected horizontally
- •
No item in is intersected horizontally by any box border, but can be intersected vertically.
- •
Each boxes lower and upper borders are at multiples of
In the algorithm, we cannot try each of these partitions since then the width of the strip would appear linear in the running time. Instead, we are interested in the relative positioning of the large items and the boxes for horizontal items.
5.2 Boxes for horizontal rectangles
The last simplification step is the rounding of widths of the horizontal items. We call the set of generated rounded items .
Lemma 9**:**
We can round the width of the horizontal items to different sizes in at most operations. These rounded items can be placed fractionally instead of the horizontal items and an extra box of height .
Proof.
To round the width of the items, we use a similar technique as for rounding the machine requirements of the small wide jobs in Lemma 3 called geometric grouping. This technique was first introduced by [7] as well. The difference to linear grouping is an additional partitioning step prior to the steps of the linear grouping, as described below.
We first partition the set of horizontal items into the following sets . For each of these sets, we perform the steps of linear grouping with a customized adjustment to the height of the segments per set. For these adjusted heights, we use the fact that it is possible to place at least and at most items from the set next to each other into the strip.
For each , we stack the contained items in order of decreasing width and partition this stack into segments of size , where is the total height of the items in using the original item heights. We define a new job for each segment which has height and width of the widest item intersecting this segment, see Figure 5. The widest item will be placed at the end of the schedule inside a new box. Since we are allowed to place this item fractionally and we can place at least of these fractions next to each other, we need at most additional height to place this item.
To place all the largest rounded items from each set , we introduce a new box for horizontal items. We define the boxes height as . For each , the total width of items from the set is larger than and hence since . Therefore, the height of the introduced box is bounded by . The total number of different item widths is bounded by .
Regrading the running time, as seen above in the proof of Lemma 3, the size defining items can be found in for each set . Therefore, all the sizes can be found in . ∎
In the next step, we show that it is possible to reduce the number of widths for horizontal boxes to be constant depending on . We do this in order to make it possible for the algorithm to guess their sizes in polynomial time.
Lemma 10**:**
Given a partition of the optimal solution into boxes, we can reduce the number of possible width for the boxes to and guarantee that at most of these sizes are used in the partition by exactly boxes each. This rounding step adds at most to the packing height.
Proof.
We reduce the number of box sizes in two steps. First, we reduce the possible number of box sizes, by shrinking the boxes to be a combination of widths of the rounded horizontal items. In the second step, we reduce the number of different box sizes per solution by using a linear grouping step.
Look at one box for horizontal items. We can shift all the horizontal items in this box to the left as much as possible such that all the left borders of the horizontal items are touching either the box border or the right side of another horizontal item. If the left border of the box does not touch the leftmost item, we can move this border to the left until it does. Now the box for horizontal items has a width which is the sum of widths of rounded horizontal items, i.e. . As a result the total number of possible box widths is bounded by .
Given such a set of boxes, we can use linear grouping to reduce the total number of different box widths. Since the optimal packing has a height of at most and each box has a height of and there are at most boxes for horizontal items in each layer, a sorted stack of all the boxes has a total height of at most . We partition the set of boxes such that the the widest boxes are contained in the first set, the next most wide boxes are contained in the second set and so on. As a result, the total height of each set of boxes is bounded by and the set of boxes is partitioned into at most groups. Note that the last group might contain less boxes than . To enforce that after the rounding there are boxes of each width, we assume that the last group has additional boxes with width zero. We round the box widths to the largest box width of the corresponding set. Again the last rounded group of boxes has to be positioned at the end of the packing adding at most to the packing height. ∎
Let be the set of rounded widths of the boxes. Note that can contain less than sizes if there are less than boxes in the partition of the optimal instance. To place the horizontal items, we first guess the set . There are at most possibilities for this set.
After we guessed the set of boxes, we check with a linear program whether all the rounded horizontal items can be placed into the boxes. Similar to the placing of small jobs in Section 3.3, we use configurations to place the horizontal items into the boxes. A configuration of horizontal items is a multiset . Let be the set of all configurations. We say a configuration has width . Let be the set of configurations with width at most , i.e., .
Consider the following linear program .
[TABLE]
The variables represent the height of a configuration inside the boxes of width . The sum of these heights should equal the total height of the boxes having this width, which is ensured by the equation (9). Equation (8) is introduced to represent the extra box for the horizontal items we need due to the rounding of these items. In the other hand each horizontal item should be covered by the configurations, which is ensured by the equation (10).
Similar as for placing the small narrow jobs in Section 3.3, we solve a relaxed version of this linear program called . In this relaxed version, we replace equation (9) by the equation
[TABLE]
and, similarly, we replace the equation (8) by
[TABLE]
Lemma 11**:**
If there is a solution to , we can find a basic solution to in operations.
Proof.
Note that the described linear program and the described configurations are equivalent to the ones for the small narrow jobs. Hence, we can use the algorithm proposed in Lemma 4 to find the desired basic solution. ∎
We call the set of guessed boxes for horizontal items . In the end of the algorithm, we place the configurations inside the boxes and the horizontal items (fractionally) into the configurations similar to the placement of small wide jobs in Section 3.3. A basic solution of the above linear program has at most non zero components. When filling the configurations inside the boxes , we have to cut the configurations at the box borders of boxes with the same size. Hence inside the boxes, we have at most configurations. At each configuration border, we generate fractionally placed horizontal items. However these items all fit next to each other since they are inside one configuration. Hence, we can remove the cut items and shift them up to the top of the packing. This step adds at most to the packing height.
5.3 Positioning containers as well as large and vertical rectangles
In this section, we handle the positioning of the boxes for horizontal items and the placement of large and vertical items. These boxes and items are positioned by guessing the x-coordinate of the lower left corner, which has to be a multiple of . Afterward, we guess the order from left to right in which these items and boxes will appear. The technique described in this section is inspired by the techniques described in [16] Chapter 4.
In the first step, we guess the position of the lower corners of the items and boxes in and . Note that since the boxes have an area of at least and the large items have an area of at least and the packing has an area of at most , there are at most boxes and items. Hence, the total number of possible guesses for positions of their bottom edges is bounded by .
Consider an optimal packing where all the items are rounded and the horizontal items are positioned in the rounded boxes. For each large item or box , we can determine the value of the -coordinates of their left and right borders and . Let be the set of all these -coordinates and . We order by value of the coordinates in the optimal packing. This gives us a permutation from the left and right corners of items and boxes to positions in the ordered list. Since the value of is not logarithmically bounded in the input size, we cannot guess the values of the -coordinates in polynomial time. However, it is possible to guess the correct permutation in guesses. For a given item or box , we write to refer to the position of and analogously for the position of and write to refer to the -coordinate which is mapped to position in the ordered list.
After these two guesses, the guess of the positions of lower borders and the guess of order of the items, the algorithm tests if this guess was feasible, by testing if it is possible at all to position the items as forced by this guess. This can be done in by starting with the left most item and position the items one by one in order of the -coordinates as most to the left as possible by the constraints guessed. As soon as a constraint has to be violated, we stop and discard the guess. Possible violations of the constraints can be, e.g., that an items left border has to be placed between a left and a right border of another item but this item and the to be placed item overlap the same horizontal line that an item has to be placed such that it overlaps the right border of the strip that .
Consider a feasible guess of starting positions and permutation. The next step of the algorithm is to find values for the -coordinates of the left and right borders. It determines these values by using a linear program as described below. Indeed, since the vertical items have to be placed correctly as well, the linear program is not only concerned about determining the -coordinates, but to place the vertical items as well. Consider two consecutive -coordinates and and the segments of the layers between these. Some of them are occupied by an item or a box in and some are not. We will use the not occupied layers to place the vertical items. We scan the area between and from bottom to top and fuse each set of contiguous unoccupied layers to a box for vertical items. Let be the set of constructed boxes for the area between the coordinates and . Note that there can be at most of them.
Similar as for the horizontal items, we define configurations for the vertical items. However instead of placing these items next to each other, we will stack the items inside a configuration for vertical items on top of each other. Note that in each optimal packing a vertical line through the packing intersects at most of these items and hence configurations should contain at most this number of items. We define a new set of vertical items called . For each appearing item height , the set contains one job of height and width . To reduce the running time, we will schedule the jobs in the set fractionally instead of the original vertical items. Note that due to the rounding of the vertical items.
A configuration for vertical items is a multiset such that and we define its height as . Let be the set of all these configurations and let be the set of all configurations with height at most . These configurations for vertical items are combined to hyper configurations which represent the distribution of vertical items in a vertical line through the packing. For each segment between two coordinates and , we define a configuration as a tuple of configurations, such that there is exactly one configuration for each of the boxes in , i.e., . Let be the set of all configurations for the section between the coordinates and . We define at the number of appearances of item inside the configuration . Note that the configurations for the boxes each have a maximum amount of vertical items they can contain and the sum of these numbers is bounded by . Hence the total number of different configurations in is bounded by . To find fitting values for the -coordinates the algorithm solves the following linear program:
[TABLE]
In this linear program there are three types of variables: , and . The variables for represent the values of the -coordinates of the item and box borders in , wheres represents the left border of the strip and represents the right borer of the strip. The variables for represent the distance between the consecutive -coordinates and . Last, the variables represent the width of the configuration in box which is positioned between and .
The first three constraints (12) to (14) ensure that the -coordinates are positioned in the right order and that we use exactly the width of the strip. Furthermore, the variables for the width between the -coordinates are defined. The equation (15) ensures the -coordinates of the items and boxes in are positioned such that their distance equals the widths of the corresponding item. Equations (16) and (17) ensure that the vertical items are placed correctly. The first equation ensures that we do not use a to large width for the configurations inside the boxes while the second equation ensures that all the vertical items can be placed.
The total number of constraints is bounded by
[TABLE]
While the total number of variables is bounded by
[TABLE]
Furthermore, all appearing values in the linear program are integer, the largest one on the left hand side is bounded by while the right hand side is bounded by . We can solve this linear program by guessing the right set of at most non-zero components and then solving the corresponding equation system using Gauß-Jordan elimination in .
After we have found such a solution, we fix the values for the variables and for each and find a basic solution to the linear program consisting just of the equations (16), (17), and (19). Such a basic solution has at most non zero components and hence uses at most this number of configurations.
In the very end of the algorithm, these configurations are filled (fractionally) with the rounded vertical items analogously as small wide jobs items are filed into their configurations, see Section 3.3. Since each configuration contains at most items and we use at most of them, there are at most fractionally placed vertical items which have a total width of at most . Since for a large enough constant , it holds that the total width of the discarded items is smaller than . These items are placed on top of the packing, adding at most to the packing height, or in the additional container .
5.4 Placing the Small Items
Note that the configurations for vertical and horizontal items might be smaller in height or width as the box they are placed inside, i.e., if a configuration for vertical items is placed in side a box there is a box of free area of width and height . We will use this area to place the small items. The total free area of this kind has to have the size of , since the configurations contain exactly the total area of the corresponding items and the total area of all items is at most while the packing has a height of at least .
Since we use at most configurations for vertical items and at most configurations for horizontal items, there are at most boxes for small items. We call the set of these boxes .
Lemma 12**:**
We can place the small items inside the boxes and one additional box of width and height .
Proof.
Remember that the total area of the boxes is at least . The algorithm first sorts the small items by height in time since the small items have at most different sizes. Afterward it considers the boxes for the small items one by one and fills the small items inside them using the NFDH algorithm. If an item does not fit inside the considered box, because the item is to wide or has a to large height, the algorithm is finished with this box and considers the next. All the items that cannot be placed inside the boxes are placed inside the newly introduced box of width and height .
Let us consider the boxes next to the configurations and the free area inside them. Let be such a box. In there is a free area of at most on one side of since the small items have a width of at most . Additionally, there can be free area of at most on the top of the box since the items have a height of at least . Lastly there can be free area between the items. However as indirectly shown by Coffman et al. in [6] in the proof of Lemma 5, the free area provoked this way over all the boxes is bounded by since the items have a maximal height of at most and the boxes have a maximal width of at most . In total the free area inside the boxes is bounded by . Since it holds that for a suitable large constant , the total area of the non placed small items has to be bounded by . Using Lemma 5, we can place these non placed items with a total height of at most inside the extra box. ∎
5.5 Packing medium sized items
To place the medium sized items, we partition them into two sets, which contains all the items taller than and . Since the total area of the medium sized items is bounded by , the total width of the items in is bounded by . Hence, we can place all these items at the end of the schedule next to the discarded vertical items. In total this adds at most to the schedule.
The jobs in have a height of at most and an area of at most . Hence by Lemma 5, when using the NDFH algorithm to place these items, we add at most to the packing height.
5.6 Summary of the algorithm
In the following, we summarize the steps of the algorithm and give a short overview of the running time. An overview of the generated packing can be found in Figure 9.
In the first step of the algorithm, we perform the simplification steps. We define , find the correct values for and as described in Lemma 7, and partition the set of items into , , , , and accordingly. Afterward, we round the heights and the widths of the items. First, we round the height of the items to multiples of and scale the items, such that they have heights in and scale accordingly such that . Next, we scale the instance and again with and use Lemma 2 to round heights of the items in , such that we can assume that they start at multiples of . Furthermore, introduce the set of rounded items using Lemma 9. 2. 2.
In the next step, we do a binary search over all the possible numbers of layers . Let be the currently considered number of layers. For this number of layers, we try to find a packing by performing the following steps. 3. 3.
For each guess of the set and each guess of y-coordinates and permutation for boxes and large items: try to solve the configuration linear program to place the horizontal items. If this is not possible try the next guess otherwise try to solve the to find the correct positions for the boxes, large items, and vertical items. If this LP is solvable save the guess and LP solutions and try the next smaller value for in binary search fashion, otherwise try the next guess. If all guesses fail try the next larger value for in binary search fashion. 4. 4.
After use the saved guess and LP solutions to assign the corresponding items. First, we revert the scaling of the items and scale the solution and guess accordingly. Then, we place the large, vertical, and horizontal items inside the guess as described in Section 5.3. Afterward, place the small items inside the resulting boxes for small items as described in Section 5.4. Finally, we place the medium sized items as described in 5.5.
The step 1 takes operations: The set of items needs to be enumerated once to find , i.e., its can be found in . The correct values for and can be found in and the corresponding partition can be found in . The scaling and rounding of the item heights can be done in . Finally the rounding of the item widths can be done in .
The binary search described in Step 2 can be done in . For each of the values given by the binary search framework, there are at most possibilities to guess , at most possibilities to guess y-coordinates, and at most possibilities to guess the right permutation for boxes and large items. The resulting LP can be solved in . Therefore the total running time of steps 2 and 3 can be summarized as
[TABLE]
In the final step, we place the original items inside the packing. The placement of large, vertical, and horizontal items can be done in since there are at most places for vertical and horizontal items. To place the small items, we use the NFDH algorithm and hence have a running time of at most since the items have at most sizes and are placed inside at most boxes. The medium sized items can be placed in at most since they have at most (possible) different sizes. Hence the total running time of the algorithm is bounded by .
As a consequence, we end up with a running time of for the AEPTAS and wehen using it as a subroutine for MSP for because we can choose in these cases. On the other hand, when using this algorithm as a subroutine for MSP for , we end up with a running time of because we have to choose in this case.
6 Conclusion
In this paper, we presented an algorithm for Multiple Cluster Scheduling (MCS) and Multiple Strip Packing (MSP) with best possible absolute approximation ratio of and best possible running time for the case . Still open remains the question if for the case the running time of or for MCS and MSP respectively can be improved to .
Furthermore, we presented a truly fast algorithm for Multiple Cluster Scheduling (MCS) with running time that does not have any hidden constants. Since the running time of the algorithm hides large constants, it would be interesting to improve the running time of the underlying or even to find a faster asymptotic algorithm with approximation guarantee .
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Peter A. Beling and Nimrod Megiddo. Using fast matrix multiplication to find basic solutions. Theor. Comput. Sci. , 205(1-2):307–316, 1998. URL: https://doi.org/10.1016/S 0304-3975(98)00003-6 , doi:10.1016/S 0304-3975(98)00003-6 . · doi ↗
- 2[2] Marin Bougeret, Pierre-François Dutot, Klaus Jansen, Christina Otte, and Denis Trystram. Approximation algorithms for multiple strip packing. In Approximation and Online Algorithms, 7th International Workshop, WAOA 2009, Copenhagen, Denmark, September 10-11, 2009. Revised Papers , pages 37–48, 2009. URL: https://doi.org/10.1007/978-3-642-12450-1_4 , doi:10.1007/978-3-642-12450-1\_4 . · doi ↗
- 3[3] Marin Bougeret, Pierre-François Dutot, Klaus Jansen, Christina Otte, and Denis Trystram. Approximating the non-contiguous multiple organization packing problem. In Theoretical Computer Science - 6th IFIP TC 1/WG 2.2 International Conference, TCS 2010, Held as Part of WCC 2010, Brisbane, Australia, September 20-23, 2010. Proceedings , pages 316–327, 2010. URL: https://doi.org/10.1007/978-3-642-15240-5_23 , doi:10.1007/978-3-642-15240-5\_23 . · doi ↗
- 4[4] Marin Bougeret, Pierre-François Dutot, Klaus Jansen, Christina Otte, and Denis Trystram. A fast 5/2-approximation algorithm for hierarchical scheduling. In Euro-Par 2010 - Parallel Processing, 16th International Euro-Par Conference, Ischia, Italy, August 31 - September 3, 2010, Proceedings, Part I , pages 157–167, 2010. URL: https://doi.org/10.1007/978-3-642-15277-1_16 , doi:10.1007/978-3-642-15277-1\_16 . · doi ↗
- 5[5] Marin Bougeret, Pierre-François Dutot, Denis Trystram, Klaus Jansen, and Christina Robenek. Improved approximation algorithms for scheduling parallel jobs on identical clusters. Theor. Comput. Sci. , 600:70–85, 2015. URL: https://doi.org/10.1016/j.tcs.2015.07.003 , doi:10.1016/j.tcs.2015.07.003 . · doi ↗
- 6[6] Edward G. Coffman Jr., Michael R. Garey, David S. Johnson, and Robert Endre Tarjan. Performance bounds for level-oriented two-dimensional packing algorithms. SIAM Journal on Computing , 9(4):808–826, 1980. doi:10.1137/0209062 . · doi ↗
- 7[7] Wenceslas Fernandez de la Vega and George S. Lueker. Bin packing can be solved within 1+epsilon in linear time. Combinatorica , 1(4):349–355, 1981. URL: https://doi.org/10.1007/BF 02579456 , doi:10.1007/BF 02579456 . · doi ↗
- 8[8] Pierre-François Dutot, Klaus Jansen, Christina Robenek, and Denis Trystram. A (2 + ϵ italic-ϵ \epsilon )-approximation for scheduling parallel jobs in platforms. In Euro-Par 2013 Parallel Processing - 19th International Conference, Aachen, Germany, August 26-30, 2013. Proceedings , pages 78–89, 2013. URL: https://doi.org/10.1007/978-3-642-40047-6_11 , doi:10.1007/978-3-642-40047-6\_11 . · doi ↗
