Research Article | Open Access
Online Parallel Machine Scheduling to Maximize the Number of Early Jobs
We study a maximization problem: online scheduling on m identical machines to maximize the number of early jobs. The problem is online in the sense that all jobs arrive over time. Each job's characteristics, such as processing time and due date, become known at its arrival time. We consider the preemption-restart model, in which preemption is allowed, while once a job is restarted, it loses all the progress that has been made on this job so far. If in some schedule a job is completed before or at its due date, then it is called early (or on time). The objective is to maximize the number of early jobs. For m identical machines, we prove an upper bound of competitive ratio and show that ECT (earliest completion time) algorithm is -competitive.
In classical scheduling, it is generally assumed that the information for all jobs in an instance is known in advance. However, this assumption is not true in many situations. This promotes the emergence of online scheduling. There are three online models commonly considered . The first model assumes that jobs arrive in a list without release dates. Any online algorithm has to schedule each job before seeing the next job in the list. The second model assumes that the running time of a job is unknown until the job is finished. The online algorithm only knows whether a job is still running at any time. The third model assumes that jobs arrive over time. At each time when a machine becomes idle, the algorithm schedules one of the available jobs, if any, on the machine.
In this paper, we consider the third model where jobs arrive over time. There are also three submodels for online scheduling where jobs arrive over time. The first one is nonpreemptive model, in which it is assumed that once a job is started on a machine, it must run to completion. The second one is preemption-resume model, in which it is assumed that a job on processing may be preempted at any time and be resumed from where it was preempted at a later moment. The third one is preemption-restart model. In this model, if a job is preempted during processing, it has to be restarted from the beginning for completion later on. Notice that, in the preemption-restart model, the finally completed jobs construct a nonpreemptive schedule. In this paper, we focus on the preemption-restart model in the online setting where jobs arrive over time.
We use the competitive analysis  to measure the performance of an online algorithm. For any job input sequence , let denote the number of early jobs in the schedule produced by an online algorithm , and let denote the number of early jobs in an optimal schedule. We say is -competitive where is also called the competitive ratio of . Clearly, holds. The closer the ratio approaches 1, the better the performance of algorithm .
Sgall  gave a survey on online scheduling, including results on both nonpreemptive and preemption-resume models. Shmoys et al.  studied a preemption-restart model to minimize the makespan and presented several results for scheduling jobs on parallel machines. Hoogeveen et al.  investigated the preemption-restart model in online single-machine scheduling to maximize the number of early jobs. They proved that the shortest remaining processing time (SRPT) rule yields an optimal online algorithm with competitive ratio . Note that SRPT rule implies earliest completion time (ECT) rule. In this paper, our main result is a kind of generalization of that in Hoogeveen et al. .
The rest of this paper is organized as follows. Section 2 introduces some definitions and notations. In Section 3, we show that is an upper bound of competitive ratio for all online algorithms. In Section 4, we present an online algorithm ECT based on the earliest completion time (ECT) rule and prove that the algorithm is -competitive.
2. Problem Definition and Notations
We are given identical machines. Without loss of generality, we denote them by machine-1,, machine-, respectively. Each machine processes at most one job at any time. A sequence of jobs with due dates arrive over time where the value of is unknown to online algorithms in advance. The information of each job is released on its release time to online algorithms. If a job is completed on or before its due date, we say it is an early job; otherwise it is a tardy job. The objective is to maximize the number of early jobs. We consider the preemption-restart model such that if a job on processing is preempted, then all the progress that has been made on the job so far is lost. A preempted job has to be restarted from the beginning to be completed later on.
Below we introduce some notations. : the processing time of job .: the release time of job .: the due date of job .Feasible schedule: a schedule consists of early jobs.Current workload (of a machine): the total processing time of all jobs currently assigned to one machine at a time.
By the objective of maximizing the number of early jobs, we may schedule the processing of all tardy jobs after the last early job, and the processing of tardy jobs has no relation to the objective value. That is, it suffices to consider only feasible schedule and omit all the tardy jobs. In the remainder, when discussing a schedule produced by an online algorithm, we refer to a feasible schedule instead of the original schedule including preempted jobs.
At any time , let denote the remaining processing time of job with . From this definition, if is neither on processing at time nor completed by the time. On the other hand, if was started at time and is being processed throughout time interval , then . When the notation is completely understood, we sometimes use instead of for notational convenience.
3. Upper Bound of Competitive Ratio
In order to show the upper bound of competitive ratio for all online algorithms, we use the following lemma.
Lemma 3.1. In identical machine scheduling problem, for any integer and for all real numbers and with , there exists an adversary strategy with the following properties.(1) creates jobs. The earliest release time of these jobs is , and the latest due date of these jobs is .(2)There exists a feasible schedule in which all the jobs are early. In such a schedule, the machines are continuously busy throughout interval .(3)If machines are unavailable throughout interval [), the adversary strategy can prevent any online algorithm from scheduling more than jobs to be early.(4)The adversary strategy can prevent any online algorithm from scheduling more than jobs to be early. That is, any online algorithm has at least tardy jobs.
Proof. The proof is by induction on . For , the adversary releases jobs with processing time at time . For , the adversary proceeds as follows. Let , that is, . The adversary releases jobs with processing times and for at time . All these jobs have due date . Then the adversary waits until time .
Case 1. If at time the online algorithm is processing at least one job with and thus , then calls subadversary .
Case 2. Otherwise, calls subadversary .
(1) The Proof of Property (1)
When , Property (1) holds. Consider the case . Assume that Property (1) follows for . Since creates new jobs together with the jobs generated by the subadversary, Property (1) holds for .
(2) The Proof of Property (2)
To prove Property (2), we consider the following schedules with all jobs early. In Case 1, machine- processes jobs and within intervals and , respectively, then the machines process all jobs of the subadversary by induction. In Case 2, machine- processes jobs and within intervals and , respectively, then the machines process all jobs of the subadversary by induction.
(3) The Proof of Property (3)
Given the assumption that machines are unavailable throughout interval , we prove Property (3) by induction on . For , Property (3) holds, that is, can prevent any online algorithm from scheduling more than jobs to be early with the assumption of unavailable machines. Assume that for (in case), Property (3) holds, that is, can prevent any online algorithm from scheduling more than jobs to be early with available machines. To prove that Property (3) holds for , we observe that within interval , available machines can schedule at most jobs to be early among the jobs that were released by . More precisely, the machines can process at most jobs during each of intervals and . This observation is true for both Cases 1 and 2. Together with the jobs generated by the subadversary, there are at most early jobs, and thus Property (3) follows.
(4) The Proof of Property (4)
Now, we show that Property (4) holds by induction on . First, it is a trivial case when . Assume that for (in case), Property (4) holds, that is, can prevent any online algorithm from scheduling more than jobs to be early. The remainder is to prove that Property (4) holds for . Consider the following two cases.
Case A. The online algorithm schedules all the jobs to be early. If Case 1 happens, that is, at least one of the jobs with length is being processed at time . Notice that this job is to be completed no earlier than time . It implies that at least one of the jobs, denoted by , with length must be started within interval to be completed on time due to its job length and due date . The processing of will then cover interval on one of the machines, that is, the machine for processing job is unavailable to other jobs throughout the interval, then we call subadversary . By Property (3), throughout interval , the online algorithm can schedule at most jobs to be early. Therefore, the total number of early jobs by the online algorithm is Otherwise, if Case 2 happens, then all the jobs, , with length must be completed by the machines on or before time . This implies that the machines are unavailable for all jobs except jobs within interval . By calling subadversary , the online algorithm schedules only jobs to be early. Hence, Property (4) holds in this case.
Case B. Among the jobs , the online algorithm schedules at most of them to be early. By induction, for , the online algorithm can schedule at most jobs to be early in both Case 1 and Case 2. Together with the other early jobs scheduled by the online algorithm for , we have that the number of early jobs is at most Property (4) follows.
Remark 3.2. Lemma 2 in  is a special case of the above lemma with .
Theorem 3.3. For the online scheduling problem on identical machines to maximize the number of early jobs, any online algorithm has competitive ratio .
Proof. Let and denote the number of early jobs of an offline optimal algorithm (offline algorithm for short) and that of an online algorithm, respectively. By Lemma 3.1, we have and . Therefore, The theorem follows.
4. ECT Algorithm
In this section, we describe and analyze online algorithm ECT, which is based on the shortest remaining processing time (SRPT) or ECT rule. Algorithm ECT constructs a feasible schedule of early jobs only, since all tardy jobs can be appended to the end of this schedule in an arbitrary order.
Given a job instance , algorithm ECT runs as follows.
Step 1. Wait until a decision time point , at which either a new job is released or at least one of the machines, becomes idle.
Step 2. At time , let be the job such that , that is, is with the shortest remaining processing time among all the uncompleted arrival jobs. If there is no idle machine at the time, schedule on the machine with the least current workload and start the job immediately; otherwise, start to process at the time on any idle machine.
Step 3. If at some decision point , no more jobs are released and holds for any arrival job with , stop; otherwise, go to Step 1.
Note that algorithm ECT applies the earliest completion time (ECT) policy to the case with identical machines. By Step 2 of the algorithm, a job is preempted only if a newly released job is supposed to be completed earlier than the current one.
Without loss of generality, we assume that the machines are reindexed in nondecreasing order of job length considering the jobs which are scheduled at the first position on the machines. Let be the number of early jobs in a schedule . Let be the feasible schedule produced by ECT, and let be an optimal schedule, respectively. Let be the job with the th smallest completion time in schedule . If two jobs are completed at the same time, the job completed on the machine with smaller index is regarded to be completed earlier.
Note that only contains early jobs and algorithm ECT terminates at some time , at which none of the rest uncompleted jobs in can meet its due date even if started at once.
Theorem 4.1. Algorithm ECT is -competitive.
Proof. If , the theorem follows. In the following proof, we assume that . To prove the theorem, it is sufficient to prove that . We construct a series of feasible schedules such that , and is different from . is obtained from for in the following way.
Let be the smallest such that for . Such a does exist since is different from . From the notation, we have either or is obtained by(i)deleting job from ; (ii)either moving or adding job to the place of , depending on whether the job was already in .
By construction, is necessarily feasible since is the job to be completed the earliest among all uncompleted jobs at that time (ECT policy). Furthermore, for , we have either or
This work is partially supported by NSF of China under Grants nos. 71172189, 71101106, 70832005, 71071123, and 71090404/71090400.
- K. Pruhs, J. Sgall, and E. Torng, “Online scheduling,” in Handbook of Scheduling: Algorithms, Models, and Performance Analysis, J. Y.-T. Leung, Ed., 2004.
- A. Borodin and R. El-Yaniv, Online Computation and Competitive Analysis, Cambridge University Press, Cambridge, UK, 1998.
- J. Sgall, “On-line scheduling,” in On-line Algorithms: The State of the Art, A. Fiat and G. J. Woeginger, Eds., vol. 1442 of Lecture Notes in Computer Science, pp. 196–231, Springer, Berlin, Germany, 1998.
- D. B. Shmoys, J. Wein, and D. P. Williamson, “Scheduling parallel machines on-line,” SIAM Journal on Computing, vol. 24, pp. 1313–1331, 1995.
- H. Hoogeveen, C. N. Potts, and G. J. Woeginger, “On-line scheduling on a single machine: maximizing the number of early jobs,” Operations Research Letters, vol. 27, no. 5, pp. 193–197, 2000.
Copyright © 2012 Feifeng Zheng et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.