J Sched (2011) 14: 27–38 DOI 10.1007/s10951-010-0190-0
Scheduling jobs with equal processing times subject to machine eligibility constraints Kangbok Lee · Joseph Y.-T. Leung · Michael L. Pinedo
Published online: 31 July 2010 © Springer Science+Business Media, LLC 2010
Abstract We consider the problem of nonpreemptively scheduling a set of n jobs with equal processing times on m parallel machines so as to minimize the makespan. Each job has a prespecified set of machines on which it can be processed, called its eligible set. We consider the most general case of machine eligibility constraints as well as special cases of nested and inclusive eligible sets. Both online and offline models are considered. For offline problems we develop optimal algorithms that run in polynomial time, while for online problems we focus on the development of optimal algorithms of a new and more elaborate structure as well as approximation algorithms with good competitive ratios. Keywords Parallel machine scheduling · Eligibility constraint · Nested and inclusive eligible sets · Equal-processing-time jobs · Online and offline scheduling · Makespan · Competitive ratio · Worst-case ratio
K. Lee’s work supported by the Korea Research Foundation Grant KRF-2007-357-D00270. J.Y.-T. Leung’s work supported in part by NSF Grant DMI-0556010. M.L. Pinedo’s work supported in part by NSF Grant DMI-0555999. K. Lee · M.L. Pinedo Department of Information, Operations & Management Sciences, Stern School of Business, New York University, 44 West 4th Street, New York, NY 10012-1126, USA K. Lee e-mail:
[email protected] M.L. Pinedo e-mail:
[email protected] J.Y.-T. Leung () Department of Computer Science, New Jersey Institute of Technology, Newark, NJ 07102, USA e-mail:
[email protected] 1 Introduction We consider the problem of scheduling a set of n independent jobs on m parallel machines without preemption so as to minimize the latest completion time of all jobs, referred to as the makespan and denoted by Cmax . The set of jobs is denoted by I = {1, 2, . . . , n} and the set of machines is denoted by M = {1, 2, . . . , m}. There are three different machine environments that depend on the structure of the processing time of job j on machine i, denoted by pij . In the identical machine environment, pij is defined by the job-dependent value pj and in the uniform machine environment pij is defined by pj /si , where si is the speed of machine i. For the unrelated machine environment, pij can be any arbitrary value. Following the notation of Pinedo (1995), the problem to minimize the makespan on identical machines, uniform machines, and unrelated machines can be denoted by P Cmax , Q Cmax , and R Cmax , respectively. The makespan minimization problem on parallel machines is one of the most fundamental and well-studied problems in deterministic scheduling theory; see Chen et al. (1998) for a survey. Recently, researchers have turned their attention to the more general problem in which each job j has a prespecified set Mj ⊆ M of machines on which it can be processed; set Mj is called the eligible set of job j . The reader is referred to a recent survey by Leung and Li (2008). It is clear that the classical problem is a special case of this more general problem; in the classical problem Mj = M for all j . According to the notation of Pinedo (1995), P | Mj | Cmax , Q | Mj | Cmax , and R | Mj | Cmax refer to the problem with eligibility constraints on identical machines, uniform machines, and unrelated machines, respectively. Note that these are special cases of R Cmax since we can set the processing time of job j on machine i to be ∞ if machine i is not in Mj ; otherwise, the processing time is pj , pj /si , or pij .
28
Two special cases of eligibility constraints have also been studied, namely, the case of nested eligible sets and the case of inclusive eligible sets. The case of nested eligible sets refers to the setting where for all i and j , Mi and Mj are either disjoint, or Mi ⊆ Mj , or Mj ⊆ Mi . Inclusive eligible sets is a special case of nested eligible sets where for all i and j , either Mi ⊆ Mj , or Mj ⊆ Mi . We use P | Mj (nested) | Cmax and P | Mj (inclusive) | Cmax to denote nested and inclusive eligible sets in an identical machine environment, respectively. The reader is referred to Leung and Li (2008), Ou et al. (2008), Glass and Kellerer (2007), and Glass and Mills (2006) for a discussion of the applications of these two special cases. In this paper, we consider offline and online scheduling of jobs with equal processing times without preemptions. In the literature, online scheduling has been studied within two different frameworks, namely online scheduling one by one and online scheduling over time. In online scheduling one by one, all jobs can be scheduled at any time point, but they are given to the scheduler one at a time at time t = 0. A job needs to be scheduled immediately once it is given to the scheduler, and the scheduling decision is irrevocable. Thus, the scheduler only knows the information of the current job, while it does not know any information of the next job or even its existence. In online scheduling over time, the jobs have different release times, but the scheduler has no information about the jobs’ release times. The scheduler only knows about the job at its release time. When a job arrives, the scheduler does not have to schedule the job immediately, and it may wait for the next job. Therefore, at any moment of time, the scheduler may have several unscheduled jobs. Note that the former is not a special case of the latter and vice versa. While online scheduling one by one subject to eligibility constraints has been studied in the literature in the context of parallel machine scheduling or load balancing, online scheduling over time subject to eligibility constraints has not received much research attention. In this paper we are concerned with online scheduling over time only. While most parallel machine scheduling problems with arbitrary processing time jobs are NP-hard, the complexity of the problems with equal processing time jobs is not trivial, and there have been many research works on this topic (Simons 1983; Brucker and Kravchenko 2008; Kravchenko and Werner 2009). Thus, in a theoretical sense, it is valuable to find a borderline between NP-hard cases and polynomially solvable cases. Furthermore, in practice, jobs may not be different from each other in processing times, but in eligible sets; for example, network packets always have the same lengths. Throughout the paper, the common processing time is denoted by p and jobs may have distinct release dates. We assume that all release dates and processing times are integers. Thus, the problem we are studying is denoted by P | Mj , rj , pj = p | Cmax . We also consider
J Sched (2011) 14: 27–38
the special case where p = 1, called the unit processing time case. To evaluate the performance of an algorithm, we use the worst-case performance ratio and the competitive ratio for offline problems and online problems, respectively. Let an optimal schedule be denoted by σ ∗ and the schedule generated by the algorithm in context be denoted by σ . The makespan under the optimal schedule σ ∗ and that under schedule σ are denoted by Cmax (σ ∗ ) and Cmax (σ ), respecmax (σ ) tively. For offline problems, if CCmax (σ ∗ ) ≤ ρ, then we say that the algorithm is a ρ-approximation algorithm. For online problems, if Cmax (σ ∗ ) is the makespan of an optimal offline max (σ ) schedule and CCmax (σ ∗ ) ≤ ρ, then we say that the algorithm is a ρ-competitive algorithm. For offline problems, since P Cmax is strongly NP-hard (Garey and Johnson 1978), P | Mj | Cmax , P | Mj (nested) | Cmax and P | Mj (inclusive) | Cmax are all strongly NP-hard as well. Lenstra et al. (1990) provided a 2-approximation algorithm for R Cmax , and showed that there is no 32 approximation unless P = NP. Since P | Mj | Cmax is a special case of R Cmax , the 2-approximation algorithm will work for P | Mj | Cmax as well. Shchepin and Vakhania (2005) gave a slight improvement to 2 − m1 . The prospect of a better approximation is a lot brighter for inclusive eligible sets. For P | Mj (inclusive) | Cmax , Hwang et al. (2004) presented a list scheduling algorithm with a sorting of the jobs in increasing order of flexibility and then in decreasing order of processing times; they showed that their algo1 for rithm has a tight bound of 54 for m = 2 and of 2 − m−1 m ≥ 3. Later, Glass and Kellerer (2007) presented another algorithm with an improved bound of 32 for all m. More recently, Ou et al. (2008) developed a bin-packing type algorithm and showed that it has a bound of 43 + , where is a given real number larger than zero. Ou et al. (2008) also provided a polynomial time approximation scheme (PTAS) for the problem. For P | Mj (nested) | Cmax , Glass and Kellerer (2007) proved that a list scheduling algorithm has a performance ratio of 2 − m1 . Recently, Huo and Leung (2010) gave a bin-packing type algorithm with a performance ratio of 7 4 + , where is a given real number larger than zero; their algorithm has a better performance bound of 54 for m = 2 and of 32 for m = 3. Azar et al. (1995) considered the scheduling problem with arbitrary eligibility constraints and showed that a simple list scheduling algorithm has a competitive ratio of 1 + log2 m . Moreover, Azar et al. (1995) showed that log2 (m + 1) is a lower bound (assuming the online one by one scheduling model); i.e., any deterministic online algorithm must have a competitive ratio of at least log2 (m + 1) even for the case where all jobs have unit processing time. Later, Bar-Noy et al. (2001) considered the inclusive eligible set case. Bar-Noy et al. (2001) gave an online algorithm that is (e + 1)-competitive; the algorithm is e-competitive if the processing times are equal.
J Sched (2011) 14: 27–38
For a set of unit length jobs, Pinedo (1995) showed that the Least Flexible Job first rule solves P | Mj (nested), pj = 1 | Cmax . Lin and Li (2004) gave a network-flow type of algorithm to solve P | Mj , pj = 1 | Cmax ; their algorithm can solve Q | Mj , pj = 1 | Cmax as well. Li (2006) later extended their idea and gave a matching-type algorithm to solve the same problem with a reduced running time; Li (2006) also provided polynomial time algorithms for prob w j Tj , lems with different objectives such as w j Cj , and wj Uj , where wj is the weight associated with job j , Tj is defined by max{0, Cj − dj }, and Uj is 1 if Tj > 0, and 0 otherwise. Brucker et al. (1997) gave an -approximation algorithm for P | Mj , pmtn, rj | Lmax . Brucker et al. (1997) also considered other machine environments such as open shops, flow shops, and job shops. Jobs with release dates and eligible sets have seldom been studied in the literature. A few experimental results can be found in some papers; see for example, Centeno and Armacost (2004) and Leung and Li (2008). For a set of unit length jobs, Brucker et al. (1997) gave polynomial time algorithms for P | Mj , rj , pj = 1 | wj Tj and P | Mj , rj , pj = 1 | wj Uj . However, the complexity of the problem with equal processing times and release dates has not yet been resolved. In Sect. 2, we consider offline and online scheduling of jobs with unit length. For the offline problem, we discuss the Least Flexible Job first (LFJ) algorithm that is optimal for nested eligible sets. We show how poorly LFJ can perform when we have arbitrary eligible sets. For the online problem with arbitrary eligible sets, we prove that any deterministic algorithm has a competitive ratio of at least 32 . In Sect. 3, we deal with offline scheduling of jobs that have equal processing times and different release dates. We develop an optimal algorithm that runs in polynomial time, based on an assignment algorithm. In Sect. 4, we consider online scheduling of jobs with equal processing times. If we restrict the eligibility to the nested case, then there is an algorithm with an absolute error of p. We also consider online scheduling problems with two machines subject to arbitrary eligibility constraints and subject to inclusive eligibility constraints. For both problems, we present lower bounds and provide online algorithms with competitive ratios that match the lower bounds. This implies that our algorithms are optimal. For the case of inclusive eligibility, we devise a new type of algorithm that uses two different delay rules of which the application depends on the status of the current schedule and the time when a job is assigned to a machine. In Sect. 5, we summarize our results and discuss related problems that seem to be interesting. In the paper, we use the following notation. The starting time and completion time of job j in schedule σ are denoted by Sj and Cj , respectively. If jobs a and b are scheduled one after another on the same machine and Ca = Sb , we say that
29
job a is scheduled right before job b and job b is scheduled right after job a.
2 Offline and online scheduling of unit processing time jobs In this section we first consider the offline case with the jobs being unit length. As noted in Sect. 1, most problems can be solved in polynomial time, including minimizing the makespan, the total weighted completion time, the total weighted tardiness, and the total weighted number of late jobs. Moreover, Pinedo (1995) showed that a simple algorithm, referred to as the Least Flexible Job first (LFJ) rule, solves P | Mj (nested), pj = 1 | Cmax as well. We investigate the performance of the LFJ algorithm when it is applied to the problem with arbitrary machine eligibility constraints. The Least Flexible Job first (LFJ) Rule: Whenever a machine becomes available, select job j with the smallest |Mj | from among all those jobs that can be assigned to that machine. Ties may be broken arbitrarily. While the LFJ algorithm is optimal for P | Mj (nested), pj = 1 | Cmax , it can perform very poorly for P | Mj , pj = 1 | Cmax , as the following example shows. Suppose that m = 2k for some positive integer k. There are m jobs and all jobs are unit length and eligible on only two machines. The detailed information of the jobs is as follows:
Group
No. of jobs
Eligible sets
1
m/21
{i, m/2 + i} for i = 1, . . . , m/2
2 .. .
m/22 .. .
{i, m/22 + i} for i = 1, . . . , m/22 .. .
k−1
m/2k−1
{i, m/2k−1 + i} for i = 1, . . . , m/2k−1
k
m/2k
{i, m/2k + i} for i = 1, . . . , m/2k
k+1
1
{1, 2}
In an optimal schedule, jobs in group k are assigned to
machines from m/2k + 1 to m/2k −1 for k = 1, . . . , k and the job in group k + 1 is assigned to machine 1. Thus, the optimal makespan is unity. However, if we assign jobs in nondecreasing order of their group and break ties by choosing the machine with the smaller index, the makespan ends up to be log2 m. So LFJ may perform very poorly for the problem with arbitrary eligibility constraints. Figure 1 shows the two schedules when m = 24 . We now consider online scheduling of jobs with jobs arriving over time. We show that we cannot have a 1-competitive algorithm for arbitrary eligibility sets, but we
30
J Sched (2011) 14: 27–38
Fig. 1 A lower bound example of LFJ for P | Mj , pj = 1 | Cmax
can have a 1-competitive algorithm for nested eligible sets. The next lemma shows that any online algorithm must have a competitive ratio of at least 32 . Lemma 1 Any online algorithm for P | Mj , rj , pj = 1 | Cmax must have a competitive ratio of at least 32 . Proof We prove the lemma by an adversary argument. At time t = 0, m − 1 groups of jobs arrive and each group has two identical jobs. The jobs in group k, 1 ≤ k ≤ m − 1, can be processed only on machines 1 and k + 1. At time t = 1, there is at least one group that has an unscheduled job by the algorithm. Let the group be k . Then we release two jobs at time t = 1 and both jobs have eligible sets {1, k + 1}. Clearly, the algorithm will have a makespan of three time units since there are three jobs that need machines 1 and k + 1 at time t = 1. However, the optimal makespan is just two units. We now consider online scheduling of jobs with different release dates and nested eligible sets; i.e., P | Mj (nested), rj , pj = 1 | Cmax . Recall that release dates are integral values. The LFJ algorithm can be viewed as an online algorithm, and hence it is 1-competitive for P | Mj (nested), rj , pj = 1 | Cmax . The proof is almost identical to that given in Pinedo (1995) to which we refer the interested reader. Lemma 2 The LFJ algorithm is 1-competitive for online P | Mj (nested), rj , pj = 1 | Cmax .
3 Offline scheduling of jobs with equal processing times In this section, we consider offline scheduling of jobs with equal processing times and different release dates; i.e., pj = p for all 1 ≤ j ≤ n. This problem is denoted as P | Mj , rj , pj = p | Cmax . First, if the jobs have identical release dates, then P | Mj , pj = p | Cmax has the same time complexity as P | Mj , pj = 1 | Cmax , and hence can be solved in O(n2 (m + log n) log n) time by a network flow algorithm (Li 2006). On the other hand, if the jobs have unit length but arbitrary release dates, then P | Mj , rj , pj = 1 | γ can be solved by an algorithm due to Brucker et al. (1997) in O(n2 m(n + log m)) time when γ is either the total weighted number of tardy jobs or the total weighted
tardiness. Since the algorithm to minimize the total number of tardy jobs can be used to solve the makespan minimization problem, P | Mj , rj , pj = 1 | Cmax can be solved in polynomial time as well. However, the complexity of P | Mj , rj , pj = p | Cmax was not previously known. In this section, we give a polynomial-time algorithm for this problem. First, we present the following lemma. Lemma 3 The optimal makespan of P | Mj , rj , pj = p | Cmax is of the form rj + kp for some job j ∈ I and for some integer k ∈ {1, 2, . . . , n}. Proof Suppose the optimal makespan is not equal to rj + kp for some job j ∈ I and for some integer k ∈ {1, 2, . . . , n}. ¯ Consider an optimal schedule and a set of machines, M, which determines the makespan in the optimal schedule. ¯ There must be a sequence of Let i be any machine in M. jobs that is processed contiguously and that determines the makespan. Let I¯i be the maximal sequence of jobs scheduled on machine i. If there is an idle time on machine i before the first job in I¯i , then we define bi to be the length of the idle time; otherwise, we define bi to be ∞. By our definition, bi is strictly positive. Let δi = min{bi , min{Sj − rj |j ∈ I¯i }}. From the fact that Sj − rj > 0 for each j ∈ I¯i , it follows that δi is strictly positive. We can reschedule all jobs in I¯i to be δi units earlier, without violating any release time constraint. ¯ we If we apply the same procedure to each machine in M, can reduce the makespan. This contradicts the fact that the original schedule is optimal. Theorem 4 The problem P | Mj , rj , pj = p | Cmax can be solved in O(m3/2 n5/2 log n) time. Proof Consider the set = {λ | λ = rj + kp, j ∈ I, k ∈ {1, . . . , n}}. Note that the cardinality of is bounded from above by n2 and that the optimal makespan T ∗ must be in by Lemma 3. Let the elements of be sorted in increasing order; i.e., λ1 < λ2 < · · · < λz , where z = ||. We will conduct a binary search for the optimal makespan T ∗ in set . Note that the number of iterations in the binary search is at most O(log(n2 )) = O(log n). For each target makespan T ,
J Sched (2011) 14: 27–38
we check if there is a feasible schedule with makespan T or less. The feasibility test is done through a bipartite graph matching algorithm as shown below. Suppose we are considering the target makespan T in . We can construct disjoint time slots of size p in the form of [T − kp, T − (k − 1)p], where k = 1, 2, . . . , min{n, Tp }. Let (i, k) be the kth slot on machine i and SLOT be the set of all defined slots, i.e., SLOT = {(i, k) | i = 1, 2, . . . , m, k = 1, 2, . . . , min{n, Tp }}. Note that |SLOT| ≤ mn. When job j is eligible on machine i and the starting time of slot (i, k) is greater than or equal to rj , we say that job j is feasible in slot (i, k). We construct a bipartite graph G = (V , E), where V = I ∪ SLOT
and
E = {(j, (i, k)) | j ∈ I, (i, k) ∈ SLOT, and job j is feasible in slot(i, k)}. It suffices to show that there exists a feasible schedule with a makespan not greater than T if and only if the maximum matching of this bipartite graph has value |I |. Obviously, if the maximum matching of the bipartite graph with T has value |I |, then the optimal makespan T ∗ is less than or equal to T . Now consider the case when T ≥ T ∗ . By Lemma 3, there exist a j ∗ and a k ∗ such that T ∗ = rj ∗ + k ∗ p for some j ∗ ∈ I and k ∗ ∈ {1, . . . , n}. Consider an optimal schedule S ∗ with makespan T ∗ . If there is a job whose starting time is not T ∗ − kp for some positive integer k, then we can start the job at time T ∗ − k p (for some positive integer k ), where T ∗ − k p is the smallest integer that is not less than its original starting time. The new schedule is also feasible and its makespan cannot exceed T ∗ . By repeatedly modifying the starting time of the jobs, we can obtain another optimal schedule such that each job starts at time T ∗ − kp for some positive integer k. Therefore, the maximum matching of the bipartite graph associated with value T always has the optimal objective function value |I | when T ≥ T ∗ . For the overall time complexity, note that the time √ complexity of a bipartite graph matching is O( |V ||E|) (Hopcroft and Karp 1973). The cardinality of V is bounded by |I | + |SLOT| ≤ n + mn = O(mn) and the cardinality of E is bounded by |I | × |SLOT| ≤ n × mn = O(mn2 ). Therefore, the time complexity of solving the bipartite graph matching is O(m3/2 n5/2 ). Since the number of iterations on the value T is O(log n), the overall time complexity is O(m3/2 n5/2 log n). We apply the same technique to the offline problem with uniform machine environment, namely, Q | Mj , rj , pj = p | Cmax . We assume that machine i has speed si , i.e., pij = pj /si = p/si .
31
Theorem 5 The offline problem Q | Mj , rj , pj = p | Cmax can be solved in time O(m3/2 n5/2 log nm). Proof Let = {λ | λ = rj + kp/si for j ∈ I, k = 1, . . . , n, and i ∈ M}. Thus, || ≤ n2 m. Using a similar argument as in Lemma 3, the number of iterations in the binary search for candidates with the optimal makespan is bounded by log2 || ≤ O(log(n2 m)) = O(log nm). For a target makespan value T , we can construct the set SLOT consisting of pairs of machines and disjoint time intervals that have size p/si on machine i of the form [T − (u)(p/si ), T − (u − 1)(p/si )] for u = 1, . . . , min{n, T /(p/si ) }. Using the same argument as in Theorem 4, |SLOT| ≤ mn and thus the feasibility check has time complexity O(m3/2 n5/2 ). Therefore, the time complexity of the overall algorithm is O(m3/2 n5/2 log nm). 4 Online scheduling of jobs with equal processing times In this section we consider online scheduling of jobs with equal processing times. Clearly, this is a more general case than the online scheduling of unit length jobs. Thus, Lemma 1 applies to the equal processing times case as well. 4.1 Arbitrary number of machines—nested eligibility For the special case of nested eligible sets, we use the fact that there is an online 1-competitive algorithm for P | Mj (nested), rj , pj = 1 | Cmax to obtain an online algorithm for P | Mj (nested), rj , pj = p | Cmax with an absolute error of at most p. Consider the problem where each job is released at a time t that is an integral multiple of p. This problem can be viewed as exactly the same problem as the case of unit length jobs. When a job arrives at a time that is not an integral multiple of p, we will delay it until the next integral multiple of p. At a time that is an integral multiple of p, we apply the LFJ algorithm to all the unscheduled jobs. We call this algorithm Discrete LFJ. Lemma 6 The online problem of P | Mj (nested), rj , pj = p | Cmax can be solved by the Discrete LFJ algorithm with an absolute error of at most p. Proof Consider a new problem instance I with release r dates rj = pj p. Thus, rj ≤ rj < rj + p. We can solve in
stance I optimally using the LFJ algorithm. Let the optimal schedule by the LFJ algorithm for I be σ . Consider the optimal schedule, σ ∗ , of the original instance, I . We can construct a schedule σ¯∗ by letting S¯j = S C pj p and C¯j = pj p. Since the gap between C¯j and Cj is at most p, Cmax (σ¯∗ ) < Cmax (σ ∗ ) + p. The schedule σ¯∗ is a feasible schedule for instance I . Since σ is an optimal schedule of I , Cmax (σ ) ≤ Cmax (σ¯∗ ) < Cmax (σ ∗ ) + p.
32
J Sched (2011) 14: 27–38
4.2 Two machines—arbitrary eligibility In this subsection we will consider the problem with two machines and arbitrary eligibility constraints. When there are only two machines, arbitrary eligible sets are equivalent to nested eligible sets. We will provide a lower bound through an example and present an optimal algorithm. Lemma 7 Any online algorithm for P 2 | M√ j , rj , pj = p | Cmax has a competitive ratio of at least (1 + 5)/2. Proof We will prove √ the lemma by an adversary argument. Let α be (−1 + 5)/2. At time t = 0, job 1 arrives with M1 = {1, 2}. Without loss of generality, we may assume that job 1 is assigned to machine 1 at time t = S1 . If S1 ≥ αp, then no more jobs arrive and we have Cmax (σ )/Cmax (σ ∗ ) ≥ (1 + α)p/p = 1 + α. On the other hand, if S1 < αp, then job 2 arrives at time t = S1 with M2 = {1}. Then, we have Cmax (σ ) = S1 + 2p and Cmax (σ ∗ ) = S1 + p. Thus, Cmax (σ ) S1 + 2p p = =1+ Cmax (σ ∗ ) S1 + p S1 + p >1+
1 = 1 + α, 1+α
which again shows that the competitive ratio is at least 1 + α. We consider an algorithm using release date modification. When a job eligible to machines 1 and 2 arrives, √ we modify its release date by increasing it by (−1 + 5)/2 times p. When a job eligible to machine 1 only or machine 2 only arrives, we keep its original release date. We define priorities among jobs in such a way that a less flexible job has a higher priority and when a tie occurs a job with a smaller modified release date has a higher priority. Whenever a machine is idle we assign the job with the highest priority among all available jobs. We refer to this algorithm as the Delayed Least Flexible Job (DLFJ) algorithm. For convenience in analyzing the algorithm, we define the term ordered schedule satisfying that for all pairs of jobs j and k with Mj = Mk and rj < rk , job j starts not later than job k, i.e., Sj ≤ Sk . Note that, for a given schedule which is not an ordered schedule, we can construct an ordered schedule with the same objective function value by exchanging jobs that violate this order among all jobs with the same eligible set. Therefore, there always exists an ordered optimum schedule. Theorem 8 The Algorithm DLFJ for the online version of P 2 | Mj , rj , pj = p | Cmax √ is an optimal algorithm with a competitive ratio of (1 + 5)/2.
Proof We prove the theorem by contradiction. Suppose there exists a counterexample with a minimum number of jobs, referred to as a minimum counterexample. We consider job n that is the last one to be completed in the minimum √ counterexample. Let α be (−1 + 5)/2. Case 1: |Mn | = 1 Without loss of generality, we may assume that Mn = {1}. Consider job k that is the last one to be assigned to machine 1 among all jobs that are eligible to both machines 1 and 2. Job k must exist; otherwise, all jobs scheduled on machine 1 are eligible only on machine 1 and hence the DLFJ schedule is optimal. Furthermore, there is no idle time within the time interval [Ck , Sn ] in machine 1; otherwise, all jobs scheduled on machine 1 after the last idle time in machine 1 are eligible only on machine 1 and hence the DLFJ schedule is optimal. Since all jobs after job k are eligible only on machine 1 and have release dates greater than or equal to Sk , those jobs must be scheduled on machine 1 after Sk in an optimal schedule. As Ck = Sk + p, we have Cmax (σ ) ≤ Cmax (σ ∗ ) + p. Since Sk ≥ αp and the jobs after job k on machine 1 are released after Sk , we have Cmax (σ ∗ ) ≥ (1 + α)p. Therefore, Cmax (σ ∗ ) + p p Cmax (σ ) ≤ =1+ ∗ Cmax (σ ) Cmax (σ ∗ ) Cmax (σ ∗ ) 1 = 1 + α. ≤1+ 1+α Case 2: |Mn | = 2 If Sn ≤ rn + αp, then Sn + p rn + αp + p Cmax (σ ) ≤ ≤ Cmax (σ ∗ ) rn + p rn + p αp ≤ 1 + α, =1+ rn + p implying a contradiction. Consider an ordered optimum schedule and let k1 and k2 be the last jobs assigned to machines 1 and 2 in the ordered optimum schedule, respectively. Let us define a problem instance I = I \{k1 , k2 } and let σ and σ ∗ be the DLFJ schedule and the optimum schedule, respectively, for problem instance I . Thus, Cmax (σ ∗ ) ≤ Cmax (σ ∗ ) − p. If we can show that Cmax (σ ) ≥ Cmax (σ ) − p, then we have shown that I is a smaller counterexample, which yields a contradiction. So, we will consider four cases according to the eligible sets of jobs k1 and k2 . Case 2-a: Mk1 = {1} and Mk2 = {2} We may assume that rk1 > Cmax (σ ∗ ) − 2p since it does not affect the optimum schedule or the schedule generated by DLFJ. The same argument can be applied to job k2 . So, we assume that rk1 > Cmax (σ ∗ ) − 2p and rk2 > Cmax (σ ∗ ) − 2p. Since the other jobs must be scheduled before jobs k1 and
J Sched (2011) 14: 27–38
k2 in the ordered optimum schedule σ ∗ , the other jobs must have release dates less than or equal to Cmax (σ ∗ ) − 2p. Let Iˆ be the set of jobs which are eligible on both machines and scheduled after time t ∗ = min{Sk1 , Sk2 } in schedule σ . Since all jobs in Iˆ have release dates less than or equal to Cmax (σ ∗ ) − 2p < min{rk1 , rk2 } ≤ min{Sk1 , Sk2 }, all jobs in Iˆ are available at time t = t ∗ + αp and there is no idle time during the period [t ∗ + αp, Sn ]. Now consider schedule σ generated by DLFJ for problem instance I . If there is an idle time in the time period [t ∗ , t ∗ + αp] in schedule σ , the idle time will still be an idle time in schedule σ . For convenience, without loss of generality, assume the makespan is determined in machine 1 by symmetry. Let n1 and n2 be the numbers of jobs scheduled after t ∗ on machines 1 and 2, respectively, in schedule σ . Similarly, let n 1 and n 2 be the numbers of jobs scheduled after t ∗ on machines 1 and 2, respectively, in schedule σ . Since deleting two jobs k1 and k2 cannot affect the jobs that are scheduled before time t ∗ , n1 + n2 − 2 = n 1 + n 2 . If n 1 ≥ n1 − 1, then Cmax (σ ) ≥ Cmax (σ ) − p. Otherwise, n 1 ≤ n1 − 2 and it implies that n 2 ≥ n2 and the makespan of schedule σ is determined by machine 2. Since job n is scheduled last and it is eligible on both machines, the latest completion time on machine 2 in schedule σ is not less than Cmax (σ ) − p. Thus, Cmax (σ ) ≥ Cmax (σ ) − p. So, if we delete two jobs k1 and k2 in the counterexample, the makespan is decreased by p time units; i.e., Cmax (σ ) ≥ Cmax (σ ) − p. Case 2-b: Mk1 = {1, 2} and Mk2 = {2} Job k1 is completed last among all jobs that are eligible on both machines. Thus, k1 = n. Let Iˆ be the set of jobs which are eligible on both machines and scheduled after time t ∗ = Sk2 in schedule σ . Then, there is no idle time in time period [t ∗ + αp, Sn ]. If we delete two jobs k1 and k2 in the counterexample, the makespan is decreased by at most p time units; i.e., Cmax (σ ) ≥ Cmax (σ ) − p. Case 2-c: Mk1 = {1} and Mk2 = {1, 2} By symmetry of Case 2-b. Case 2-d: Mk1 = {1, 2} and Mk2 = {1, 2} One of the two jobs, k1 and k2 , must be job n. Without loss of generality, by symmetry, we assume that job k1 is job n. Since job k2 is scheduled last on machine 2 in the optimum schedule σ ∗ , we can assume that rk2 > Cmax (σ ∗ ) − 2p. Furthermore, the other jobs scheduled in σ ∗ on machine 2 have release dates less than or equal to Cmax (σ ∗ ) − 2p. Let i1 be the machine processing job n and i2 be the other one in schedule σ . Consider job k3 which is the last job to be completed on machine i2 in the schedule σ . If job k3 is job k2 , then we delete jobs k1 and k2 from the counterexample and the makespan is reduced by p time units; i.e., Cmax (σ ) ≥ Cmax (σ ) − p.
33
Otherwise, job k3 cannot be one of jobs k1 and k2 , and it implies that rk3 ≤ Cmax (σ ∗ ) − 2p. Since job k3 is scheduled after job k2 , job k3 must be eligible on only one machine, namely, i2 . Since rk2 > Cmax (σ ∗ ) − 2p ≥ rk3 , job k3 must be scheduled before job k2 . It contradicts the assumption that k3 is the last job to be completed on machine i2 . In all subcases of Case 2, we can construct smaller counterexamples, so there does not exist a minimum counterexample. Thus, the DLFJ algorithm applied to√ P 2 | Mj , rj , pj = p | Cmax has a competitive ratio of (1+ 5)/2. By Lemma 7, any online algorithm for P 2 | Mj , rj , pj = p | C√max must have a competitive ratio of at least (1 + 5)/2. Therefore, algorithm DLFJ√is an optimal al gorithm with a competitive ratio of (1 + 5)/2. 4.3 Two machines—inclusive eligibility Now we consider a more special form of eligibility, namely, inclusive eligibility. It means that an eligible set is either {1} or {1, 2}. We will provide a lower bound through an example and present an optimal algorithm. Lemma 9 Any online algorithm for P 2 | Mj (inclusive), rj , √ pj = p | Cmax has a competitive ratio of at least 2. Proof Again, we prove the √ lemma through an adversary argument. Let α be −1 + 2. At time t = 0, two jobs 1 and 2 arrive with M1 = M2 = {1, 2}. If no job is assigned to machine 1 before time t = αp, then no other job arrives. In this case, we have Cmax (σ ) ≥ (1 + α)p and Cmax (σ√∗ ) = p. Therefore, we have Cmax (σ )/Cmax (σ ∗ ) ≥ 1 + α = 2. Now, suppose a job is assigned to machine 1 before time αp. Without loss of generality, we may assume that job 1 is assigned to machine 1 at time S1 < αp. Then, two more jobs, jobs 3 and 4, arrive at time S1 with M3 = M4 = {1}. Now we have Cmax (σ ) ≥ S1 + 3p and Cmax (σ ∗ ) = S1 + 2p. Thus, p 1 Cmax (σ ) =1+ >1+ ∗ Cmax (σ ) S1 + 2p α+2 √ = 1 + α = 2.
We will use a similar approach as in algorithm DLFJ including priorities and delays. The job with a smaller eligible set has a higher priority, and if a tie occurs, the job with an earlier release date has a higher priority. However, the simple delay approach used in algorithm DLFJ does not achieve optimality for this problem. From the following examples, we can infer what the algorithm should do. Jobs that are eligible only on machine 1 do not have to be delayed. Also, jobs eligible on both machines do not have to be delayed if they were to be scheduled on machine 2. This leaves only jobs eligible on both machines that were to be
34
scheduled on machine 1. Since the target competitive ratio √ should delay its release date by an amount of time is 2, we √ equal to ( 2 − 1)p. We refer to this rule as the Selective Delay rule. However, for this rule, we have a lower bound example of 3/2. √ Example 1 Let α be 2 − 1. Consider the following data set: r1 = 0, M1 = {1}, r2 = ε, M2 = {1, 2}, r3 = ε, M3 = {1, 2}. Following the Selective Delay rule, job 1 starts at time t = 0 on machine 1, job 2 starts at time t = ε on machine 2, and job 3 has a modified release date r3 = αp + ε. At time t = p, job 3 is scheduled on machine 1, since machine 2 is busy. If job 4 arrives at time t = p + ε with M4 = {1}, then Cmax (σ )/Cmax (σ ∗ ) = 3p/(2p + ε) ≈ 3/2. In Example 1, it is better for job 3 to wait until the completion of job 2 on machine 2. This suggests another rule: Suppose the only job available at time t1 is a job that is eligible on both machines and suppose machine 1 is idle at time t1 and machine 2 remains occupied until t2 , t2 > t1 . If t2 − t1 ≤ (1 − α)p, then the job should wait until t2 or until the next event (new arrival or completion of the job); otherwise, we assign the job to machine 1. We refer to this rule as the Comparative Delay rule. This approach looks reasonable, but it also has a lower bound example of 3/2, as the following example shows. Example 2 Consider the following data set: r1 = 0, M1 = {1, 2}, r2 = 0, M2 = {1, 2}. From this rule, at time t = 0, job 1 is assigned to machine 2 and job 2 is assigned to machine 1. At time t = ε, jobs 3 and 4 arrive with M3 = M4 = {1}. Then, Cmax (σ )/Cmax (σ ∗ ) = 3p/(2p + ε) ≈ 3/2. We now combine these two rules to construct a more effective algorithm. In order to describe the algorithm we introduce the following notation. Let J1 (t) denote the set of jobs that at time t have not been scheduled yet and that are eligible on machine 1 only and let J12 (t) denote the set of jobs that are eligible on both machines. Let J (t) be J1 (t) ∪ J12 (t). √Let M(t) be the set of idle machines at time t and let α be 2 − 1. An event means a job’s arrival and/or a job’s completion. Based on the idea of the Selective Delay and Comparative Delay rules, we develop an algorithm as follows. Selective and Comparative Delay (SCD) Algorithm • When M(t) = ∅ or J (t) = ∅, wait until the next event. • When 1 ∈ M(t), if J1 (t) = ∅, assign at time t the earliest job from J1 (t) to machine 1. • When 2 ∈ M(t), if J12 (t) = ∅, assign at time t the earliest job from J12 (t) to machine 2. • When M(t) = {1}, if J1 (t) = ∅ and |J12 (t)| ≥ 2, assign at time t the earliest job from J12 (t) to machine 1.
J Sched (2011) 14: 27–38
• When M(t) = {1}, if J1 (t) = ∅ and |J12 (t)| = 1, let J12 (t) = {j }. If t ≤ αp apply the Selective Delay rule. Wait until t + αp or the next event. If t > αp apply the Comparative Delay rule. If machine 2 is occupied until t < t + (1 − α)p, then wait until the next event. If machine 2 is occupied until t ≥ t + (1 − α)p, then assign job j to machine 1 at time t. Theorem 10 Algorithm SCD applied to the online version P 2 | Mj (inclusive),√rj , pj = p | Cmax is optimal with a competitive ratio of 2. Proof We prove the theorem by contradiction. Suppose there exists a counterexample I with a minimum number of jobs, √ referred to as the minimum counterexample. Let α be 2 − 1. It implies that for schedule σ generated by the SCD algorithm and the optimal schedule σ ∗ , Cmax (σ )/Cmax (σ ∗ ) > 1 + α. We consider job n which is the last job to be completed in the minimum counterexample. Now we consider two cases according to the eligible set of job n, Mn , which must be either {1} or {1, 2}. Case 1: Mn = {1} Consider job k which is scheduled last on machine 1 among all jobs eligible on both machines. If there does not exist such a job k, then following the same idea as in Case 1 of the Proof of Theorem 8, it implies all jobs scheduled on machine 1 are eligible only on machine 1. Thus, the schedule generated by the SCD algorithm is optimal. This yields a contradiction. Thus, we can assume that job k is well defined. Then, we can also define another job k which is running at time Sk on machine 2. If there is not such a job k , job k must have been assigned to machine 2. Note that there is no idle time in the time interval [Ck , Sn ]. Otherwise, the first job right after the last idle time period is eligible on machine 1 only and it starts at its release date in the schedule generated by the SCD algorithm as well as in the optimal schedule. Thus, the schedule generated by the SCD algorithm is optimal, implying a contradiction. Since all jobs after job k are scheduled without idle time, Cmax (σ ) = Sk + (L + 1)p, where L is the number of jobs scheduled on machine 1 after job k. Since all jobs after job k on machine 1 are only eligible on machine 1 and have release dates greater than or equal to Sk , we have Cmax (σ ∗ ) ≥ Sk + Lp. Thus, Cmax (σ )/Cmax (σ ∗ ) ≤ 1 + p/Cmax (σ ∗ ). Now we consider conditions that establish a contradiction in a straightforward manner. If Cmax (σ ∗ ) ≥ (2 + α)p, then p 1 Cmax (σ ) ≤1+ ≤1+ = 1 + α. ∗ ∗ Cmax (σ ) Cmax (σ ) 2+α
J Sched (2011) 14: 27–38
It is a contradiction. If |I | ≥ 5, then Cmax (σ ∗ ) ≥ 3p, which leads to a contradiction as well. If L ≥ 2, all jobs in I are jobs k, k and at least two jobs are scheduled after job k on machine 1. Since job k is the last job among all jobs eligible to both machines, we have Sk ≥ αp. Thus, Cmax (σ ∗ ) ≥ Sk + Lp ≥ (2 + α)p, which implies a contradiction. So, it suffices to consider the case where Cmax (σ ∗ ) < (2+α)p, |I | ≤ 4, and L = 1. We know the existence of three jobs n, k, and k in I . Since there are at most four jobs, we consider three possibilities for the fourth job k
: (i) job k
is scheduled before job k on machine 1, or (ii) job k
is scheduled after job k on machine 2, or (iii) there is no fourth job. If job k
is scheduled before job k on machine 2, then rk > αp and there are three jobs that have release dates greater than αp. This implies that Cmax (σ ∗ ) > (2 + α)p. Again, we have a contradiction. Thus, these three cases exhaust all possibilities. (i) Suppose there is a job k
before job k on machine 1. Note that I = {n, k, k , k
}. If Mk
= {1, 2}, by definition of job k , Sk
< Sk and there must be another job that is running at time S1 on machine 2 before job k , which is a contradiction. If Mk
= {1}, in the optimum schedule, jobs n and k
are scheduled on machine 1 and jobs k and k are scheduled on machine 2. Since job k is scheduled on machine 1 by the SCD algorithm, Sk ≤ Ck − (1 − α)p. Thus, Ck ≥ Sk + (1 − α)p ≥ (2 − α)p. Since job k is the first job among all jobs eligible on both machines, it starts at its release date on machine 2. Thus, rk = Sk = Ck − p ≥ (1 − α)p. Since there are three jobs arriving at a time greater than or equal to rk , Cmax (σ ∗ ) ≥ rk + 2p ≥ (3 − α)p > (2 + α)p, and it yields a contradiction. (ii) Suppose there is a job k
after job k on machine 2. Note that I = {n, k, k , k
} and rk ≤ rk ≤ rk
. Consider the case where rk < αp. If rk
≤ rk αp, Sk = rk
≤ rk + αp. Otherwise, Sk = rk + αp. Thus, Sk ≤ rk + αp and Cmax (σ )/Cmax (σ ∗ ) ≤ (Sk + 2p)/(rk + 2p) ≤ 1 + α/2 < 1 + α, implying a contradiction. If rk ≥ αp, then there are three jobs arriving at a time αp or later and Cmax (σ ∗ ) ≥ (2 + α)p, again, implying a contradiction. (iii) Suppose there is no additional job and I = {n, k, k }. Note that Sk = rk . If rk < αp, then Sk = rk +αp. Since Cmax (σ ∗ ) is 2p and Cmax (σ ) = Sk + 2p = rk + αp + 2p < 2(1 + α)p, the competitive ratio is at most 1 + α. If rk ≥ αp, then rk = Sk and Sk ≤ Ck − (1 − α)p. Thus, Cmax (σ ) Sk + 2p Ck + (1 + α)p ≤ ≤ ∗ Cmax (σ ) rk + 2p Ck + p αp < 1 + α. =1+ Ck + p
35
So, again we have a contradiction. Case 2: Mn = {1, 2} In this case, we consider the characteristics of the optimal schedule σ ∗ . We consider the last two jobs in the ordered optimum schedule σ ∗ . If these two jobs are only eligible to machine 1, we can delete the job scheduled last in σ ∗ to obtain a smaller counterexample; in this smaller counterexample, the optimal makespan is reduced by exactly p and the makespan by the algorithm is reduced by at most p. Thus, we can assume that one of the two jobs is eligible to both machines and, by the property of the ordered schedule, one of these two jobs is job n. Let the other job be called job n . We will establish a contradiction or construct a smaller counterexample, which also implies a contradiction. Let I be the problem instance obtained by deleting the two jobs n and n and let σ and σ ∗ be the SCD schedule and the optimum schedule, respectively, for the problem instance I . Thus, Cmax (σ ∗ ) ≤ Cmax (σ ∗ ) − p. If we can prove that Cmax (σ ) ≥ Cmax (σ ) − p, then Cmax (σ )/Cmax (σ ∗ ) > Cmax (σ )/Cmax (σ ∗ ) ≥ 1 + α and we can obtain a smaller counterexample I , which contradicts the assumption of the minimum counterexample. Now we consider subcases according to the eligible set of job n , Mn , which must be either {1} or {1, 2}. Case 2-a: Mn = {1, 2} and Mn = {1} If jobs n and n are scheduled on machine 1 in the optimum schedule σ ∗ , then the schedule where job n is scheduled on machine 2 is also an optimal schedule. So, without loss of generality, job n is the last job scheduled on machine 2 and job n is the last job scheduled on machine 1. Moreover, we can assume that Cmax (σ ∗ ) − 2p < rn ≤ Cmax (σ ∗ ) − p and all other jobs, except jobs n and n , have release dates less than or equal to Cmax (σ ∗ ) − 2p. Suppose jobs n and n are scheduled on machine 1 in the schedule σ . Let job h be the job currently running at time Cn on machine 2. If there had not been such a job h, then job n could not have been scheduled on machine 2. Consider the schedule σ generated by the SCD algorithm for problem instance I . If job h is scheduled on machine 1 in the schedule σ , it cannot start before Sn . Since Sn ≥ rn > Cmax (σ ∗ ) − 2p, we have Cmax (σ ) ≥ Sn + p > Cmax (σ ) − p, which is a contradiction. If job h is scheduled on machine 2, then its completion time is not changed, also implying a contradiction. Suppose that in the schedule σ job n is scheduled on machine 2 and job n on machine 1. If Sn = rn , it implies that the schedule σ is optimal, a contradiction. Otherwise, there exists a job k that is scheduled right before job n on machine 2. If job k were scheduled on machine 1 in the schedule σ , it must be scheduled on machine 1 in the schedule σ . It implies that in the schedule σ job k is scheduled on machine 2 and that it determines the makespan of the sched-
36
J Sched (2011) 14: 27–38
ule σ . Thus, Cmax (σ ) ≥ Cmax (σ ) − p, yielding a contradiction. Case 2-b: Mn = {1, 2} and Mn = {1, 2} Note that the schedule generated by the SCD algorithm is an ordered schedule. It implies that the last two jobs, jobs n and n , must have the latest release dates among all jobs eligible to both machines. Since the makespan is determined by job n, rn ≤ rn and Sn ≤ Sn . Now we consider four cases, depending on the machines where jobs n and n are processed in the schedule σ . (i) Jobs n and n are scheduled on machine 1 in the schedule σ . At the completion time of job n , machine 2 must be idle and job n had to be assigned to machine 2 by the SCD algorithm. This is a contradiction. (ii) In the schedule σ , job n is scheduled on machine 2 and job n is scheduled on machine 1. Let μ be the job right before job n on machine 2. If there is an idle period between jobs n and μ, then Sn = rn , implying a contradiction. So, there is no idle time between jobs n and μ. If we delete the two jobs n and n , then Cmax (σ ) ≥ Cμ = Cmax (σ ) − p, contradicting the minimum counterexample assumption. (iii) In the schedule σ , job n is scheduled on machine 1 and job n is scheduled on machine 2. Since job n is scheduled on machine 1, Sn ≤ Cn − (1 − α)p = Sn + αp. Let job μ be the job that is scheduled right before job n on machine 1. If there is no such job or if there exists an idle period between jobs n and μ, then Sn = rn , implying a contradiction. Thus, Sn = Cμ . If Sn = rn , then we have Cmax (σ ) = Cn = Sn + p ≤ Sn + αp + p = (rn + p) + αp ≤ Cmax (σ ∗ ) + αp. Since Cmax (σ ∗ ) ≥ 2p, Cmax (σ )/Cmax (σ ∗ ) < 1 + α, implying a contradiction. Thus, Sn = rn . So, the start time of job n must be either the release date of job n or the completion time of the job scheduled right before job n on machine 2. If Sn = rn , then Cmax (σ ) = Cn = Sn + p ≤ Sn + αp + p = (rn + p) + αp ≤ Cmax (σ ∗ ) + αp. Since Cmax (σ ∗ ) ≥ 2p, Cmax (σ )/Cmax (σ ∗ ) < 1 + α, implying a contradiction. Therefore, there must be a job μ that is scheduled right before job n in the schedule σ . Obviously, Mμ = {1, 2}. If Mμ = {1}, then the positions of all jobs, except jobs μ , n, and n , in the schedule σ are independent of jobs n and n . This implies that Cmax (σ ) = Cμ = Cmax (σ ) − p. If Mμ = {1, 2}, then the positions of all jobs, except jobs μ, n, and n , in the schedule σ are independent of jobs n and n . Since job μ cannot start by the algorithm SCD before time Sμ , it follows that Cmax (σ ) ≥ Cμ =
Cmax (σ ) − p. Therefore, in both cases of Mμ , Cmax (σ ) ≥ Cmax (σ )−p, yielding a contradiction to the minimum counterexample assumption. (iv) In the schedule σ , jobs n and n are scheduled on machine 2. If there is an idle time between jobs n and n , then Sn = rn , implying a contradiction. Since Sn ≤ Sn , Cn = Sn . Suppose rn > Cn − (1 − α)p. Since Cmax (σ ) = Cn + p, Cmax (σ ∗ ) ≥ rn + p and rn > αp, we have Cmax (σ ) Cn + p rn + (2 − α)p ≤ < Cmax (σ ∗ ) rn + p rn + p =1+
(1 − α)p 1−α Cn − (1 − α)p ≥ αp, implying a contradiction. Thus, there must be at least one job on machine 1 in the schedule σ . Let job ν be the last job scheduled on machine 1. We will show that Cν > Cn − (1 − α)p ≥ rn . Suppose Cν ≤ Cn − (1 − α)p. If rn < Cν , then job n is available at time Cν for machine 1 and it must be scheduled on machine 1. On the other hand, if rn ≥ Cν , then there are no jobs scheduled on machine 1 after job ν and job n must be scheduled on machine 1. Again, it is a contradiction. Thus, Cν > Cn − (1 − α)p. Therefore, Cν > Cn − (1 − α)p ≥ rn .
(1)
Now we break down case (iv) into more detailed subcases, according to the eligible set of job ν, Mν . (iv-a) Mν = {1, 2}. Since we assume that jobs n and n
have release dates greater than or equal to the release date of any other job that is eligible on both machines and the schedule σ generated by algorithm SCD is an ordered schedule, we have rν ≤ rn ≤ rn and Sν ≤ Sn ≤ Sn . Since job ν is eligible on both machines and scheduled on machine 1, there must be a job n
at time t = Sν being processed on machine 2. If there is an idle time between jobs n
and n , then rn > Cn
. We know that Sν > Cn
− (1 − α)p from the fact that Cν > Cn − (1 − α)p. It implies that job ν must have been scheduled at time t = Cn
on machine 2 by algorithm SCD, which is a contradiction. Thus, Cn
= Sn . Note that deleting the two jobs n and n does not affect the position of any other job, except job ν. So, if we delete jobs n and n , then the positions of the other jobs are not changed and job ν is the earliest available job at time t = Sν or later by algorithm SCD. Since Sν > Cn − (1 − α)p, job ν has to be scheduled on machine 2 at time t = Sn by algorithm SCD with the problem instance I . It implies that Cmax (σ ) = Cmax (σ ) − p and yields a smaller counterexample, which is a contradiction.
J Sched (2011) 14: 27–38
37
(iv-b) Mν = {1}. Since job n is scheduled on machine 2, there are different cases depending on the release date of job n. Note that Cmax (σ ∗ ) ≥ rn + p. We already know that rn < Cn − (1 − α)p and Cν > Cn − (1 − α)p. So, rn ≥ Cν leads to a contradiction. Thus, it suffices to consider the case where rn < Cν and Cν > Cn − (1 − α)p. Consider the sequence of jobs ν1 , ν2 , . . . , νL that are processed contiguously on machine 1; i.e., Cνl = Sνl+1 for l = 1, . . . , L − 1 such that all jobs in the sequence are eligible on machine 1 only, the last job is job ν, and the first job starts at its release date or the previous job of the first job is eligible on both machines. Since either job n or job n
is scheduled last on machine 1 under the optimal schedule, rν1 ≤ Cmax (σ ∗ ) − (L + 1)p. If Sν1 = rν1 , all jobs in the sequence must be scheduled after time rν1 in the optimal schedule and Cν = rν1 + Lp ≤ Cmax (σ ∗ ) − p. By (1), Cν ≥ Cn − (1 − α)p = Cmax (σ ) − 2p + αp. Thus, Cmax (σ ) ≤ Cmax (σ ∗ ) + (1 − α)p. Since we have at least three jobs, which implies that Cmax (σ ∗ ) ≥ 2p, we have Cmax (σ ) (1 − α)p ≤1+ Cmax (σ ∗ ) Cmax (σ ∗ ) ≤1+
1−α < 1 + α, 2
which leads to a contradiction. If Sν1 = rν1 , then there must be a job ν that is eligible on both machines and is scheduled right before job ν1 on machine 1. Since job ν1 starts at time t < rν1 + p, we have Cν = Sν1 + Lp < rν1 + (L + 1)p ≤ Cmax (σ ∗ ). Therefore, Cν ≤ Cmax (σ ∗ ). By (1), ∗
Cmax (σ ) ≥ Cν > Cn − (1 − α)p = Cmax (σ ) − 2p + αp. Then, Cmax (σ ) ≤ Cmax (σ ∗ ) + (2 − α)p and (2 − α)p Cmax (σ ) ≤1+ . ∗ Cmax (σ ) Cmax (σ ∗ )
(2)
If job n starts at its release date or at the release date of job n, then Cmax (σ ∗ ) ≥ Sn + p. Note that at time t = Sν a job is processed on machine 2, which implies that the total number of jobs is at least five. Since Cmax (σ ) = Sn + 2p and Cmax (σ ∗ ) ≥ 3p, we have Cmax (σ ) Cmax (σ ∗ ) + p p ≤ ≤1+ ∗ ∗ Cmax (σ ) Cmax (σ ) Cmax (σ ∗ ) 1 ≤ 1 + < 1 + α. 3 Thus, job n cannot start at its release date or at the release date of job n. It implies that there must be a job n
that is scheduled right before job n on machine 2.
If L ≥ 2, then the number of jobs scheduled on machine 1 is at least three and there are at least three jobs scheduled on machine 2. Since job ν is eligible on both machines and is scheduled on machine 1, there must be a job that is running at time t = Sν on machine 2. Since this job is completed before Cν and job n
starts after Cν , the number of jobs scheduled on machine 2 is at least four. It implies that there are at least seven jobs and Cmax (σ ∗ ) ≥ 4p. By (2), Cmax (σ ) (2 − α)p ≤1+ ∗ Cmax (σ ) Cmax (σ ∗ ) ≤1+
(2 − α) < 1 + α, 4
which yields a contradiction. Now, it suffices to consider the case where L = 1. There are at least two jobs, ν and ν , that are scheduled on machine 1, and there are at least three jobs, n, n , and n
, scheduled on machine 2. If Sn
= rn
, jobs n, n , and n
should be scheduled after rn
and Cmax (σ ∗ ) ≥ Sn
+ 2p. Since Cmax (σ ) = Sn
+ 3p ≤ Cmax (σ ∗ ) + p and Cmax (σ ∗ ) ≥ 3p, we have Cmax (σ )/Cmax (σ ∗ ) ≤ 1 + 1/3 < 1 + α, which is a contradiction. Thus, Sn
> rn
and there must be a job n
scheduled right before job n
on machine 2. In a similar way, if Sn
= rn
, then Cmax (σ ∗ ) ≥ rn
+ 3p and Cmax (σ ) = Sn
+ 4p ≤ Cmax (σ ∗ ) + p. Thus, we have Cmax (σ )/Cmax (σ ∗ ) ≤ 1 + 1/3 < 1 + α, which is a contradiction. Therefore, Sn
> rn
and there must be a job n
that is scheduled right before job n
on machine 2. Thus, we have at least seven jobs and Cmax (σ ∗ ) ≥ 4p. By (2), Cmax (σ ) (2 − α)p ≤1+ ∗ Cmax (σ ) Cmax (σ ∗ ) ≤1+
(2 − α) < 1 + α, 4
which is again a contradiction. Therefore, there cannot be a minimum counterexample and algorithm SCD √for P 2 | Mj , rj , pj = p | Cmax has a competitive ratio of 2. By Lemma 9, any online algorithm for P 2 | Mj (inclusive), r√j , pj = p | Cmax must have a competitive ratio of at least 2. Therefore, algorithm √ SCD is an optimal algorithm with a competitive ratio of 2.
5 Conclusions We consider offline and online scheduling problems with jobs that have equal processing times and different release dates. The jobs are subject to machine eligibility constraints. We develop optimal and approximation algorithms considering special cases of eligible sets. We also provide a simpler algorithm for some problems with nested eligibility.
38
The offline problems we deal with are special cases of the problems with arbitrary eligible set, P | Mj , rj | Cmax , for which a polynomial-time 2-approximation algorithm is known and a 32 -inapproximability result is known (Lenstra et al. 1990). However, we prove that when the jobs have equal processing times, i.e., P | Mj , rj , pj = p | Cmax , the problem is polynomially solvable. On the other hand, this offline problem can be seen as a generalization of the problem without eligibility constraints. Several problems with jobs that have equal processing times have been studied with different objective functions. Simons (1983) proved that minimizing the maximum lateness, i.e., P | rj , pj = p | Lmax , can be solved in O(n3 log log n). Brucker and Kravchenko (2008) considered the minimization of the total number of tardy jobs and the total weighted completion time, and Kravchenko and Werner (2009) solved more general problems by using LP. However, the complexity of the problems subject to eligibility constraints P | Mj , rj , pj = p | Cj and P | Mj , rj , pj = p | Lmax is still open. The online scheduling of jobs subject to eligibility constraints has not yet been studied very thoroughly. We considered several cases assuming that the jobs have equal processing times. For the case of nested eligibility, we provide an algorithm with an absolute error of at most p. When the number of machines is two, we provide optimal algorithms for the problems subject to arbitrary eligibility as well as inclusive eligibility. For the case of inclusive eligibility, we devise an optimal algorithm utilizing two different delay rules dependent upon the current status, which is a novel and more elaborate form of online scheduling algorithm. Since we only deal with two-machine cases under general eligibility and inclusive eligibility, the study on the cases for more than two machines under various eligibility settings is one of valuable research directions.
References Azar, Y., Naor, J., & Rom, R. (1995). The competitiveness of on-line assignments. Journal of Algorithms, 18, 221–237. Bar-Noy, A., Freund, A., & Naor, J. (2001). Online load balancing in a hierarchical server topology. SIAM Journal of Computing, 31, 527–549. Brucker, P., Jurisch, B., & Kramer, A. (1997). Complexity of scheduling problems with multi-purpose machines. Annals of Operations Research, 70, 57–73.
J Sched (2011) 14: 27–38 Brucker, P., & Kravchenko, S. A. (2008). Scheduling jobs with equal processing times and time windows on identical parallel machines. Journal of Scheduling, 11, 229–237. Centeno, G., & Armacost, R. L. (2004). Minimizing makespan on parallel machines with release time and machine eligibility restrictions. International Journal of Production Research, 42, 1243– 1256. Chen, B., Potts, C. N., & Woeginger, G. J. (1998). In D.-Z. Du & P. M. Pardalos (Eds.), Handbook of combinatorial optimization: Vol. 3. A review of machine scheduling: complexity, algorithms and approximability (pp. 21–169). Boston: Kluwer Academic. Garey, M. R., & Johnson, D. S. (1978). Strong NP-completeness results: Motivation, examples, and implications. Journal of the Association for Computing Machinery, 25, 499–508. Glass, C. A., & Kellerer, H. (2007). Parallel machine scheduling with job assignment restrictions. Naval Research Logistics, 54, 250– 257. Glass, C. A., & Mills, H. R. (2006). Scheduling unit length jobs with parallel nested machine processing set restrictions. Computers & Operations Research, 33, 620–638. Hopcroft, J. E., & Karp, R. M. (1973). An O(n5/2 ) algorithm for maximum matchings in bipartite graphs. SIAM Journal of Computing, 2, 225–231. Huo, Y., & Leung, J. Y.-T. (2010). Parallel machine scheduling with nested processing set restrictions. European Journal of Operational Research, 204, 229–236. Hwang, H.-C., Chang, S. Y., & Lee, K. (2004). Parallel machine scheduling under a grade of service provision. Computers & Operations Research, 31, 2055–2061. Kravchenko, S. A., & Werner, F. (2009). On a parallel machine scheduling problem with equal processing times. Discrete Applied Mathematics, 157, 848–852. Lenstra, J. K., Shmoys, D. B., & Tardos, E. (1990). Approximation algorithms for scheduling unrelated parallel machines. Mathematical Programming, 46, 259–271. Leung, J. Y.-T., & Li, C.-L. (2008). Scheduling with processing set restrictions: a survey. International Journal of Production Economics, 116, 251–262. Lin, Y., & Li, W. (2004). Parallel machine scheduling of machinedependent jobs with unit-length. European Journal of Operational Research, 156, 261–266. Li, C.-L. (2006). Scheduling unit-length jobs with machine eligibility restrictions. European Journal of Operational Research, 174, 1325–1328. Ou, J., Leung, J. Y.-T., & Li, C.-L. (2008). Scheduling parallel machines with inclusive processing set restrictions. Naval Research Logistics, 55, 328–338. Pinedo, M. L. (1995). Scheduling—theory, algorithms and systems. New York: Prentice Hall. Shchepin, E. V., & Vakhania, N. (2005). An optima rounding gives a better approximation for scheduling unrelated machines. Operations Research Letters, 33, 127–133. Simons, B. (1983). Multiprocessor scheduling of unit-time jobs with arbitrary release times and deadlines. SIAM Journal of Computing, 12, 294–299.