On the tractability of hard scheduling problems with generalized due-dates with respect to the number of different due-dates

We study two NP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {NP}$$\end{document}-hard single-machine scheduling problems with generalized due-dates. In such problems, due-dates are associated with positions in the job sequence rather than with jobs. Accordingly, the job that is assigned to position j in the job processing order (job sequence), is assigned with a predefined due-date, δj\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\delta _{j}$$\end{document}. In the first problem, the objective consists of finding a job schedule that minimizes the maximal absolute lateness, while in the second problem, we aim to maximize the weighted number of jobs completed exactly at their due-date. Both problems are known to be strongly NP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathcal {NP}$$\end{document}-hard when the instance includes an arbitrary number of different due-dates. Our objective is to study the tractability of both problems with respect to the number of different due-dates in the instance, νd\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\nu _{d}$$\end{document}. We show that both problems remain NP\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ \mathcal {NP}$$\end{document}-hard even when νd=2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\nu _{d}=2$$\end{document}, and are solvable in pseudo-polynomial time when the value of νd\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\nu _{d}$$\end{document} is upper bounded by a constant. To complement our results, we show that both problems are fixed parameterized tractable (FPT) when we combine the two parameters of number of different due-dates (νd\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\nu _{d}$$\end{document}) and number of different processing times (νp\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\nu _{p}$$\end{document}).


Introduction
In most classical scheduling problems involving due-date related performance measures, the due-dates are given as a set of predefined job-related parameters, i.e., each job has its own predefined due-date given by the instance. When scheduling with generalized due-dates (gdd's), the due-date of each job is defined only after the scheduling decisions are made. Accordingly, due-dates are associated with positions in the job processing order, and each job is assigned with a due-date based on its position in this order. Yin et al. (2012) pointed out that scheduling with gdd arises in cases where there are milestones in a serial project, each indicating the number of operations that are required to be completed up to a certain point in time. Browne et al. (1984), Hall (1986) and Stecke and Solberg (1981) describe situations in which generalized due-dates arise in practical settings, including in public utility planning, survey design and flexible manufacturing.

Literature review and problem definition
The field of scheduling with gdd was first introduced by Hall (1986) who analyzed several scheduling problems with gdd on a single machine and on identical parallel machines. He showed that some problems that are solvable in polynomial time for the case of job-related due-dates remain so when generalized due-dates are considered. This includes the problems of the minimizing maximum lateness and the number of tardy jobs on a single machine. He also showed, however, that for some other problems the complexity status changes. For example, Hall showed that although the problem of minimizing the total tardiness on a single machine is N P-hard when due-dates are job-related (see Du & Leung, 1990), it is solvable in polynomial time with gdd. Other results on scheduling under the assumption of gdd appear in Sriskandarajah (1990), Hall et al. (1991), Tanaka and Vlach (1999), Gao and Yuan (2006), Yin et al. (2012) and Gerstl and Mosheiov (2020) .
In many cases where a scheduling problem with gdd is found to be N P-hard, the reduction is done to an instance that includes an arbitrary number of different due-dates, ν d (see, e.g., Tanaka & Vlach, 1999;Gerstl & Mosheiov, 2020). However, in real-life applications, especially in cases where delivery costs are very high, the value of ν d may be of limited size. Therefore, it is interesting to investigate whether or not the problems become tractable for bounded values of ν d . We focus on two such problems, where the scheduling criterion is non-regular and follows the concept of just in time (JIT ). The concept of JIT is used whenever both job earliness and tardiness should be avoided, i.e., when it is desirable to complete a job's processing at, or as close as possible, to its due-date. In the first problem, our aim is to find a schedule that minimizes the maximum absolute lateness, while in the second problem we seek a schedule that maximizes the weighted number of jobs completed exactly at their due-dates.
The two problems we consider in this paper are defined as follows. We are given a set J = {J 1 , J 2 , . . . , J n } of n jobs to be scheduled non-preemptively on a single machine. Let p j be the processing time of job J j on the single machine. A feasible job schedule S is defined by (i) a processing permutation π = {J [1] , J [2] , . . . , J [n] } of the n jobs on the single machine, where [ j] is the index of the job in the jth position in π , and by ( ii) a feasible set of processing intervals, (S [ j] , C [ j] = S [ j] + p [ j] ] for j = 1, . . . , n, satisfying that S [ j] ≥ C [ j−1] = S [ j−1] + p [ j−1] for j = 1, . . . , n, where S [ j] and C [ j] are the start time and the completion time of job J [ j] , respectively, and S [0] = p [0] = 0 by definition. Given S, the due-date assigned to job J [ j] is δ j . Accordingly, the lateness of job J [ j] is defined by L [ j] = C [ j] − δ j . Moreover, we say that job J [ j] is a JIT job if C [ j] = δ j , and by E = {J j ∈ J C [ j] = δ j }, we denote the set of JIT jobs. In the first problem, our objective is to find a feasible schedule that minimizes the maximum absolute lateness, given by max J j ∈J { L j }, while in the second problem we aim to find a solution that maximizes the weighted number of JIT jobs, given by J j ∈E w j , where w j is the weight of job J j representing the gain obtained from completing job J j in a JIT mode. Using the classical three-field notation for scheduling problems (see Graham et al., 1979), we denote the first problem we study by 1 |gdd| max J j ∈J { L j } and the second problem by 1 |gdd| J j ∈E w j . We note that } is the earliness of job J [ j] , and T [ j] = max{0, C [ j] − δ j } is the tardiness of job J [ j] . By 1 || max J j ∈J { L j } and 1 || J j ∈E w j , we refer to the variant of the same problems where due-dates are jobrelated.
When due-dates are job-related, the resulting 1 || max J j ∈J { L j } and 1 || J j ∈E w j problems are solvable in polynomial time (see Garey et al., 1988 andLann andMosheiov, 1996). However, both problems are strongly N P-hard with generalized due-dates (see Tanaka &Vlach, 1999 andGerstl &Mosheiov, 2020), and for the 1 |gdd| J j ∈E w j problem, the strongly N P-hardness result holds even if all weights are identical (i.e., even when the objective is simply to maximize the number of JIT jobs, |E|).

Research objectives and paper organization
The reductions used by Tanaka and Vlach (1999) and Gerstl and Mosheiov (2020) to prove that problems 1 |gdd| max J j ∈J { L j } and 1 |gdd| |E| are strongly N P-hard are done by constructing instances that include an arbitrary number of different due-dates. We aim to see whether the problems become easier to solve when the number of different due-dates in the instance is of a limited size. Our analysis is done from both a classical (see Garey & Johnson, 1979) and a parameterized (see, e.g., Downey, 1999& Niedermeier, 2006 complexity point of view. To do so, let v d be the number of different due-dates in the instance. From a classical complexity perspective, we aim to determine whether or not the problems are solvable in polynomial time when v d is upper bounded by a constant. If not, we aim to determine whether the problem remains N P-hard in the strong sense, or it is solvable in pseudo-polynomial time. We also aim to determine the complexity of each problem with respect to (wrt.) v d in the sense of parameterized complexity.
Given an N P-hard problem and a parameter k, in parameterized complexity we aim to determine whether the problem has an algorithm running in f (k)n O(1) time, where f (k) is a function that depends solely on k (and thus independent of the number of jobs n). Such an algorithm is referred to as a Fixed Parameter Tractable (FPT ) algorithm wrt. k. Note that an FPT algorithm is always faster than an n f (k) algorithm, for any monotone increasing function f (k), when n and k are sufficiently large. Thus, for example, an FPT algorithm is preferable over an algorithm that is polynomial whenever k is constant.
In Sections 2 and 3, we analyze the tractability of problems 1 |gdd| max J j ∈J { L j } and 1 |gdd| J j ∈E w j wrt. ν d . We prove that problems 1 |gdd| max J j ∈J { L j } and 1 |gdd| |E| are both N P-hard even if ν d = 2. Unless P=N P, this result rules out the possibility to construct FPT algorithms for problems 1 |gdd| max J j ∈J { L j } and 1 |gdd| |E| wrt. ν d . We also provide pseudo-polynomial time algorithms to solve problems 1 |gdd| max J j ∈J { L j } and 1 |gdd| J j ∈E w j when ν d is upper bounded by a constant. These results lead to the conclusion that both problems are strongly N P-hard only for an arbitrary value of ν d , while they both become ordinary N P-hard when ν d is upper bounded by a constant. As both problems do not admit an FPT algorithm wrt. ν d , we further analyze the case where we combine parameter ν d with another parameter, ν p , which represents the number of different processing times in the instance. We provide FPT algorithms for problems 1 |gdd| max J j ∈J { L j } and 1 |gdd| |E| wrt. the combined parameter. A summary and future research section concludes our paper.

Maximal absolute lateness
The 1 |gdd| max{ L j } problem is strongly N P-hard when due-dates are arbitrary (see Tanaka & Vlach, 1999). When there is a common due-date for all jobs (i.e., ν d = 1), a simple O(n) time algorithm provides the optimal schedule for the corresponding 1 gdd, δ j = δ max{ L j } problem (see Cheng, 1987). In the following three subsections, we complement these two results by showing that the 1 |gdd| max{ L j } problem is (i) N P-hard even when we have only two distinct due-dates in the instance; (ii) solvable in pseudo-polynomial time when the value of ν d is upper bounded by a constant; and (iii) fixed parameterized tractable (FPT ) when we combine the two parameters consisting of the number of different due-dates (ν d ) and number of different processing times (ν p ).

N P-hardness for the two distinct due-dates case
In this subsection, we show that the 1 |gdd| max{ L j } is N P-hard even when ν d = 2. The reduction is done from the ordinary N P-hard Equal Size Partition problem, which is defined below.
Definition 1 Equal Size Partition: Given a set of 2t positive integers A = {a 1 , a 2 , . . . , a 2t } with 2t j=1 a j = 2B and 0 < a j < B. Can A be partitioned into two subsets A 1 and A 2 such that a j ∈A i a j = B and |A i | = t for i = 1, 2?
Theorem 1 The 1 |gdd| max{ L j } is N P-hard even when there are only two distinct due-dates ( i.e., even when ν d = 2).
Proof Given an instance for the N P-hard Equal Size Partition problem, we construct the following instance for our 1 |gdd| max{ L j } problem: The instance includes n = 2t + 2 jobs. The processing times are: p j = a j for j = 1, . . . , 2t 2B for j = 2t + 1, 2t + 2 (1) and the due-dates are In the decision version of the problem, we ask whether there exists a feasible schedule with max{ L j } ≤ B/2. Note that there are only two distinct due-dates in the constructed instance of the 1 |gdd| max{ L j } problem. Given a solution that provides a YES answer for the Equal Size Partition, we construct the following solution S to our 1 |gdd| max{ L j } problem. We set J i = {J j a j ∈ A i } for i = 1, 2. Then, we schedule the jobs in the following order: J 2t+1 , J 1 , J 2t+2 ,J 2 with no machine idle times. The processing order in each J i (i = 1, 2) is arbitrary. Since |J i | = |A i | = t, all jobs in J 2t+1 ∪ J 1 share the same duedate of δ = 2.5B, and all jobs in J 2t+2 ∪ J 2 share the same due-date of δ = 5.5B. Therefore, in S: is the index of the jth job in the processing order. The fact that Thus, |L 2t+2 | = |5B − 5.5B| = 0.5B. • Job set J 2 is scheduled during time interval (5B, 6B].
Therefore, max J j ∈J 2 L j = max{ 5B + p [t+3] − 5.5B , It follows that in schedule S, max J j ∈J { L j } = 0.5B, and we have a YES answer for the constructed instance of our 1 |gdd| max{ L j } problem.
Consider next a solution S that provides a YES answer for the constructed instance of our 1 |gdd| max{ L j } problem.

Lemma 1 In S, there are no machine idle times.
Proof If S includes machine idle times of a total length of > 0, then the last job is completed at time 6B + . As the last scheduled job is assigned a due-date of δ = 5.5B, its absolute lateness equals to 0.5B + > 0.5B, contradicting the fact that S provides a YES answer for the 1 |gdd| max{ L j } problem. Now, let J 1 be the set of t + 1 jobs that are scheduled first in S, and let J 2 be the set of t + 1 jobs that are scheduled last in S. All jobs in J 1 share the same due-date of δ = 2.5B, and all jobs in J 2 share the same due-date of δ = 5.5B.

Lemma 2 Set J 1 includes exactly a single job out of the pair
Proof By contradiction, assume that set J 1 includes either none or both jobs in {J 2t+1 , J 2t+2 }. If J 1 includes none of the two jobs in {J 2t+1 , J 2t+2 }, then based on Lemma 1 the first job to be schedule will complete at time , contradicting the fact that S provides a YES answer for the 1 |gdd| max{ L j } problem. If J 1 includes both {J 2t+1 , J 2t+2 }, the completion of the last job in J 1 will be at time , contradicting the fact that S provides a YES answer for the 1 |gdd| max{ L j } problem. Accordingly J 1 includes exactly a single job out of the pair {J 2t+1 , J 2t+2 }.
Following Lemma 2, and without loss of generality, assume that J 2t+1 is included in J 1 . Moreover, let

Lemma 3 In schedule S, the total processing time of all jobs
5B, contradicting the fact that S provides a YES answer for the 1 |gdd| max{ L j } problem. Now, let A 1 = {a j | J j ∈ J 1 } and A 2 = A A 1 . The fact that |A 1 | = J 1 = t and that a j ∈A 1 a j = J j ∈ J 1 p j = B implies that we have a YES answer for the Equal Size Partition problem.

A pseudo-polynomial time algorithm for a constant number of different due-dates
In this section, we develop a pseudo-polynomial time algorithm to solve the 1 |gdd| max{ L j } problem when the number of different due-dates, ν d , is bounded by a constant. We assume that δ 1 < δ 2 < · · · < δ ν d , and begin with few notations. Let m i denote the number of positions in the job processing order having a due-date of δ i for i = 1, . . . , ν d . Moreover, let l r = r i=1 m i denote the number of positions having due-date not greater than δ r for r = 1, . . . , ν d , with l ν d = n by definition. Given a solution, by J i we denote the set of m i jobs assigned to due-date δ i (i = 1, . . . , ν d ). Our pseudo-polynomial time algorithm exploits the properties in following two lemmas: Lemma 4 There exists an optimal schedule for the 1 |gdd| max{ L j } problem, which includes no machine idle times between the processing of any two consecutive jobs in each Proof Consider an optimal solution S * , which includes machine idle time of duration between the processing of jobs J [ j] and J [ j+1] both belong to the same set J i (i.e., j ∈ {l i−1 + 1, . . . , l i }). Define an alternative solution S out of S * , by starting the processing of jobs {J [ j+1] , .., J [l i ] } time units earlier (i.e., by eliminating the idle time between jobs J [ j] and J [ j+1] ), while keeping the schedule of all other jobs unchanged.
As all jobs in J i share the same due-date of d i , job J [l i−1 +1] has the maximum earliness value among all jobs in J i , while job J [l i ] has the maximal tardiness value among all jobs in J i . As the schedule of job J [l i−1 +1] is identical in both S and S * , the maximum earliness among all jobs in J i is the same in both S and S * . However, job J [l i ] is completed earlier in S comparing to its completion time in S * . Therefore, the maximum tardiness among all jobs in J i is not greater in S than it is in S * . Thus, the absolute lateness among all jobs in S is not greater than it is in S * . Accordingly, schedule S is optimal as well. By repeating this procedure for any pair of consecutive jobs in S * sharing the same due-date and having idle time between them, we complete the proof.
Lemma 5 There exists an optimal schedule for the 1 |gdd| max{ L j } problem, where the job with the largest processing time among all jobs in each set J i is scheduled first (within its job set), while the processing order of all other jobs in J i can be arbitrary.
Proof As all jobs in J i share the same due-date of d i , the first scheduled job in J i , which is job J [l i−1 +1] , has the maximum earliness value among all jobs in J i , while the last scheduled job in J i , which is job J [l i ] , has the maximal tardiness value among all jobs in J i . Consider now an optimal solution, S * , which follows the property in Lemma 4. It follows that in S where A i is the start time of set J i in S * , and P(J i ) = J j ∈J i p j . The lemma now follows from the fact the value of T [l i ] is independent of the internal schedule of the jobs in J i , and that the value of Consider now a feasible partition of job set J into the subsets J 1 , J 2 , . . . , J ν d , and let (i) P i = J j ∈J i p j represent the total processing time of all jobs assigned to set J i ; and (ii) and α i = max J j ∈J i p j represent the maximal processing time among all jobs assigned to set J i . Given the values of P i and α i for i = 1, . . . , ν d , we can compute the optimal starting times of job sets J 1 , J 2 , . . . , J ν d by using a Linear Programming (LP) formulation, consisting solely of continuous variables. In the formulation, S i is a continuous variable representing the start time of set J i on the single machine (i = 1, . . . , ν d ), and Z is a continuous variable representing the value of the maximum absolute lateness. To ensure that the processing intervals of the sets do not overlap, we include the set of constraints that with S 0 = P 0 = 0 by definition. Due to Lemmas 4 and 5, and due to the fact that all jobs in J i share the same due-date of δ i , the maximal earliness value of a job belonging to J i is equal to max{0, δ i − S i − α i }, and the maximal tardiness value of a job belonging to J i is equal to max{0, S i + P i −δ i }. Therefore, we include the following set of constraints as well and Thus, given a feasible partition of job set J into the subsets J 1 , J 2 , . . . , J ν d represented by the vector (P 1 , P 2 , . . . , P ν d , α 1 , α 2 , . . . , α ν d ), one can compute the optimal starting time of the job sets, and the minimal objective value by solving a LP problem of finding a solution that minimizes Z , subject to the set of constraints in (3)-(5). Using Karmarkar's Method (see Karmarkar, 1984), this can be done in O(ν 3.5 d ) time (note that we have ν d continuous variables in the LP formulation). Thus, the following holds: Lemma 6 Given a vector (P 1 , P 2 , . . . , P ν d , α 1 , α 2 , . . . , α ν d ) representing a feasible partition of J into the sets J 1 , J 2 , . . . , J ν d , one can compute the optimal starting time of each of the sets J i , J 2 , . . . , J ν d , and the minimal objective value in O(ν 3.5 d ) time.
It follows from Lemma 6 that we can solve our 1 |gdd| max{ L j } problem, by finding all possible (P 1 , P 2 , . . . , P ν d , α 1 , α 2 , . . . , α ν d ) vectors, each representing at least a single feasible partition of J into the sets J i , J 2 , . . . , J ν d . Then, for each such vector, we can find the optimal objective value by solving the LP formulation. Following this process, we select as an optimal solution a schedule that corresponds to the vector which yields the minimum objective value among all the vectors.
Step 1: Re-index the jobs according to the LPT rule such that p 1 ≥ p 2 ≥ ... ≥ p n .
Step 4: Track back the optimal assignment of jobs into the job sets J 1 , J 2 , ..., J ν d out of O pt.
Theorem 2 Algorithm 1 solves the 1 |gdd| max{ L j } problem in pseudo-polynomial time when the value of ν d is upper bounded by a constant.
Proof The correctness of the algorithm follows from the discussion in this section.
Step 1 requires a sorting operation, and therefore can be done in O(n log n) time. The facts that (i) the value of P i (i ∈ {1, . . . , ν d }) is upper bounded by P = J j ∈J p j , and that (ii) there are O(n) different possible values for each α i , implies that there are at most O((n P ) ν d ) states in each L j . In Step 2, we construct at most ν d states in L j out of state in L j−1 , each of which requires O(ν d ) time. Thus, each iteration j ∈ {1, . . . , n} of Step 2 requires O((ν d ) 2 (n P ) ν d ) time, and the overall complexity of Step 2 is O((ν d ) 2 n ν d +1 (P ) ν d ). In Step 3, for each state in L n , we solve an LP formulation, which requires O(ν 3.5 d ) time (see Lemma 6). The fact that we have O((n P ) ν d ) states in each L j , implies that Step 3 can be done in O(ν 3.5 d (n P ) ν d ) time. In Step 4 we track back the optimal assignment of jobs into the job sets J 1 , J 2 , . . . , J ν d out of Opt. This can easily be done in a linear time, and therefore the time complexity of Algorithm 1 is O((ν d ) 2 max{n, (ν d ) 1.5 }(n P ) ν d ).
If the value of ν d is upper bounded by a constant, this time complexity reduces to O(n ν d +1 (P ) ν d ), which is pseudopolynomial.

An FPT algorithm for the combined parameter ( d , p )
In this section, we prove that the following result holds: The proof of Theorem 3 is done by providing a Mixed Integer Linear Programming (MILP) formulation for the 1 |gdd| max J j ∈J { L j } problem with O(ν d ν p ) integer variables. Then, Theorem 3 directly holds from the result by Lenstra (1983) who showed that the problem of solving an MILP is FPT wrt. the number of integer variables.
For ease of presentation, we represent the vector of n due-dates in a modified manner by two vectors of size ν d : (δ 1 , δ 2 , . . . , δ ν d ) and (m 1 , m 2 , . . . , m ν d ). The first includes the ν d distinct due-dates in the instance. In the second, m i represents the number of positions in the sequence having a due-date of δ i . We also represent the vector of n processing times in a modified manner by two vectors of size ν p : (p 1 , p 2 , . . . , p ν p ) and (n 1 , n 2 , . . . , n ν p ), where the first includes the ν p distinct processing times in the instance, and n i is the number of jobs having processing time of p i for i = 1, . . . , ν p . Without loss of generality, we assume that the due-dates are numbered according to the EDD rule, such that δ 1 < δ 2 < · · · < δ ν d , and that the processing times are numbered according to the SPT rule, such that p 1 < p 2 < · · · < p ν p . Now, let x i j be an integer decision variable representing the number of jobs with processing time p j allocated to duedate δ i (i ∈ {1, . . . , ν d }, j ∈ {1, . . . , ν p }). Accordingly, we have the following set of constraints: and Now, let S i (i = 1, . . . , ν d ) be a continuous decision variable representing the start time of the jobs in set J i . Due to Lemma 4, the completion time of all jobs in set J i is at time S i + ν p j=1 p j x i j . Therefore, we include the following set of constraints that ensures that processing time intervals do not overlap: with S 0 = 0 by definition. Let Z be a continuous decision variable representing the maximum absolute lateness, and let α i be a continuous decision variable representing the largest processing time among all processing times of the jobs in J i (i ∈ {1, . . . , ν d }). Due to Lemma 5, and the fact that the first scheduled job in J i has the maximum earliness value among all jobs in J i , we include the set of constraints that Moreover, due to Lemmas 4-5, and the fact that the last scheduled job in J i has the maximal tardiness value among all jobs in J i , we also include the following set of constraints as well ( 1 0 ) To ensure that α i is indeed the largest processing time among all processing times of the jobs in J i , we define y i j as a binary variable that is equal to 1 when x i j ≥ 1 and is equal 0 otherwise (i ∈ {1, . . . , ν d }, j ∈ {1, . . . , ν p }). Then, we include the following set of constraints: and also the following set of constraints: l= j+1 p l y il for i = 1, . . . , ν d and j = 1, . . . , ν p .
Now, consider the problem P of minimizing Z subject to the set of constraints in (6)-(12). It implies from the objective, and the set of constraints in (9)-(10) that in an optimal solution for P which is exactly the value of the maximal absolute lateness of any solution that satisfy the properties in Lemmas 4 and 5 if indeed α i receives the largest processing time among all processing times of the jobs in J i . To prove that, we note that Z is a non-increasing function of α i for i = 1, .., n. Therefore, there exists an optimal solution for problem P, where α i is the largest value satisfying the set of constraints in (12). As the right hand side of the set of constraints in (12) is an increasing function of the y il variables, there exists an optimal solution in which y i j = 1 if x i j ≥ 1, and y i j = 0 if x i j = 0. Assume now that p q is the largest processing time among all processing times of the jobs assigned to J i (q ∈ {1, . . . , ν p }). It follows that y iq = 1, and that y i j = 0 for j = q + 1, . . . , ν p . Therefore, p j + ν p l= j+1 p l y il > p q for any j ∈ {1, . . . , q − 1}, p q + ν p l=q+1 p l y il = p q and p j + ν p l= j+1 p l y il = p j > p q for any j ∈ {q + 1, . . . , ν p }. Thus, the set of constraints in (12) reduces to α i ≤ p q , and since the value of Z is a non-increasing function of α i for i = 1, .., n, there exists an optimal solution for P in which α i = p q .
The fact that solving P provides an optimal solution for the 1 |gdd| max J j ∈J { L j } problem, and that P includes O(ν d ν p ) integer variables, implies that we can use Lenstra's algorithm (1983) algorithm to solve the 1 |gdd| max J j ∈J { L j } problem wrt. the combined parameter (ν d , ν p ), and Theorem 3 follows. Gerstl and Mosheiov (2020) prove that the following theorem holds:

Maximal weighted number of JIT Jobs
Theorem 4 (Gerstl & Mosheiov, 2020) The 1 |gdd| |E| problem is strongly N P-hard when the number of due-dates is arbitrary.
Consider next the case where all due-dates are common, i.e., δ j = δ for j = 1, . . . , n. For this case, it is obvious that at most a single job can be a JIT job, i.e., that for any feasible schedule we have that |E| ≤ 1. Now, let J = {J j ∈ J p j ≤ δ } be the subset of jobs which can be scheduled in a JIT mode. It implies that among all jobs in J it is optimal to schedule the one of maximal weight in a JIT mode. Therefore, the following corollary holds: In the following three subsections, we complement the results in Theorem 4 and Corollary 1 by showing that (i) the 1 |gdd| |E| problem is N P -hard even when we have only two distinct due-dates in the instance; (ii) the 1 |gdd| J j ∈E w j problem is solvable in pseudo-polynomial time when the value of ν d is upper bounded by a constant; and (iii) the 1 |gdd| |E| problem is FPT wrt. (ν d , ν p ). We leave the question of whether the 1 |gdd| J j ∈E w j is FPT wrt. (ν d , ν p ) open.

N P-hardness for the two distinct due-dates case
In this subsection, we show that the 1 |gdd| |E| is N P-hard even when ν d = 2. The reduction is done from the ordinary N P-hard Partition problem, which is defined below.
Definition 2 Partition: Given a set of t positive integers A = {a 1 , a 2 , . . . , a t } with t j=1 a j = 2B and 0 < a j < B . Can A be partitioned into two subsets A 1 and A 2 such that a j ∈A i a j = B for i = 1, 2?
Theorem 5 The 1 |gdd| |E| problem is N P-hard even when there are only two distinct due-dates (i.e., even when ν d = 2).
Proof The proof is based on a reduction from the N P-hard Partition problem. Given an instance for the Partition problem, we construct the following instance to our scheduling problem with a set J = {J 1 , . . . , J n } of n = t jobs. The processing times are for j = 1, . . . , t. The due-dates are In the decision version of the problem, we ask whether there is a feasible schedule with |E| = 2. Note that there are only two distinct due-dates in the constructed instance of the 1 |gdd| |E| problem. Therefore, |E| ≤ 2 in any feasible schedule. Consider a solution that provides a YES answer for the Partition problem, we construct the following solution S to our 1 |gdd| |E| problem. We set J i = {J j a j ∈ A i } for i = 1, 2. Then, we schedule all jobs in J 1 before any job in J 2 with no machine idle times. The processing order within each J i (i = 1, 2) is arbitrary. As J j ∈J i p j = J j ∈A i a j = B, the completion time of the last job in J 1 is exactly at time B. Moreover, the fact that |J 1 | < n, implies that the last job to be scheduled in J 1 is assigned with a due-date of B (see eq. (15)). Therefore, the last scheduled job in J 1 is completed in a JIT mode. Moreover, as we schedule all jobs with no idle times, the last job to be scheduled in J 2 is completed at time 2B, which is also the due-date of the last scheduled job (see eq. (15)). Accordingly, in S we have that |E| = 2, and therefore S provides a YES answer for the constructed instance of our 1 |gdd| |E| problem.
Consider next a solution S that provides a YES answer for the constructed instance of our 1 |gdd| |E| problem. It implies that the last scheduled job is completed exactly at time 2B. Thus, in S, there are no machine idle times. The fact that |E| = 2 in S implies that there is job which completes exactly at time B in schedule S. Let J 1 be the set of jobs that are completed no later than time B in S, and let J 2 be the set of all other jobs. As there are no machine idle time in S, we have that J j ∈J i p j = B for i = 1, 2. Therefore, by setting A i = {a j J j ∈ J i } for i = 1, 2, we have a solution that provides a YES answer for the Partition problem.

A pseudo-polynomial time algorithm for a constant number of different due-dates
Let L be the set of all l = (l 1 , l 2 , . . . , l r ) vectors satisfying that (i) l i ∈ {1, . . . , n}; and (ii) δ l i −1 < δ l i for i = 1, . . . , r with l 0 = 0 by definition (note that r ≤ ν d ). There are O(n ν d ) such vectors, each includes a subset of positions in the job sequence having different due-dates. It implies that any feasible E set includes jobs that are scheduled in the positions of some l ∈ L. Therefore, we solve the 1 |gdd| J j ∈E w j problem, by partitioning it into a set of O(n k ) (where k is the number of due-dates) subproblems each corresponding to a different (l 1 , l 2 , . . . , l r ) ∈ L. Let P(l) be the subproblem corresponding to vector l. Our 1 |gdd| J j ∈E w j problem reduces to finding the vector l ∈ L with the best feasible solution (if such a solution exists) satisfying that the set of JIT jobs are scheduled in positions l 1 , l 2 , . . . , l r . Given a subproblem P(l), corresponding to vector (l 1 , l 2 , . . . , l r ) ∈ L, we let n i = l i −l i−1 for i = 1, . . . , r +1, where l r +1 = n by definition. Let S be a feasible solution for the corresponding subproblem with A i being the set of n i jobs scheduled in positions {l i−1 +1, . . . , l i } for i = 1, . . . , r +1. Note that all jobs in each A i (i = 1, ..., r ) share the same due-date of δ l i . Accordingly, only a single job in each A i (i = 1, ..., r ) can be completed at the common due-date, δ l i . It follows that J j ∈A i p j ≤ δ l i − δ l i −1 for i = 1, . . . , r , as otherwise we cannot complete the last job in A i at time δ l i , given that the last job in A i−1 is completed at time δ l i −1 . The following lemma obviously holds: Lemma 7 Given a feasible solution S for problem P(l) with n i jobs in each set A i and with J j ∈A i p j ≤ δ l i − δ l i −1 for i = 1, . . . , r , it is optimal to schedule all jobs in A i during time interval (δ l i − J j ∈A i p j , δ l i ] with the last job, which is the only one in A i being scheduled in a JIT mode, is the one of maximal weight among all jobs in A i . We solve each subproblem P(l) by using a dynamic programming procedure, which starts by re-indexing the jobs in a non-increasing order of weight, such that w 1 ≥ w 2 ≥ · · · ≥ w n . Now, let F j (x 1 , . . . , x r +1 , q 1 , . . . , q r +1 ) be the maximal gain that can be obtained out of all feasible partial schedule on job set J j = {J 1 , . . . , J j } with q i jobs the assigned to set A i and x i = J j ∈A i p j for i = 1, . . . , r + 1. It follows from the feasibility of the partial schedule that the following conditions holds: Condition 1 x i ≤ δ l i − δ l i −1 for i = 1, . . . , r , as otherwise we cannot complete the last job in A i at time δ l i , given that the last job in A i−1 is completed at time δ l i −1 .
Condition 2 x r +1 = j l=1 p l − r i=1 x i , and q r +1 = j − r i=1 q i as any job has to be assigned to one of the A i sets (i = 1, . . . , r + 1).

Condition 3
For any j = 1, . . . , n and i = 1, . . . , r + 1, q i ≤ n i and q i + (n − j) ≥ n i ; as otherwise we cannot construct a complete solution with n i jobs in A i for i = 1, . . . , r.
Based on Lemma 7 and the fact that the jobs are reindexed such that w 1 ≥ w 2 · · · ≥ w n , we can compute F j (x 1 , . . . , x r +1 , q 1 , . . . , q r +1 ) for j = 1, . . . , n and for any set of x i and q i values satisfying the conditions in (1)-( 3) by using the following recursion: with the initial condition that At the end of the computing process, the optimal solution for P(l) is given by To conclude, we can use the following algorithm to solve our 1 |gdd| J j ∈E w j problem: Algorithm 2 An optimization algorithm for solving the 1 |gdd| J j ∈E w j problem. Initialization Set F * = 0.
Step 2 For any l ∈ L do: Calculate n i = l i − l i−1 for i = 1, ..., r + 1, with l 0 = 0 and l r +1 = n. For j = 1 up to j = n do For any set of non-negative integers (x 1 , ..., x i , and that q i ≤ n i and q i + (n − j + 1) ≥ n i for i = 1, ..., r do: (16), with the initial condition in (17). End For End For Calculate F * (l) by (18). If F * (l) > F * , then update F * = F * (l).
Step 3 Determine the optimal assignment of jobs to sets A i for i = 1, ..., r + 1 by tracking the decisions that lead to the optimal solution value, F * . Output The optimal solution value is F * . For i = 1, .., r schedule the jobs in each A i during time interval (δ l i − J j ∈A i p j , δ l i ] where the last schedule job in each interval (δ l i − J j ∈A i p j , δ l i ] is the job of maximal weight (smallest index) among all jobs in A i . Schedule the jobs in A r +1 during time interval (δ l r , δ l r + J j ∈A i p j ]. Theorem 6 Algorithm 2 solves the 1 |gdd| J j ∈E w j problem in O(ν d n 2ν d +1 ν d i=1 δ l i ). Proof The fact that Algorithm 2 provides the optimal solution follows from the discussion in this section.
Step 1 requires O(n ν d ) time as the number of possible l vectors. In Step 2, for any l ∈ L, we compute F j (x 1 , . . . , x r +1 , q 1 , . . . , q r +1 ) by (16). The fact that x 1 , x 2 , . . . , x r +1 , q 1 , q 2 , . . . , q r +1 ) in total. As the computation of each F j (x 1 , . . . , x r +1 , q 1 , . . . , q r +1 ) by (16) requires O(ν d ) time, the time required in Step 2 to compute all F j (x 1 , . . . , x r +1 , q 1 , . . . , q r +1 ) values for a given Step 2 for a given l vector requires The fact that we repeat Step 2, for any l ∈ L, and that |L| = O(n ν d ), when the value of ν d is upper bounded by a constant. The theorem now follows from the fact that tracking the decisions that lead to the optimal solution value in Step 3 require only linear time.

An FPT algorithm for the 1 gdd |E| problem wrt. the combined parameter ( d , p )
In this section, we prove that the following result holds: Theorem 7 The 1 |gdd| |E| problem is FPT wrt. the combined parameter (ν d , ν p ).
The proof of Theorem 7 is based on breaking down the 1 |gdd| |E| problem into a set of O(2 ν d ) subproblems and providing a MILP formulation with O(ν d ν p ) integer variables for each of the subproblems. Then the fact that Theorem 7 holds follows directly from the result by Lenstra (1983) that shows that the problem of solving an MILP is FPT wrt. the number of integer variables.
For ease of presentation, we represent the vector of n due-dates in a modified manner by two vectors of size ν d : (δ 1 , δ 2 , .., δ ν d ) and (m 1 , m 2 , .., m ν d ). The first includes the ν d distinct due-dates in the instance. In the second, m i represents the number of positions in the sequence having a due-date not greater than δ i . We order the due-dates in the first vector according to the EDD rule, such that δ 1 < δ 2 < · · · < δ ν d . By definition, we also have that m 1 < m 2 < · · · < m ν d with m ν d = n. We also represent the vector of n processing times in a modified manner by two vectors of size ν p : ( p 1 , p 2 , .., p ν p ) and (n 1 , n 2 , .., n ν p ), where the first includes the ν p distinct processing times in the instance, and n i is the number of jobs having processing time of p i for i = 1, . . . , ν p . Given a feasible schedule, we say that due-date δ i is active if there exists a job completed exactly at time δ i . Now, let be a set that includes all subsets of set (δ 1 , δ 2 , .., δ ν d ). Note that | | = O(2 ν d ). We partition our 1 |gdd| |E| problem into a set of O(2 ν d ) subproblems, each corresponding to a specific set of distinct due-dates δ ∈ . In each such subproblem, we aim to find if there exists a feasible solution with all due-dates in δ being active. Let P(δ) be the subproblem that corresponds to vector δ. Our 1 |gdd| |E| problem reduces to finding the set δ ∈ of maximal cardinality for which there is a feasible solution for P(δ).
Given δ ∈ , we next show that each P(δ) problem can be represented as an MILP with only O(ν d ν p ) integer variables. Let δ = (δ [1] , δ [2] , . . . , δ [k] ) (note that k ≤ ν d ). We define x i as a positive integer variable that represents the position in the sequence of the job completed at δ [i] for i = 1, .., k. As there are exactly m i positions with due-date not larger than δ i , we include the following set of constraints for i = 1, . . . , k: We also define y i j as a nonnegative integer variable which represents the number of jobs having processing time of p j that are assigned to positions x i−1 +1, . . . , x i in the sequence. Accordingly, for each i = 1, . . . , k we include the constraint that ν p j=1 y i j = x i − x i−1 , with x i = 0 by definition. To make sure that δ [i] is indeed an active due-date, we also include the following set of constraints for i = 1, . . . , k: Finally, to ensure that we do not assign more than n j jobs with processing time p j , up to position k, we include the following set of constraints for j = 1, . . . , ν p : k i=1 y i j ≤ n j .

Summary and future research
Many scheduling problems with due-date related objective function are N P-hard when the number of different duedates in the instance, ν d , is arbitrary. However, in many reallife problems the number of due-dates is a bounded parameter due to many reasons, such as high shipment costs, and work agreements. Therefore, there is great interest in studying the complexity of such N P-hard problems with respect to the number of due-dates in the instance. We consider two such single-machine scheduling problems with generalized due-dates. The first, denoted by 1 |gdd| max{ L j }, focuses on minimizing the maximal absolute lateness, and the second, denoted by 1 |gdd| J j ∈E w j , consists of maximizing the weighted number of jobs completed in a JIT mode (i.e., exactly at their due-date). Both problems are known to be strongly N P-hard for arbitrary values of ν d . We show that both problems are solvable in polynomial time when ν d = 1. Moreover, we show that problems 1 |gdd| max{ L j } and 1 |gdd| |E| are N P-hard when ν d = 2. We compliment these two results by showing that problems 1 |gdd| max{ L j } and 1 |gdd| J j ∈E w j are solvable in pseudo-polynomial time when the value of ν d is bounded by a constant.
The fact that problems 1 |gdd| max{ L j } and 1 |gdd| |E| are N P-hard even if ν d = 2 rules out the possibility of constructing an FPT algorithm for neither problem wrt. ν d , unless P = N P. We show, however, that both problems are FPT wrt. the combined parameter (ν d , ν p ) where ν p is the number of different processing times in the instance. We leave open the question whether the 1 |gdd| J j ∈E w j problem is FPT when we combine parameters ν d and ν p .
In future research, we aim to study the complexity status of other N P-hard scheduling problems with due-date related objective function wrt. to ν d , hoping to provide efficient algorithms to solve practical instances with limited ν d values.