Makespan Minimization with OR-Precedence Constraints

07/18/2019 ∙ by Felix Happach, et al. ∙ Technische Universität München 0

We consider a variant of the NP-hard problem of assigning jobs to machines to minimize the completion time of the last job. Usually, precedence constraints are given by a partial order on the set of jobs, and each job requires all its predecessors to be completed before it can start. In his seminal paper, Graham (1966) presented a simple 2-approximation algorithm, and, more than 40 years later, Svensson (2010) proved that 2 is essentially the best approximation ratio one can hope for in general. In this paper, we consider a different type of precedence relation that has not been discussed as extensively and is called OR-precedence. In order for a job to start, we require that at least one of its predecessors is completed - in contrast to all its predecessors. Additionally, we assume that each job has a release date before which it must not start. We prove that Graham's algorithm has an approximation guarantee of 2 also in this setting, and present a polynomial-time algorithm that solves the problem to optimality, if preemptions are allowed. The latter result is in contrast to classical precedence constraints, for which Ullman (1975) showed that the preemptive variant is already NP-hard. Our algorithm generalizes a result of Johannes (2005) who gave a polynomial-time algorithm for unit processing time jobs subject to OR-precedence constraints, but without release dates. The performance guarantees presented here match the best-known ones for special cases where classical precedence constraints and OR-precedence constraints coincide.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

In this paper, we consider the problem of scheduling jobs with OR-precedence constraints on uniform parallel machines to minimize the total length of the project. Let be the set of jobs and be the number of machines. Each job is associated with a processing time and a release dates . The precedence constraints are given by a directed graph . The set of predecessors of a job is .

A schedule is an assignment of the jobs in to the machines such that (i) each job is processed by a machine for units of time, and (ii) each machine processes only one job at a time. Depending on the problem definition, jobs may be allowed to preempt and continue on a different machine (preemptive scheduling) or not (non-preemptive scheduling). The start time and completion time of job are denoted by and , respectively. Note that and equality holds if job is not preempted.

A schedule is called feasible, if (i) , and (ii) for all jobs . A job without predecessors may start at any point in time . In other words, every job with predecessors requires that at least one of its predecessors is completed before it can start, and no job may start before it gets released. A job is called available at time , if and, unless , there is with . Our goal is to determine a feasible schedule that minimizes the makespan, which is defined as . In an extension of the notation in [Johannes2005] and the three-field notation of Graham et al. [GrahamLawlerLenstraKan1979], the preemptive and non-preemptive variant of this problem are denoted by and , respectively.

From now on we assume w.l.o.g. that all processing times and release dates of jobs in are positive and non-negative integers, respectively. Note that this can be done by suitable scaling and that any job with zero processing time may be disregarded. As discussed below, the non-preemptive problem is NP-hard, which is why we are interested in approximation algorithms. Let be a minimization problem, and . Recall that a -approximation algorithm for is a polynomial-time algorithm that returns a feasible solution with objective value at most times the optimal objective value.

Non-Preemptive Scheduling.

Garey and Johnson [GareyJohnson1978] proved that the non-preemptive variant is already strongly NP-hard in the absence of precedence constraints and release dates. It remains NP-hard, even if the number of machines is fixed to  [LenstraKanBrucker1977]. In his seminal paper, Graham [Graham1966] showed that a simple algorithm called List Scheduling achieves an approximation guarantee of :

Consider the jobs in arbitrary order. Whenever a machine is idle, execute the next available job in the order on this machine. If there is no available job, then wait until a job completes.

If the jobs are sorted in order of non-increasing processing times, then List Scheduling is a -approximation [Graham1969] and -approximation [ChenVestjens1997] in the absence and presence of non-trivial release dates, respectively. Hochbaum and Shmoys [HochbaumShmoys1988] presented a (-approximation for , which was improved in running time to the currently best-known by Jansen [Jansen2010]. Mnich and Wiese [MnichWiese2015] showed that is fixed parameter tractable with parameter .

In contrast to OR-precedence constraints that are considered in this paper, the standard precedence constraints, where each job requires that all its predecessors are completed, will be called AND-precedence constraints. Minimizing the makespan with AND-precedence constraints is strongly NP-hard, even if the number of machines is fixed to and the precedence graph consists of disjoint paths [DuLeungYoung1991]. List Scheduling is still 2-approximate in the presence of AND-precedence constraints if the order of the jobs is consistent with the precedence constraints [Graham1966, Graham1969]. The approximation factor can also be preserved for non-trivial release dates [HallShmoys1989]. Assuming a variant of the Unique Games Conjecture [Khot2002] together with a result of Bansal and Khot [BansalKhot2009], Svensson [Svensson2010] proved that this is essentially best possible.

If the precedence constraints are of AND/OR-structure and the precedence graph is acyclic, then the problem without release dates still admits a -approximation algorithm [GilliesLiu1995]. Erlebach, Kääb and Möhring [ErlebachKaabMohring2003] showed that the assumption on the precedence graph is not necessary. Both results first transform the instance to an AND-precedence constrained instance by fixing a predecessor of the OR-precedence constraints. Then they solve the resulting instance with AND-precedence constraints using List Scheduling. Our first result shows that the makespan of every feasible schedule without unnecessary idle time on the machines is at most twice the optimal makespan, even if non-trivial release dates are involved.

Theorem 1.

List Scheduling is a -approximation for .

The proof of Theorem 1 is contained in Section 3. The key ingredient for proving the performance guarantee is a novel concept of minimal chains that we introduce in Section 2. Informally the length of the minimal chain of job with respect to (w.r.t.) a subset of jobs is the amount of extra time we need to complete , provided that the jobs in are already fixed in the schedule. The minimal chain of w.r.t.  is the set of jobs in that have to be processed in order to complete in that time.

Preemptive Scheduling.

If preemptions are allowed the algorithm of McNaughton [McNaughton1959] computes an optimal schedule in the absence of release dates and precedence constraints. Ullman [Ullman1975] showed that the problem with AND-precedence constraints is NP-hard, even if all jobs have unit processing time. Note that if for all jobs , then there is no benefit in preemption. This implies that the preemptive problem with AND-precedence constraints is also NP-hard. However, the preemptive variant becomes solvable in polynomial time for certain restricted precedence graphs. Precedence graphs that consist of outtrees are of special interest to us, since then AND- and OR-precedence constraints coincide.

A number of polynomial-time algorithms were proposed for AND-precedence constraints in form of an outtree. Hu [Hu1961] proposed the first such algorithm for unit processing time jobs, and Brucker, Garey and Johnson [BruckerGareyJohnson1977] presented an algorithm that can also deal with non-trivial release dates. Muntz and Coffman [MuntzCoffman1970] gave a polynomial-time algorithm, if preemptions are allowed. The algorithm of Gonzalez and Johnson [GonzalezJohnson1980] has an asymptotically better running time and uses fewer preemptions than the one in [MuntzCoffman1970]. Finally Lawler [Lawler1982] proposed a polynomial-time algorithm for the preemptive variant that can deal with non-trivial release dates, if the precedence graph consists of outtrees.111Note that Lawler’s algorithm [Lawler1982] generalizes those of [Hu1961, MuntzCoffman1970, BruckerGareyJohnson1977, GonzalezJohnson1980].

For general OR-precedence constrained unit processing time jobs, Johannes [Johannes2005] presented a polynomial-time algorithm that is similar to Hu’s algorithm [Hu1961]. We improve on this result by analyzing the structure of an optimal solution of . More precisly, we show that there is an optimal preemptive schedule where each job is preceded by its minimal chain. We then exploit this structure to transform the instance into an equivalent AND-precedence constrained instance, where we can apply known algorithms of e.g. [Hu1961, MuntzCoffman1970, BruckerGareyJohnson1977, GonzalezJohnson1980, Lawler1982]. Thereby we obtain our second result. The proof is contained in Section 4.

Theorem 2.

can be solved to optimality in polynomial time.

Since there is no need to preempt if for all , we immediately obtain the following corollary. This generalizes the aforementioned result of [Johannes2005].

Corollary 3.

can be solved to optimality in polynomial time.

2 Preliminaries and Minimal Chains

In order to simplify some arguments, we introduce a dummy job with that shall precede all jobs. That is, we assume that the set of jobs is , and introduce an arc for all with in the precedence graph . Note that there is a feasible schedule, if and only if every job is reachable from in . In particular, we can decide in linear time, e.g. via breadth-first-search, whether there exists a feasible schedule. Henceforth, we will assume that the instances we consider admit a feasible schedule.

Note that is a generalization of which is already strongly NP-hard [GareyJohnson1978]. If is an outtree rooted at , then OR- and AND-precedence constraints are equivalent. The NP-hardness result of Du, Leung and Young [DuLeungYoung1991] implies that the problem remains strongly NP-hard, even if the number of machines is fixed.

Observation 4.

is strongly NP-hard for all .

In order to analyze the performance of our algorithms, we use the concept of so-called minimal chains. For these we first need the notion of feasible starting sets. A set with is called feasible starting set, if all jobs in are reachable from in the induced graph . The set of feasible starting sets is denoted by . In some sense, feasible starting sets can be seen as the counterpart of ideals for AND-precedence constraints, i.e. a subset of jobs that is closed under precedence constraints. For a general subset and job we define the length of its minimal chain as

(1)

Intuitively, the value is the amount of time that we need at least to schedule job in a feasible way, if we can schedule the jobs in for free, i.e. if we assume all jobs in

have zero processing time. Here, we ignore release dates for the moment. We call

a minimal chain of w.r.t. . Note that is non-increasing, i.e.  for all and . Further implies , and there always exists a minimal chain with .

The value equals the length of a shortest path from to in , if we impose weights of and on all arcs for and , respectively. We call this weighted digraph . If for a suitable ordering of the jobs in , then for all . In other words, if job is contained in a minimal chain , then the jobs preceding in form a minimal chain of . Henceforth, we will use the notation interchangeably for the set of all minimal chains of w.r.t. S and their length. If the set is clear from the context, we will also just speak of a minimal chain of without specifying . Figure 1 illustrates the minimal chains of a job w.r.t. two different sets in the corresonding weighted digraphs.

Figure 1: Weighted digraphs (left) and (right). The thick arrows correspond to the paths of the minimal chains and of w.r.t. the empty set and , resp.

In the following, we denote the completion times in an optimal schedule by (for ) and its makespan by . Also, we will sometimes denote an optimal schedule by and the schedule with completion times (for ) by . There are two trivial lower bounds on the optimal makespan. First, any feasible schedule cannot do better than splitting the total processing load equally among all machines, so . Second, every job requires at least one of its predecessors to be completed before it can start. If we start with an empty schedule, the earliest completion time of job is by definition equal to the length of its minimal chain w.r.t. the empty set. Thus, .

3 List Scheduling Without Preemptions

Erlebach et al. [ErlebachKaabMohring2003] presented a 2-approximation algorithm for minimizing the makespan with AND/OR-precedence constraints. The algorithm transforms the instance to an AND-instance by fixing an OR-predecessor for each job, and then applies List Scheduling. We show that List Scheduling without transforming the instance is already -approximate for OR-precedence constraints, even with non-trivial release dates. The proofs in this section are similar to [HallShmoys1989]. Since we consider OR-precedence constraints, we need the notion of minimal chains to bound the amount of idle time on the machines. First we prove the performance guarantee of 2 in the absence of non-trivial release dates. Then we extend the definition of minimal chains to release dates and prove Theorem 1.

Lemma 5.

List Scheduling is a -approximation for .

Proof.

Consider the schedule returned by List Scheduling, and let and be the start and completion time of job . Let be the job that completes last, i.e. . Let be the union of all time intervals where some machine is idle. If , then all machines are busy before time with jobs in . Hence

So suppose with disjoint intervals . Enumerate the intervals such that for all , and set and . To simplify notation, let contains a directed --path be the set of jobs from which is reachable in . Note that for all .

Recall that whenever a machine is idle, List Scheduling executes the next available job in the list. For , let be the set of jobs that run at time on some machine. Note that . So all jobs with have to wait for some jobs in before they can start. That is, for every such job and any it holds , or and has to wait as well for its predecessors.

Note that is not available at any point in time . That is, has to wait for some with to be completed. Either this job starts before the idle time interval , i.e. , or itself waits for some other job with , and so on. Let be a job in this sequence with . Note that , respectively the non-overlapping intervals in which they are processed, cover . If , then has to wait for a job . Iteratively repeating this argument, we can construct a sequence of jobs such that for all and :

  1. and

  2. if , then and

  3. if , then and .

The first condition states that starts before the interval , and completes after the interval , but before starts. The second and third condition describe the case that starts within an interval or between two intervals and , respectively. Then starts as soon as one of its predecessors completes (and thereby becomes available) or there is that is processed during (parts of) , respectively. Such a sequence of jobs exists, otherwise we could schedule jobs earlier on a machine during its idle time. By construction, no jobs of the sequence run simultaneously and together they, respectively the intervals in which they are processed, cover . There may be several possibilites for , but every such sequence is contained in a directed path in from to . Let be the set of jobs that complete before time and are not processed during any idle interval in . Note that , and that we can choose the sequence , see Figure 2.

Figure 2: Sequence of jobs covering the idle time (shaded rectangles). The jobs in are depicted in gray. The arrows indicate the corresponding path in from to .

Let be the union of all time intervals in which a job of is processed. During all machines are busy with jobs in by construction. Note that implies . Thus

In order to incorporate non-trivial release dates in the analysis of Lemma 5, we have to extend the notion of minimal chains, because of the following problem. Consider three jobs and one machine. Let , , , , and . By definition, the unique minimal chain of w.r.t. the empty set is with a length of . However, if we schedule and then , the completion time of equals due to the release date of . If we would first schedule and then , the completion time of is equal to .

So our current definition of minimal chains cannot cope reasonably with release dates. To circumvent this problem, we adapt the definition of minimal chains with the means of a time expanded network. Recall that all processing times and release dates are non-negative integers. Let be a suitably large positive integer. We transform the precedence graph to a time expanded network as follows.

Besides a dummy job , the node set contains copies of every job, i.e. . The arc set is constructed as follows: for every and , there is an arc . The dummy node is connected to all jobs with via the arcs for all . Finally, we introduce waiting arcs for all and . The purpose of waiting arcs is to simulate idle time, when a job has not been released yet. The weight of each arc is the time difference between its start and end node, i.e.  has weight and has weight . (Note that no arcs in go “back in time”.) Figure 3 depicts for the above example. For simplicity, all nodes (and arcs) for , which are not reachable from the dummy node , are omitted.

Figure 3: OR-precedence graph (left) and the (reduced) time expanded network for (right).

Let . In order to compute minimal chains w.r.t.  as shortest paths, we adapt the weights of the arcs in similar to before. For , set the weight of to for all , and set the weight of to zero for all , . All other weights on arcs for or remain equal to the time difference . In particular, the weights on the waiting arcs remain equal to 1. The resulting weighted digraph is denoted by . We define for to be the length of a shortest path from to in among all for which such a path exists. That is,

(2)

The jobs in whose copies in are visited by the path are called a minimal chain of w.r.t. . Again, we interchangeably use for the set of minimal chains and their lengths. Note that a minimal chain in is not necessarily equal to a minimal in the original graph , as the example above indicates. If all release dates are equal to zero, then definitions (1) and (2) coincide, so (2) indeed extends (1) to release dates.

It is important to note that the weights of waiting arcs in remain equal to 1 for all and . If the path corresponding to a minimal chain uses such an arc, then this corresponds to idle time, i.e. we have to wait until a job gets released. As before, can be interpreted as the additional time needed to schedule , if we want to schedule the set anyways. Note that for all , , and , if . One can easily verify that for all .

Now we are able to prove Theorem 1. For completeness, we repeat its statement and recall that List Scheduling can be done in polynomial time. (We only need the time expanded network for the analysis.)

Theorem.

List Scheduling is a -approximation for .

Proof.

Consider the schedule returned by List Scheduling and let and be the start and completion time of job . Let be the job that completes last, i.e. . If there is no idle time in or all jobs have release date equal to zero, then the statement follows with Lemma 5. So suppose that there is idle time with disjoint intervals . Enumerate the intervals such that for all , and set and . Let be the jobs that complete before and are not processed during any idle interval.

During , jobs in are not yet released or have to wait for a predecessor (possibly not in ) to complete. Consider a shortest path in from to any copy of of length . All arcs on this path that contribute to the value of , i.e. that have positive weight in , are either waiting arcs or correspond to a job of a minimal chain that is processed during the idle time . Note that a shortest path in would only use waiting arcs, if some job in the minimal chain is not released yet.

Write and let be a minimal chain of w.r.t. . Enumerate the jobs such that . If , then there is a job () whose release date dominates the minimal chain. That is, there is a point in time such that a predecessor of is completed at time , but . (In other words, if we would ignore the release dates, then would be available at time , and could possibly be scheduled earlier.) Let be minimal such that dominates the minimal chain, i.e.  and , and recall that .

Let be the union of all time intervals before where a job in is processed or the dominating job is not released yet. W.l.o.g., we can assume that during at least one machine is busy. During all machines are busy with jobs other than . Recall that jobs complete before time , so the total processing load in is less or equal than . Thus, and

Corollary 6.

List Scheduling solves to optimality.

4 A Polynomial-Time Algorithm for Special Cases

In this section, we consider the preemptive problem and prove Theorem 2. Recall that all processing times and release dates of jobs in are positive and non-negative integers, respectively. So preemptive and non-preemptive scheduling of unit processing time jobs are equivalent, since there is no need to preempt, which proves Corollary 3.

In contrast to the non-preemptive instance, an optimal preemptive schedule will never have idle time, if there are available jobs. Without preemption, it could make sense to wait for some job to finish (i.e. have idle time), although there is an available job . The reason might be that we want to process a successor of rightaway. However, if we allow preemption, then we could just schedule a fraction of , and once completes, we preempt and process .

We first derive some necessary notation, and then present a polynomial-time algorithm that computes an optimal preemptive schedule. Fix for all . The collection of minimal chains is called closed, if implies for all . Note that we can always choose for all , since (informally) subpaths of shortest paths are shortest paths. Hence, if we compute minimal chains , we may assume that is closed. We say an arc is in line with the minimal chain if . Recall that all processing times are strictly positive and . So if is in line with then .

Our algorithm, which we refer to as AlgoPmtn, works as follows. First, compute a closed collection of minimal chains . Then, transform the instance to an instance with AND-precedence constraints by deleting all arcs that are not in line with . (Note that the resulting graph is an outtree.) Now, apply a polynomial-time algorithm for the resulting AND-instance to compute an optimal preemptive schedule. (Recall that we can compute optimal preemptive schedules for these special cases in polynomial time, see e.g. [Hu1961, MuntzCoffman1970, BruckerGareyJohnson1977, GonzalezJohnson1980, Lawler1982]. We use the algorithm of Lawler [Lawler1982], but instead, depending on the setting, we could also use any of the other algorithms.)

We prove that AlgoPmtn works correctly by analyzing the structure of an optimal preemptive schedule. More precisly, we show that for any closed collection of minimal chains, there is an optimal preemptive schedule that is feasible for the transformed graph . Before we are able to prove Theorem 2, we need some additional notation.

If jobs are allowed to preempt, we need to “keep track” how much of the minimal chain of a job is already processed at every point in time. To formalize this, we split every job into jobs of unit processing time. The predecessors of these jobs are and for all . The release dates are for all and . As before, we add a dummy job with and if for . We refer to this instance as the preemtive instance and denote the set of jobs by .

Note that, if all jobs have unit processing time, then . We informally extend definition (1) of to fractions of jobs via the original definition on the preemptive instance. Note that (the lengths of) all minimal chains coincide with the non-preemptive instance. In particular, all lower bounds on the makespan are still valid, and implies for all . Since minimal chains in the non-preemptive and preemptive instance coincide, is closed iff is closed. Two distinct jobs are called inverted w.r.t. the closed collection of minimal chains in the schedule , if and . Let be the number of inversions in the schedule .

Lemma 7 describes a procedure that swaps two jobs that are scheduled consecutively. We will apply this procedure to show that there always exists an optimal solution without inversions (see Lemma 8). For the notation of Lemma 7, we forget about release dates, i.e. consider schedules for . We describe how to incorporate release dates in the proof of Lemma 8, which is the key lemma for the correctness of AlgoPmtn.

Lemma 7.

Let be a closed collection of minimal chains and be a feasible preemptive schedule. The machine on which is scheduled in is denoted by . Let with , and let be the jobs scheduled directly before . Assume that and that there are no inversions before time in the schedule . Further let for all .222So moving to the slot does not violate its precedence constraint or cause an inversion. Then there is such that setting

  1. , and for all

  2. , and for all

yields an feasible preemptive schedule with and .

Proof.

Note that the makespan does not change if we swap two jobs of unit processing time. So it remains to show feasibilty of and that no additional inversions are created. To shorten notation, let . We want to move into the slot , and we know that the predecessor of in completes before time .

Let and be the jobs running in parallel to on the other machines. Note that , and recall that are the jobs running directly before on any machine and . Let and let be the set of these predecessors for . We would not want to swap with any job in , since this would cause an inversion. By assumption, there are no inversions before time in . So for all and thus . Let and . Then , so .

We show that any satisfies the claim. So let be arbitrary and let be the resulting schedule after swapping and according to i) and ii). Figure 4 illustrates the sets and the corresponding schedules. Feasibility of implies that at any point in time at most jobs are processed in . It remains to show that the precedence constraints are satisfied and that no additional inversions are created. Let for all and be the set of jobs that complete before starts in the respective schedules.