A Note on Multimachine Scheduling with Weighted Early/Late Work Criteria and Common Due Date

Department of Computer Science and Technology, Shenyang University of Chemical Technology, Shenyang 110142, China School of Electronics and Information Engineering, Liaoning University of Technology, Jinzhou 121001, China NTIS Center, Korea Institute of Science and Technology Information, Seoul 34113, Republic of Korea School of Information Engineering, Jiujiang Vocational and Technical College, Jiujiang 332007, China School of Software, Dalian University of Technology, Dalian 116623, China Key Lab for OCME, College of Mathematical Science, Chongqing Normal University, Chongqing 401331, China


Introduction
Scheduling with due date constraint [1,2] has been widely studied in the field of combinatorial optimization, such as minimizing tardiness [3], lateness [4], or the number of late jobs [5]. Among all the criteria related to the due date, late work [6] and early work [7] are a pair of symmetrical objectives, in which the former one indicates the loss once a job is finished after its due date, while the latter one implies the profit when a job starts execution before this time. e concept of late work was first proposed in 1984 by Błażewicz [8], who was motivated from the scene of data collection in a control system, and, therefore, he called this parameter "information loss" at that time. en, in 1992, Potts and Van Wassenhove [9] claimed that this criterion can model not only information collection but also other situations where a perishable commodity is involved, so they suggested using the term "late work." After these pioneers, scheduling with late work minimization has attracted much attention from different research groups, for example, [10][11][12][13][14].
Although the formal investigation on the early work maximization problem was started from 2017 [7], this parameter has already appeared frequently in the literature since 2004, which was used as auxiliary metrics when analysing the optimal schedules for late work problems, for example, [10,11]. Due to the symmetry of these two criteria, scheduling with late work minimization and early work maximization shares the same essence when the offline optimal solutions are constructed. However, since the difference when an approximation solution is evaluated [12], scheduling with early work criterion gradually became a new subject, and several studies were devoted to it [13,14].
In this note, we revisit two types of scheduling problem with a common due date to maximize total weighted early work of all jobs or, equivalently, to minimize total weighted late work (in sense of complexity and optimal offline solution analysis).
We focus on the identical machines and two-machine flow shop environments, respectively, and, therefore, the problems considered in this paper could be presented as Pm|d j � d| max(X w ) (or equally, Pm|d j � d|Y w ) and F2|d j � d| max(X w ) (or equally, F2|d j � d|Y w ), using the classical three-field notation in the scheduling field [15]. e rest of this paper is organized as follows. In Section 2, we give the formal definitions of the studies problems, i.e., Pm|d j � d|max(X w ) and F2|d j � d|max(X w ), respectively. Section 3 is devoted to the former problem, where we propose a dynamic programming approach running in pseudopolynomial time and an enumeration algorithm in exponential time, on the basis of a property of an optimal schedule. In Section 4, we focus on a previous dynamic programming method in [16], by introducing some improvement techniques. Finally, the whole paper is concluded in Section 5.

Problem Formulation
e early work of a job J j (denoted as X j ) is defined as the early part (if any) executed before its due date d j . at is, let p j and C j be the processing and completion time of J j , respectively; we have Correspondingly, the late work of J j (denoted as Y j ) is the late part processing after d j , i.e., Based on the definitions of these two parameters, we have X j + Y j � p j .
us, the problems we considered in this paper can be described as follows: (1) Pm|d j � d| max(X w ). Input: there are m identical machines and n jobs, and each job J j is accompanied by its processing time p j , weight w j , as well as a common due date d (1 ≤ j ≤ n). Output: assign the n jobs to the m machines without preemption, with the goal of maximizing total weighted early work of all jobs (denoted as X w ), in which X w � n j�1 w j X j . As we mentioned before, the above problem could be presented as Pm|d j � d| max(X w ) by the three-field notation, in which we use max in the c field to emphasize that it is a maximization problem. Moreover, since the symmetry of early work maximization and late work minimization, we have w j Y j � w j p j − w j X j (so does n j�1 w j Y j � n j�1 w j p j − n j�1 w j X j ), which implies that the results on the complexities and the constructions of the optimal offline solutions could be directly transferred from Pm|d j � d| max(X w ) to Pm|d j � d|Y w .
(2) F2|d j � d| max(X w ). In this model, we are given a two-machine flow shop, and each job (also accompanied with p ji -the processing time of J j on M i for i ∈ 1, 2 { }, a weight w j , and a common due date d) has to be processed firstly on M 1 and then on M 2 . Same as in the previous one, we are aimed to schedule these jobs into the system so that to maximize total weighted early work, i.e., n j�1 w j X j (here we define It is worth to be mentioned that, when analysing complexity and designing optimal offline algorithms, the problem could be treated as the same as F2|d j � d|Y w , which is the original representation in [16].

Exact Approaches for
In this section, we first introduce a property of an optimal schedule for problem Pm|d j � d| max(X w ), based on which we propose two exact approaches. Among them, the former one is a dynamic programming method running in pseudopolynomial time, so that we can decide that problem Pm|d j � d| max(X w ) belongs to the set of binary NP-hard, while the latter is an enumeration one, which can help us to verify the correctness and efficiency of the dynamic programming by computational experiments.

Property of an Optimal Schedule.
We now introduce a property of an optimal schedule in Lemma 1, which could help us to design the exact methods for problem Pm|d j � d| max(X w ) latter.

Lemma 1.
ere exists an optimal schedule for problem Pm|d j � d| max(X w ) such that on each machine, jobs are sequenced in nonincreasing order of their weights.
Proof. Suppose that there exists one of the optimal schedules π, in which on machine M i (1 ≤ i ≤ m), there are two jobs J k and J h such that J k ≺J h while w k < w h , where J k ≺J h means that J k precedes (close to) J h on M i . en, we can construct a new schedule π ′ by exchanging the positions of the two jobs and show that the criterion value X w cannot decrease after this modification.
We prove the above declaration based on the possible values of the common due date, i.e., d. Denote S j and C j as the start and completion time of the job J j in π, respectively (1 ≤ j ≤ n). □ Case 1. d ≤ S k , which means that both jobs are late in π (also in π ′ ). en, the total weighted early work of these two jobs is equal to 0, in both π and π ′ .
where both jobs are early in π (also in π ′ ). en, the criterion value of these two jobs is equal to w k · p k + w h · p h , in both π and π ′ .
Case 3. S k < d < C h . en, the total weighted early work of these two jobs in π is equal to We claim that the criterion value would be increased in π ′ , since the length of the early parts of the two jobs remains the same (as in π), while the weight becomes higher after the exchanging. erefore, in any optimal schedule, by adjusting the positions of the two adjacent jobs which do not follow this order, we can finally get another optimal schedule, which concludes this lemma.

Dynamic Programming Approach.
Based on Lemma 1, we could construct an optimal solution with the following process: (1) we first reorder the job sequence in nondecreasing order of jobs' weights, i.e., w 1 ≤ w 2 ≤ . . . ≤ w n ; (2) then, we assign the jobs in the ordered sequence one by one to a suitable machine, using a dynamic programming approach defined as follows.
Let f(j, E 1 , E 2 , . . . , E m ) denote the maximal total weighted early work of the first j jobs scheduled on m machines, where the early parts are executed for at most E 1 , E 2 , . . . , E m units on M 1 , M 2 , . . . , M m , respectively. e initial condition should be set as f (0, E 1 , E 2 ≤ m), and the optimal criterion value is output as f(n, d, d, . . . , d).
e recurrence procedure runs according to the following formula: We give the complete procedure in Algorithm 1, denoted as Algo DP p . e sorting process requires O(n log n) time, and the dynamic programming approach runs in O(nd m ). Summing up, the time consumption of Algo DP p is O(max n log n, nd m }), which is pseudopolynomial when m is fixed. en, we have the following theorem.

Theorem 2.
Problem Pm|d j � d| max(X w ) belongs the set of binary NP-hard.

Proof (Proof of eorem 2).
is theorem holds since the existence of Algo DP p . □ 3.3. Enumeration Algorithm. To further reveal the correctness and efficiency of Algo DP p , we also propose an enumeration algorithm for comparison. We first sort the jobs in nonincreasing order of their weights and then enumerate all the possible partitions to find the optimal solution. e procedure is presented in Algorithm 2 denoted as Algo EM.
Since there are m machines and n jobs, it takes O(m n ) time to check all the possible schedules. erefore, Algo EM runs in O(max n log n, nd m ) time.

Computational Experiments.
To compare the two algorithms proposed in Sections 3.2 and 3.3, we design a set of numerical experiments in this part. Since both of them return the optimal solutions, we focus on the efficiencies of these approaches, i.e., their time consumption.
Motivated by [7], we set the experiment data by the following process. e job processing time p j was randomly taken with a discrete uniform distribution from [1,20], and the weight w j was taken also from this range. e common due date d is set to be d � ( n j�1 p j /m For each pair of (m, n), we generate 25 random instances and show the results in Table 1, in which the running time of Algo DP p and Algo EM is reported in milliseconds (ms).
From Table 1, we can find that Algo DP p works much more efficiently than Algo EM. Basically, the time consumption of Algo DP p is O(max n log n, nd m ) (O(nd m ) for most of the case) while Algo EM takes O(m n ) time, which results in the fact that the latter one needs more time when processing the same setting of (m, n) than the former. More precisely, for a fixed m, the time consumption of Algo DP p increases slowly while Algo EM increases drastically, along with the increment of n. is is mainly because that nd m could be considered as a linear function of n while m n is an exponential one, when m is fixed. Finally, Algo EM has to stop at n � 25 when m is 2, and n � 15 when m is 3, due to the limitation of memory. However, Algo DP p could solve all the test sequences, mostly within 1 second in our experiments.

Precise Analysis on
In this section, we focus on a previous dynamic programming approach proposed in [16] (denoted as Algo DP f in this paper) for problem F2|d j � d| max(X w ) and introduce several improvement techniques by carefully analysing the characteristics of some parameters. rough computational experiments, we show that these skills are effective to help us to obtain the optimal solutions faster than the original version.

Brief
Introduction on Algo DP f . In [16], the authors considered problem F2|d j � d|Y w (which is the same as F2|d j � d| max(X w ) since they focused on the complexity and the construction of the offline optimal solutions) and proposed a dynamic programming approach Algo DP f running in O(n 2 d 4 ). e result is very important since it can solve the problem optimally and clarify the problem complexity clearly (binary NP-hard).
For a job set J, Algo DP f adopts an enumeration with a recurrence process to find the first partially late job (denoted as J * ) and divides the remaining jobs into three subsets, which are J E (all the totally early jobs), J P (all the partially late jobs except for J * ), and J L (all the totally late jobs).
en, Algo DP f returns an optimal schedule as J E ≺ J * ≺J P ≺J L , in which (1) Jobs in J E are sequenced by Johnson's order [17] (2) A special job in J P should take the last position in this set if it exists, while the others are sequenced arbitrarily (3) Jobs in J L are scheduled arbitrarily Algo DP f enumerates each job one time as the potential J * . For each selection (say J i { } * ), it uses a recurrence process to obtain the maximal total weighted early work, under the assumption that J i { } * is the "first partially late job." e recurrence process runs based on a state function f k (A, B, t, a), which denotes the maximum weighted early work among jobs J k , J k+1 , . . . J n (J n is actually J i { } * in the current case), when these jobs start exactly at time A on M 1 and not earlier than at time B on M 2 . Moreover, parameter t means that there are exactly t time units remained on M 1 after J i { } * and before the common due date d, while a � 0 (or 1) means that there is no job (or only one job) among J 1 , J 2 , . . . J k− 1 partially executed on M 1 after J i { } * and before d. For each selection of J i { } * , the initial state is set to be f n (A, B, t, a) for all 0 ≤ A, B, t ≤ d, and a ∈ 0, 1 { } based on several different conditions, while the optimal weighted early work under this assumption (J i { } * is the first partially late job) is output by f 1 (0, 0, 0, 0). e above recurrence process needs O(nd 4 ) time, and, therefore, considering the enumeration of every job as J i { } * , the whole procedure of Algo DP f requires O(n 2 d 4 ) time. For further details of this approach, refer to [16] or [18].

Several Improvement Techniques.
Algo DP f is a very important result for F2|d j � d| max(X w ) (so does for F2|d j � dY w ) since it declared problem complexity more precisely. However, from the implementation point of view, we found that some details could be analysed, which can result in the fact that some unnecessary calculations could be avoided.
Based on the characteristic of flow shop scheduling, we claim the relationship of A and B in each state f k (A, B, t, a), in Property 1.

Property 1.
For each state f k (A, B, t, a) in Algo DP f , B ≥ A + min k≤j≤n p j1 , where p j1 means the processing time of J j on M 1 .
Moreover, due to the definitions of t, A, and d in the state function, we declare Property 2.

Property 2.
For each state f k (A, B, t, a) in Algo DP f , t ≤ d − (A + n j�k p j1 ).
erefore, for the states that violate the above properties, we set their values directly as "− ∞" without further calculations. Consequently, we denote the procedure introducing these two properties as Algo DP f ′ .

Computational Experiments.
e same as in section 3.4, we introduce a series of numerical experiments to show the advantages of the properties in 4.2, i.e., we compare Algo DP f ′ with Algo DP f .
We adopt the data set from [18] for our experiments, in which Algo DP f , an enumeration algorithm, and several heuristics for problem F2|d j � dY w (also available for F2|d j � d| max(X w )) were compared. According to this literature, the job number n was selected from 10, 12, 14, 16, 18 { }, while the processing time p ji and the job weight w j were randomly taken from [1,10] and [1,5], respectively. Finally, the common due date d was set to be 30% of the mean machine load, i.e., d � 30% × ( n j�1 (p j1 + p j2 )/2).
We use the same language and platform as in Section 3.4, i.e., C++ and a PC with Intel Core i7-8550U 1.8 GHz CPU and 8 GB DDR4 RAM. For each value of n, we generate 25 random instances and report the experiment results in Table 2. For each procedure, its average running time (in milliseconds, ms) is shown in the columns of "time (ms)". Moreover, the improvement ratio from Algo DP f to Algo DP f ′ , calculated as (1 − (t ′ /t)) × 100% (where t ′ and t are the running time of Algo DP f ′ and Algo DP f , respectively), is displayed in column "Imp (%)". Now, we see the power of the two properties in Section 4.2, at least from the implementation point of view. For all the (1) Reorder the jobs by nondecreasing order of their weights, i.e., w 1 ≤ w 2 ≤ · · · ≤ w n ; (2) Assign J 1  settings of value n, Algo DP f ′ beats Algo DP f , and, on average, the former procedure saves 21.17% of the execution time of the latter one. e reason is that Algo DP f ′ can avoid several unnecessary calculations if the two properties are violated.

Conclusions
In this paper, we considered two problems of scheduling on multimachine with weighted early work maximization (or equivalently, late work minimization): (1) For identical machines version, i.e., problem Pm|d j � d| max(X w ), we proposed a dynamic programming approach (Algo DP p ) running in pseudopolynomial time and, therefore, showed that the problem is NP-hard in the weak sense. We also designed an enumeration algorithm (Algo EM), to reveal the correctness and efficiency of Algo DP p through computational experiments. (2) For two-machine flow shop setting (F2|d j � d| max (X w )), we studied a previous dynamic programming approach by precise analyses. By introducing two properties in the state function, some unnecessary calculations could be avoided during processing. Finally, we again used the computational experiments to show that these improvements are efficient at least from the implementation point of view.
For the future work, one can consider the more general cases, e.g., the individual due date models, and design exact or heuristic algorithms to solve them. Moreover, the approximation analyses for some special cases, especially for the flow or job shop setting, could be considered as another research direction.
Data Availability e authors use the benchmarks from their references.

Conflicts of Interest
e authors declare that there are no conflicts of interest in this paper. ALGORITHM 2: Algo EM.