A Practical 73/50 Approximation for Contiguous Monotone Moldable Job Scheduling
Abstract
In moldable job scheduling, we are provided identical machines and jobs that can be executed on a variable number of machines. The execution time of each job depends on the number of machines assigned to execute that job. For the specific problem of monotone moldable job scheduling, jobs are assumed to have a processing time that is non-increasing in the number of machines.
The previous best-known algorithms are: (1) a Polynomial Time Approximation Scheme (PTAS) with time complexity , where is a super-exponential function [Jansen and Thöle ’08; Jansen and Land ’18], (2) a Fully Polynomial Time Approximation Scheme (FPTAS) for the case of [Jansen and Land ’18], and (3) a approximation with time complexity [Wu, Zhang, and Chen ’23].
We present a new practically efficient algorithm with an approximation ratio of and a time complexity of . Our result also applies to the contiguous variant of the problem. In addition to our theoretical results, we implement the presented algorithm and show that the practical performance is significantly better than the theoretical worst-case approximation ratio.
Keywords and phrases:
computing, machine scheduling, moldable, polynomial approximationCopyright and License:
2012 ACM Subject Classification:
Theory of computation Discrete optimization ; Theory of computation Parallel computing models ; Theory of computation Scheduling algorithmsFunding:
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project number 453769249.Editors:
Meena Mahajan, Florin Manea, Annabelle McIver, and Nguyễn Kim ThắngSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
In the past many variants of scheduling problems have been studied. The classical task scheduling problem consists of scheduling jobs to identical machines, where each job occupies exactly machine. Motivated by many practical applications, such as high performance computing [8], where parallelism is exploited to speed up the execution of jobs, many extensions of this problem have been studied. One of which is scheduling moldable jobs. This is a natural extension where jobs can be executed on a variable number of machines. There are many practical motivations for this problem formulation, as discussed in [2, 8, 11].
In moldable job scheduling we are given jobs and identical machines. Each job can be assigned to machines and the processing time of any job is dependent on the number of assigned machines. We denote the processing time of any job as . Further, the work of any job is defined as and can be described as its area. For monotone moldable job scheduling we assume that for any job, the work function and time function are non-decreasing and non-increasing, respectively.
Assumption 1 (monotony [29]).
Given any job , for all , we have:
-
(i)
-
(ii)
A solution to an instance of this problem is given by a schedule, containing a start time for each job , and an allotment for each job. A schedule is called feasible if the following conditions are met:
-
A job starts its execution simultaneously on all its assigned machines
-
A job may not be interrupted during its execution time
-
Each machine can execute at most one job at a time
In the contiguous variant of the problem, we additionally require each job to be processed on an adjacent set of machines. In many practical applications obtaining such a schedule, where jobs are processed on adjacent machines, is beneficial as it allows for better memory locality and reduced communication overhead between machines [2]. There are many other applications of this model, as discussed in [1, 5, 6, 13, 29, 31]. In this paper we consider the problem of minimizing the makespan, i.e., the maximum completion time of any job in a schedule.
1.1 Related Work
Note that in moldable job scheduling the number of machines assigned to a job is fixed during the execution of the job. Some older publications refer to this problem as malleable job scheduling [4, 12, 13, 21, 24, 27, 29]. However, the notation has recently changed to moldable job scheduling, whereas malleable job scheduling is now used to refer to the problem, where the number of machines assigned to a job can change during its execution.
Moldable job scheduling as well as the monotone variant are known to be NP-hard [9, 20]. Turek, Wolf, and Yu [30] presented a -approximation algorithm for the general case of moldable job scheduling. Later, Ludwig and Tiwari [27] presented an algorithm with the same approximation ratio but improved the running time to be polynomial in . It has been proven that for moldable job scheduling (without monotony!) no polynomial-time approximation algorithm with a guarantee below exists, unless P = NP [7, 25]. But there exists a pseudo-polynomial -approximation algorithm for scheduling contiguous moldable jobs with a time complexity of , where is a computable function [22]. For special cases of the problem there exist better approximation algorithms: Jansen and Porkolab [21] presented an approximation scheme with linear running time for a constant number of machines ; Decker, Lücking, and Monien [4] gave a -approximation under the additional assumption of identical jobs. Jobs are called identical if the execution time on any number of machines is the same for all jobs.
In this work we study the specific problem of monotone moldable job scheduling. Mounié, Rapine, and Trystram [28, 29] presented a -approximation algorithm with a time complexity of for the contiguous case. Over the past years, various authors have improved this result. Jansen and Thöle [23, 24] have shown the existence of an algorithm with an approximation ratio arbitrarily close to for the contiguous problem and presented a Polynomial Time Approximation Scheme (PTAS) for the same problem without the contiguous restriction when is bounded by a polynomial in . Jansen and Land [19] generalized the PTAS in [24] by presenting a Fully Polynomial Time Approximation Scheme (FPTAS) for the contiguous case under the assumption of . Additionally, they improved the -approximation algorithm in [29] to have a running time with only poly-logarithmic dependence on the number of machines . These result were further improved by Grage, Jansen, and Ohnesorge [16]. Just recently, Wu, Zhang, and Chen [31] gave a -approximation algorithm with a running time of and stated the open question of whether an approximation algorithm for this problem exists with an approximation ratio better than and a similar running time.
1.2 Our Contributions
The best known approximation ratio for the problem of monotone moldable job scheduling (non-contiguous) is , given by the PTAS in [23, 24]. This PTAS uses a dynamic program to place jobs across many starting points. When setting , we get the number of starting points by calculating , such that and . This resolves to roughly . The overall dynamic program then has a running time of roughly . When comparing the -approximation in [22], to current -approximation algorithms by setting , we get a running time of . While these algorithms are of theoretical interest, they have an impractically large running time. Motivated by this, we focus on practically efficient approximation algorithms (Table 1).
Previously it was assumed that there exists no practically efficient -approximation for the problem of monotone moldable job scheduling, for any [31]. We break this barrier by presenting an approximation algorithm with a worst-case approximation ratio of . It is worth noting that the PTAS presented in [24] cannot solve the contiguous variant of the problem, and it is unknown whether there exists a PTAS for this variant of the problem. Surprisingly, we show that our algorithm creates a contiguous schedule with a makespan of at most , where is a lower bound on the optimum of the non-contiguous problem. This result also bounds the gap between the contiguous and non-contiguous variant of the problem.
Our algorithm has a running time of . This is technically only pseudo-polynomial in the encoding length of the problem because of the linear dependency on . Similar to the algorithms in [22, 24], we can use the FPTAS presented in [16, 19] for instances with . Thus, we may assume that . Our running time of is fully polynomial in this case.
Theorem 2.
Let . For contiguous monotone moldable job scheduling, there exists an algorithm with an approximation ratio of and a running time of .
We achieve this result by improving the long-standing algorithm of Mounié, Rapine, and Trystram [29]. Although this algorithm has been improved many times with respect to the running time [19, 16], improving the approximation ratio seemed to be a difficult task (except for eliminating the factor [31]). We manage this with the following new techniques: (1) relaxing the standard 0/1-Knapsack used in their algorithm to a Multiple-Choice Knapsack Problem, (2) packing the jobs into more containers, which results in more complex repair algorithms, and (3) analyzing a single critical case carefully with an elegant geometric argument. Our method of analyzing this critical case results in the so-called Lambert W function appearing in the approximation ratio.
We believe that this result is of theoretical interest as it breaks the long-standing barrier of for these practically efficient algorithms and the techniques employed, particularly the geometric argument, are potentially of broader interest. A similar geometric analysis could be beneficial in other scheduling and packing problems [10, 14, 17]. Furthermore, our theoretical results are supported by practical experiments demonstrating that a schedule length of at most can be guaranteed in most cases. This makes this algorithm a promising candidate for practical applications.
1.3 Preliminaries
As many of the previous works, we utilize a dual approximation framework as proposed by Hochbaum and Shmoys [18]. First, we obtain a lower and upper bound on the optimum makespan by a constant approximation algorithm [30, 27] and then perform binary search in this interval to find the optimal makespan up to an accuracy of . Therefore, for this work we assume that we are given a makespan guess and want to find a schedule with makespan at most or reject if .
Similar to Mounié, Rapine, and Trystram [29], we define the canonical number of machines as follows:
Definition 3 (Canonical Number of Machines).
Given a real number , we define for each job its canonical number of machines as the minimal number of machines needed to execute in time at most . If cannot be processed in time at most on machines, we set by convention.
We do note that, due to monotony, this number can be found in time using binary search.
2 Description of the Algorithm
In order to motivate the core idea of our algorithm, we first give a brief overview of the algorithm presented by Mounié, Rapine, and Trystram [29]: First, find a partition with some specific properties. Then, schedule the first set with a total width and height of and , respectively. The second set is scheduled with a height of at most on top, which then results in a total height of at most . Afterwards, the remaining small jobs are scheduled greedily. For ease of notation we will, similar to [29, 21, 16], call the sets shelf 1 and shelf 2, respectively. We describe the maximum allowed execution time of jobs in each shelf as the height of the shelf, e.g. in the algorithm of [29] the height of shelf 1 is and the height of shelf 2 is .
Although this algorithm is quite tailored to an approximation ratio of , we manage to adapt it to obtain a better approximation ratio. A key insight is that we can partition the jobs into more sets to more closely resemble the allotment in an optimal schedule. We believe that this technique might be of more general interest. Improving the approximation ratio of this algorithm comes with a few major challenges: (1) Greedily adding jobs with will result in an approximation ratio . (2) We need to be more careful about the partitioning of jobs into shelves.
We overcome the first challenge by defining as the set of small jobs, and as the set of big jobs. This choice, while it may seem arbitrary, will become clear in the subsequent analysis. The minimal work of the small jobs in any schedule is denoted as .
For the partition we allow a third shelf, which is allowed to exceed the width of . By exploiting the work monotony of jobs, we can later reduce the number of machines assigned to jobs in this shelf. This leads us to the central theorem of our work:
Theorem 4.
Given a partitioning of jobs s.t.
-
C1
-
C2
one can compute a contiguous schedule with makespan at most in time , for any .
The Lambert W function, also called omega function or product logarithm is defined such that holds if and only if . The branch is used for [3]. The fact that the Lambert W function appears is due to the nature of our analysis, where we define integrals to get a bound on the work of jobs in a schedule. This technique, while not new, is not commonly used in the analysis of scheduling problems. Fotakis, Matuschke, and Papadigenopoulos [12] use a similar analysis technique, but the Lambert W function does not appear in their analysis.
2.1 Finding a Partition
We start by showing the existence of a partition of jobs into three classes, as required by Theorem 4, given a schedule with makespan at most exists.
Lemma 5.
Proof.
Consider any schedule for an instance with makespan . The total work of all small jobs, defined as , is at least , due to the assumption of work monotony. Therefore, the work of all remaining jobs is at most . For any job , we will denote the number of machines assigned to this job in the optimal schedule as . We now argue that the partition , , and of jobs in satisfies both constraints C1 and C2.
Due to monotony, we know that the work of any job in is at least . Therefore:
| (1) |
Each job in uses at least machines and has a work of at least , therefore:
| (2) | ||||
| (3) |
For the last partition , first observe that in any optimal schedule of height at most no job from can be scheduled on the same machine as a job from . Thus, all jobs in are scheduled on at most machines. Each job uses at least machines and, since , at most two such jobs can be scheduled on the same machine. Therefore:
| (4) |
For the work area, we give a similar argument as above and get:
| (5) |
Combining Equations 3 and 4, yields constraint C2 and combining Equations 2, 5, and 1, yields constraint C1. This proves the lemma.
Thus, given a makespan guess , we know a partition of jobs exists such that the constraints of Theorem 4 hold. Finding such a partition is equivalent to solving a Multiple-Choice Knapsack Problem (MCKP).
Definition 6 ( Multiple-Choice Knapsack Problem (MCKP)).
Given a capacity , classes and items, each item with a cost and a size for each . Find a partition with:
Solving the MCKP can be done in time using dynamic programming [26]. Given a makespan guess , finding a partition that satisfies the constraints of Theorem 4 is equivalent to solving a MCKP with capacity and classes, where each job is an item with costs , , and and sizes , , and . Therefore, we will assume for the remainder of this work that we are given a partition that satisfies the constraints of Theorem 4.
2.2 Constructing a Schedule
In this section we assume that we are given a makespan guess and a partition that satisfies the constraints of Theorem 4. We will prove Theorem 4 by providing an algorithm with the required approximation ratio. An overview of this algorithm is given in Algorithm 1.
Our goal is now to construct an intermediate schedule, as shown in Figure 1 (left) for all jobs . Any job is scheduled on machines at time 0, any job is scheduled on machines at time 0, and any job on machines such that it completes at time . When analyzing the resulting schedule, we notice that (1) the jobs in and require more than machines, and (2) the jobs in might also require more than machines.
We fix the first problem by scheduling the jobs on fewer machines and focus on the second problem in Section 2.3. Note that all jobs are scheduled in a way such that Constraint C1 remains satisfied and the total work of all big jobs is at most . This remains true, due to work-monotony, for the remainder of this work by ensuring that no alterations to this schedule increase the number of machines assigned to any job.
Lemma 7.
All jobs in can be scheduled on machines without exceeding the makespan of .
Proof.
First notice that by Constraint C2, we get . Therefore, we need to effectively schedule each job, such that it requires at most machines.
We analyze jobs based on their canonical number of machines .
Case 1 .
These jobs can be scheduled in such a way that they do not exceed an execution time of when assigned to machines. Due to work monotony, we have:
This implies that is smaller than or equal to for any .
Case 2 .
These jobs can be scheduled on 1 machine without exceeding the makespan of , exactly halving the number of required machines.
Case 3 .
If there are multiple such jobs, they can be scheduled in pairs on top of each other without idle time. In the remainder of this work, we may treat these jobs as a single bigger job. Thus, we may assume there exists at most one of these jobs and denote it as .
Case 4 .
These jobs can also be scheduled in pairs on top of each other. In the remainder of this work, we may treat these jobs as a single bigger job. A remaining single job, denoted , may need to be processed differently.
If neither nor exists, we have successfully scheduled all jobs in such that they require no more than machines.
If only exists, the schedule still fits within the machine limit since is of integer value.
If only exists, it can be scheduled on machines, and again the schedule fits within the machine limit.
If both and exist, is scheduled on 2 machines, with a height of at most , and is placed on top of one of these machines. We consider these two jobs as one job of height scheduled on 1 machine, and one job of height scheduled on 1 machine.
Remark 8.
Note that splitting the job into two parts might break the contiguous property of the schedule. However, we can simply reorder the machines such that this job is scheduled on adjacent machines. We will revisit this problem in each of the following proofs individually to ensure at any point that both parts of can be scheduled on adjacent machines.
For the following sections, we will refer to the schedule constructed in Lemma 7 as a 3-shelf schedule (Definition 9 with ). To that end, we distribute jobs in onto three shelves, as shown in Figure 2. Jobs in are distributed onto the first two shelves ( and ) such that any job with an execution time greater than is in and the remaining jobs are in . The jobs in are put into with an execution time of at most .
Definition 9 (3-Shelf Schedule).
Given a makespan guess and , a 3-shelf schedule is a partition of jobs such that:
2.3 Repairing the 3-Shelf Schedule
This section is devoted to repairing the 3-shelf schedule obtained in the previous section. Although the above knapsack formulation suggests a makespan guarantee of is achievable, we will have to relax this to obtain a feasible schedule. To this end, we parameterize the approximation ratio of our algorithm by a parameter , to be chosen later. Thus, we aim to construct a schedule of height at most , where we allow jobs in shelf 2 to have an execution time of at most .
We will denote the number of machines used by and as and , respectively. By construction machines are used to schedule jobs in and . Lemma 7 guarantees that the jobs in require at most machines with height of at most . We denote the number of idle machines in shelf 1, i.e. machines that do not execute any job , as . Note that it is not yet guaranteed that the jobs in can be scheduled on the remaining machines with a maximal height of , for any . For the remainder of this section, we assume that we are given a 3-shelf schedule with , as the schedule is feasible otherwise (Figure 2).
The following proofs use a lower bound on the total work of jobs to show the desired approximation ratio. Remember that, by Constraint C1 of Theorem 4, the given schedule satisfies , where denotes the total work area of jobs in shelf . Since, by construction, the total work of jobs in shelf 0 is greater than , we get . For ease of notation, we will w.l.o.g ignore shelf 0 and assume that as illustrated in Figure 2 (right).
We start by applying transformations (Algorithm 2) to the 3-shelf schedule, which will help reduce the number of machines used by . These transformations are based on ideas from Mounié, Rapine, and Trystram [29] but are parameterized with .
-
T1
If a job has execution time at most and is allotted to machines, allocate to machines in .
-
T2
If have execution time less than and are each allotted to machine, allocate and to the same machine in .
-
T3
Let denote the number of idle machines in . If there exists a job with an execution time of less than on machines, allocate on machines either to or , depending on its execution time.
In the following, we will analyze the schedule that results after applying Algorithm 2. Remember, that for ease of notation, we assume . This does not change the correctness of the proof, since we contradict the total work of the schedule, and shelf 0 has a total work greater than .
Lemma 10.
Given a 3-shelf schedule and any , we can either find a feasible contiguous schedule with makespan at most in time , or the following properties hold:
-
(i)
At most one machine executes a job with height less than .
-
(ii)
The work area of any job in is greater than .
-
(iii)
The work area of is greater than .
Proof.
We prove the lemma by first showing that Properties i and ii hold after applying Algorithm 2. Then, we will establish the contiguity of the schedule and analyze the time complexity of the algorithm.
We begin by showing the three properties of the lemma. By the definition of Algorithm 2, any job is scheduled on machines. This implies that any job with an execution time of less than is scheduled on exactly one machine, by the definition of and monotony. The schedule contains at most one such job, since we could otherwise apply Transformation T2, contradicting the algorithms’ termination condition. Property ii follows directly, since Transformation T3 cannot be applied.
Case 1 ( and ).
In this case, . We place all jobs on this one machine and obtain a feasible schedule, if .
Case 2 ( and ).
In this case, . Since contains at least one job , by Property ii. With , we get:
For , this implies . Since and , we must have and . We will first show that can contain at most one job. To this end, denote the number of jobs in as , then the total work area of is , by Property ii and . With we get:
| () | ||||
This leads to a final contradiction. If we cannot find a feasible schedule, the single job in has a processing time of at least on two machines. This implies a total work area of , where the first inequality follows from and the second from . Since , this is a contradiction.
Case 3 ().
If Property iii does not hold, we may assume that there exists another job with an execution time less than . Then, we can schedule on top of . Observe that , therefore we place (and partially) in . The new schedule satisfies iii.
It remains to show that the resulting schedule is contiguous. We must ensure that no job is split across non-adjacent machines. Note that this can only happen for jobs that are split between two shelves. If such a job exists (see Remark 8), we can choose (the job violating Property iii) to be . We consider the three cases from above: In Cases 1 and 2, job () is the only job in . We can schedule it at the boundary between shelf 1 and shelf 0, ensuring it occupies a contiguous block of machines. In case 3, () is moved entirely into shelf 0, so it is no longer split. The other job can be chosen as the smallest job in and placed at the boundary, preserving contiguity. This guarantees that all jobs are scheduled on adjacent machines.
The time complexity results from the following argument: Denote the number of big jobs as . Since the transformations move jobs from shelf 2 to shelf 1 or 0, and from shelf 1 to shelf 0, the while-loop in Algorithm 2 can be executed at most times. Transformations T1 and T2 can be implemented in . Transformation T3 can be implemented in for scanning the jobs in and to determine for the chosen job . This results in a time complexity of . Since is bounded by both and , we can conclude that the time complexity of Algorithm 2 is .
Our goal for the remainder of this section is now to show that does not require more than machines. The new idea is to compress jobs in to a height greater than the height of their shelf (), since the jobs in cannot be utilizing the entire height of their shelf. We formulate multiple new repair algorithms that utilize this observation, and show that they can construct a feasible schedule in several ways.
Lemma 11.
Given a 3-shelf schedule with , we can find a feasible contiguous schedule with makespan at most (if ), and (if ) in time .
Proof.
In this case a feasible schedule can be found by applying Algorithm 3. The proof of this lemma uses fairly simple techniques, therefore we defer the proof of this lemma to the full version.
It remains to show that we can also find a feasible schedule for the case . We prepare this proof with the following observation:
Observation 12.
Given a 3-shelf schedule with and , the number of jobs in is at most .
Proof.
With this, we may assume that and denote the single job in as . This observation can be exploited by enumerating all possible allotments for this job (Algorithm 4).
The following lemma analyzes the correctness of the last (and most complex) case.
Lemma 13.
Given a 3-shelf schedule with , we can find a feasible schedule with makespan at most , for any .
Proof.
We intend to prove the lemma by showing that the height of any job in scheduled on machine is greater than , provided we cannot find a feasible schedule with Algorithm 4 (as illustrated in Figure 3). With this observation, we can analyze the total work area of the schedule and contradict .
Consider a schedule as illustrated in Figure 3 (left), where Algorithm 4 cannot place . We start by showing that when placing all jobs in shelf 1 in non-increasing order of processing time, the processing time of jobs (load ) on each machine is greater than .
Assumption 14.
If Algorithm 4 does not find a feasible schedule, the jobs in can be placed such that the load on each machine satisfies:
This assumption can be proven by a simple contradiction argument. We formally show this in the full version of this paper.
It remains for us to analyze the total work area of the schedule under Assumption 14 to reach a contradiction to . We will split this analysis into two cases.
- Case 1 ():
-
In this case, we explicitly calculate a bound on . For more details please refer to the full version of this paper.
- Case 2 ():
-
The most important observation in this case is that we can correctly bound the work on shelf 1 by the following integral:
(6)
This bound is not entirely trivial, since shelf 1 might contain one job with an execution time of less than , by Lemma 10.i. We formally show the correctness of this bound, under the assumption of , in the full version of this paper.
In order to reach a contradiction, we need to show that
The first inequation follows directly from Equation 6, Lemma 10ii, and . In order to show the second inequation, we will interpret this expression as a function in and show that its minimum, at , is greater than .
Observation 15.
The function
has a minimum at , for any .
We give a full proof of this observation in the full version of this paper.
Since has the minimal value (in the interval ) at , we need to show that:
| (7) |
In order to further analyze this expression, we need to take a closer look at the integral term. First, let’s find the switching point of the max-function, where .
Then, we can split the integral from Equation 7 at and analyze both parts separately.
Together with Equation 7, we get:
The Lambert W function is defined such that , iff . We note that we use the branch of the Lambert function and since this branch is monotonically decreasing we get, with , , the following inequation.
Thus, we reach a contradiction to for any .
This concludes the proof of Lemma 13.
Observation 16.
The feasible schedule constructed by Algorithm 4 can be rearranged to a contiguous schedule without altering the makespan.
Proof.
Note that by definition, any job contained entirely in one shelf can be scheduled on a contiguous set of machines. There exists at most one job , mentioned in Remark 8, that might be split between two shelves. A key observation for this proof is that, although the order of jobs in is important, we can partition the jobs in into two groups. The first group contains all jobs that fit underneath the singular job in and the second group contains all jobs that do not fit underneath this job. The order within these two groups does not matter. Thus, we can place the job on the edge of shelf 1, and if required, the allotment can be mirrored. With this we can guarantee that the job is scheduled next to its counterpart in on adjacent machines.
Lemmas 11 and 13, and Observation 16 complete the proof of Theorem 4 and show that we can find a feasible contiguous schedule for all jobs in .
3 Adding the Small Jobs
To complete the dual approximation, we need to add the previously ignored small jobs . To this end, we recall that the total work on the obtained shelf schedule is at most .
Lemma 17.
Given a feasible contiguous schedule of length at most for with a work area of at most , Algorithm 5 delivers a feasible contiguous schedule with makespan at most for the entire instance , for any .
Proof.
Consider a schedule, as constructed in Section 2. We schedule all jobs in shelf 1 with a starting time of and all jobs in shelf 2 such that they complete at exactly . This way the idle times on each machine are uninterrupted.
The load of each machine is defined by the sum of execution times of the jobs scheduled on it. By definition, the idle time of any machine is equal to minus the load on that machine.
Now suppose Algorithm 5 does not deliver a feasible schedule. In this case, there must exist a machine with a load strictly greater than after adding a small job. This implies that the load on that machine, before adding the small job, was greater than , since all small jobs have an execution time of at most on one machine, by definition. With being the least loaded machine, this contradicts the assumption that the total work area of this schedule is at most .
The time complexity of the presented algorithm is . With a dual approximation framework, we can find a feasible schedule with makespan at most in time .
4 Experimental Evaluation
In addition to the theoretical improvement on the current state-of-the-art algorithms, we also implemented the presented algorithm. In the following, we present some experimental results of the algorithm on randomly generated instances and show that the algorithm is capable of solving realistic instances in reasonable time. The implementation is in Java and publicly available on GitHub (https://github.com/Felioh/MoldableJobScheduling) as well as the test-instances and results. We tested on randomly generated instances with jobs and machines, where the execution time of each job is uniformly distributed in (on one machine) and the remaining values are uniformly distributed, respecting monotony restrictions.
All tests were run on a single core of an Intel i5-8400T CPU with 2GB of RAM available to the Java process.
We split the tests into two groups, one where we fixed the number of jobs to and varied the number of machines , and one where we fixed the number of machines to and varied the number of jobs . For all tests, we set .
Figures 4 and 5 show the execution time of our implementation for these two groups of tests. Although we did not take any special care to optimize the implementation, the algorithm is able to solve all instance in less than 30 seconds. The execution time decreases for , since in these instances the optimal makespan is bigger. This results in more jobs being classified as small jobs and an easier to solve instance.
We note that while the theoretical worst-case approximation ratio is , the algorithm was able to guarantee a makespan below in all randomly generated instances. This is due to the fact that the worst-case approximation ratio only occurs in very specific cases. To be more precise, the presented algorithm can guarantee a makespan of at most , unless the number of idle machines in shelf 1 is greater than (see Lemma 13).
However, we can show that our analysis is tight in the worst case. Consider the following instance with and . All jobs have a constant work-function with the following values:
-
:
-
:
-
:
An optimal schedule for this instance has a makespan of , since the work of all jobs is and by placing all jobs on machines, we can achieve a makespan of . On the other hand, an optimal solution to the MCKP problem in our algorithm is given by , , . In this case, the algorithm will schedule on machines and all remaining jobs on machine each. This results in a makespan of . For larger , we can construct similar instances and achieve an approximation ratio arbitrarily close to our theoretical worst-case guarantee of . Due to the very specific structure of these instances, they are highly unlikely to occur in practice.
5 Conclusion
The algorithm presented in this work achieves an approximation ratio slightly below for any in time complexity for the problem of scheduling monotone moldable jobs. Even more surprisingly, we also show how to apply this algorithm to the contiguous variant of the problem. Since we construct the same schedule for the contiguous variant as for the non-contiguous variant, this bounds the gap between these two variants, which is an interesting side effect of our algorithm.
We show in an implementation that the algorithm achieves a ratio of in most cases and the worst-case approximation ratio of only happens in very specific problematic cases.
5.1 Future Work
The presented algorithm breaks the long-standing barrier of a practically efficient algorithm with an approximation ratio below for the problem of scheduling monotone moldable jobs.
We hope that this work will lead to further improvements in the field of scheduling monotone moldable jobs. In particular, we leave the following open questions for future work:
-
Can the approximation ratio be improved further? There is no known lower bound on the approximation ratio for practically efficient algorithms. As we showed, the presented algorithm already achieves an approximation ratio below the worst case guarantee in most cases. This question is specifically interesting for the contiguous variant, since no PTAS is known.
-
Can the running time be improved? Jansen and Land [19] introduced the concept of compression to achieve a logarithmic dependence on the number of machines in the running time of the algorithm. This was improved by Grage, Jansen, and Ohnesorge [16] by utilizing (min, +)-convolution. These techniques could potentially be applied to our algorithm to reduce the dependence on in the running time.
References
- [1] Jacek Blazewicz, T. C. Edwin Cheng, Maciej Machowiak, and Ceyda Oguz. Berth and quay crane allocation: a moldable task scheduling model. J. Oper. Res. Soc., 62(7):1189–1197, 2011. doi:10.1057/jors.2010.54.
- [2] Raphaël Bleuse, Sascha Hunold, Safia Kedad-Sidhoum, Florence Monna, Grégory Mounié, and Denis Trystram. Scheduling independent moldable tasks on multi-cores with gpus. IEEE Transactions on Parallel and Distributed Systems, 28(9):2689–2702, 2017. doi:10.1109/TPDS.2017.2675891.
- [3] Robert M Corless, Gaston H Gonnet, David EG Hare, David J Jeffrey, and Donald E Knuth. On the lambert w function. Advances in Computational mathematics, 5:329–359, 1996. doi:10.1007/BF02124750.
- [4] Thomas Decker, Thomas Lücking, and Burkhard Monien. A 54-approximation algorithm for scheduling identical malleable tasks. Theoretical Computer Science, 361(2-3):226–240, 2006. doi:10.1016/j.tcs.2006.05.012.
- [5] Xavier Delorme, Alexandre Dolgui, Sergey Kovalev, and Mikhail Y. Kovalyov. Minimizing the number of workers in a paced mixed-model assembly line. Eur. J. Oper. Res., 272(1):188–194, 2019. doi:10.1016/j.ejor.2018.05.072.
- [6] Alexandre Dolgui, Sergey Kovalev, Mikhail Y. Kovalyov, Sergey Malyutin, and Ameur Soukhal. Optimal workforce assignment to operations of a paced assembly line. Eur. J. Oper. Res., 264(1):200–211, 2018. doi:10.1016/j.ejor.2017.06.017.
- [7] Maciej Drozdowski. On the complexity of multiprocessor task scheduling. Bulletin of The Polish Academy of Sciences-technical Sciences, 43:381–392, 1995.
- [8] Maciej Drozdowski. Scheduling for parallel processing, volume 18. Springer, 2009. doi:10.1007/978-1-84882-310-5.
- [9] Jianzhong Du and Joseph Y-T Leung. Complexity of scheduling parallel task systems. SIAM Journal on Discrete Mathematics, 2(4):473–487, 1989. doi:10.1137/0402042.
- [10] Franziska Eberle, Felix Hommelsheim, Malin Rau, and Stefan Walzer. A tight (3/2 + )-approximation algorithm for demand strip packing. In SODA, pages 641–699. SIAM, 2025. doi:10.1137/1.9781611978322.20.
- [11] Dror G. Feitelson and Larry Rudolph. Towards convergence in job schedulers for parallel supercomputers. In JSSPP, volume 1162 of Lecture Notes in Computer Science, pages 1–26. Springer, 1996. doi:10.1007/BFb0022284.
- [12] Dimitris Fotakis, Jannik Matuschke, and Orestis Papadigenopoulos. Malleable scheduling beyond identical machines. In APPROX-RANDOM, volume 145 of LIPIcs, pages 17:1–17:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.APPROX-RANDOM.2019.17.
- [13] Dimitris Fotakis, Jannik Matuschke, and Orestis Papadigenopoulos. Assigning and scheduling generalized malleable jobs under subadditive or submodular processing speeds. Oper. Res., 73(3):1598–1614, 2025. doi:10.1287/opre.2022.0168.
- [14] Waldo Gálvez, Fabrizio Grandoni, Sandy Heydrich, Salvatore Ingala, Arindam Khan, and Andreas Wiese. Approximating geometric knapsack via l-packings. In FOCS, pages 260–271. IEEE Computer Society, 2017. doi:10.1109/FOCS.2017.32.
- [15] Bernhard Sebastian Germann, Klaus Jansen, Felix Ohnesorge, and Malte Tutas. 3/2-dual approximation for cpu/gpu scheduling. In 22nd International Symposium on Experimental Algorithms (SEA 2024). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.SEA.2024.13.
- [16] Kilian Grage, Klaus Jansen, and Felix Ohnesorge. Improved algorithms for monotone moldable job scheduling using compression and convolution. In Euro-Par, volume 14100 of Lecture Notes in Computer Science, pages 503–517. Springer, 2023. doi:10.1007/978-3-031-39698-4_34.
- [17] Rolf Harren, Klaus Jansen, Lars Prädel, and Rob van Stee. A (5/3 + )-approximation for strip packing. In WADS, volume 6844 of Lecture Notes in Computer Science, pages 475–487. Springer, 2011. doi:10.1007/978-3-642-22300-6_40.
- [18] Dorit S. Hochbaum and David B. Shmoys. Using dual approximation algorithms for scheduling problems theoretical and practical results. J. ACM, 34(1):144–162, 1987. doi:10.1145/7531.7535.
- [19] Klaus Jansen and Felix Land. Scheduling monotone moldable jobs in linear time. In 2018 IEEE International Parallel and Distributed Processing Symposium, (IPDPS 2018), pages 172–181. IEEE Computer Society, 2018. doi:10.1109/IPDPS.2018.00027.
- [20] Klaus Jansen, Felix Land, and Kati Land. Bounding the running time of algorithms for scheduling and packing problems. SIAM J. Discret. Math., 30(1):343–366, 2016. doi:10.1137/140952636.
- [21] Klaus Jansen and Lorant Porkolab. Linear-time approximation schemes for scheduling malleable parallel tasks. In Proceedings of the tenth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 1999), pages 490–498. ACM/SIAM, 1999. URL: http://dl.acm.org/citation.cfm?id=314500.314870.
- [22] Klaus Jansen and Malin Rau. Closing the gap for pseudo-polynomial strip packing. In 27th Annual European Symposium on Algorithms (ESA 2019), volume 144 of LIPIcs, pages 62:1–62:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.ESA.2019.62.
- [23] Klaus Jansen and Ralf Thöle. Approximation algorithms for scheduling parallel jobs: Breaking the approximation ratio of 2. In ICALP (1), volume 5125 of Lecture Notes in Computer Science, pages 234–245. Springer, 2008. doi:10.1007/978-3-540-70575-8_20.
- [24] Klaus Jansen and Ralf Thöle. Approximation algorithms for scheduling parallel jobs. SIAM J. Comput., 39(8):3571–3615, 2010. doi:10.1137/080736491.
- [25] Berit Johannes. Scheduling parallel jobs to minimize the makespan. J. Sched., 9(5):433–452, 2006. doi:10.1007/s10951-006-8497-6.
- [26] Hans Kellerer, Ulrich Pferschy, and David Pisinger. Knapsack problems. Springer, 2004. doi:10.1007/978-3-540-24777-7.
- [27] Walter Ludwig and Prasoon Tiwari. Scheduling malleable and nonmalleable parallel tasks. In Daniel Dominic Sleator, editor, Proceedings of the Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, (SODA 1994), pages 167–176. ACM/SIAM, 1994. URL: http://dl.acm.org/citation.cfm?id=314464.314491.
- [28] Grégory Mounié, Christophe Rapine, and Denis Trystram. Efficient approximation algorithms for scheduling malleable tasks. In Proceedings of the Eleventh Annual Symposium on Parallel Algorithms and Architectures (SPAA 1999), pages 23–32. ACM, 1999. doi:10.1145/305619.305622.
- [29] Gregory Mounie, Christophe Rapine, and Denis Trystram. A 3/2-approximation algorithm for scheduling independent monotonic malleable tasks. SIAM J. Comput., 37(2):401–412, 2007. doi:10.1137/S0097539701385995.
- [30] John Turek, Joel L Wolf, and Philip S Yu. Approximate algorithms scheduling parallelizable tasks. In Proceedings of the fourth annual ACM symposium on Parallel algorithms and architectures (SPAA 1992), pages 323–332, 1992. doi:10.1145/140901.141909.
- [31] Fangfang Wu, Xiandong Zhang, and Bo Chen. An improved approximation algorithm for scheduling monotonic moldable tasks. Eur. J. Oper. Res., 306(2):567–578, 2023. doi:10.1016/j.ejor.2022.08.034.
