arXiv:2610.41821cs.DSOct 2026

Manuscript Offprint

arXiv:2610.41821

Compressing the Lawler-Moore Dynamic Program for Weighted Tardy Jobs

Klaus Jansen, Björn Schumacher, Corinna Wambsganz

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The classic scheduling problem of minimizing the total weight of tardy jobs (Pm∣∣∑jwjUjP_m || \sum_j w_j U_j) asks for a schedule of jobs each with a processing time, weight, and due date on a constant number of parallel identical machines. A job is late in a schedule if it completes after its due date, and an optimal schedule is one where the total weight of all late jobs is minimized. The classic dynamic programming algorithm of Lawler and Moore [Manag. Sci., 1969] solves this problem in O(ndmax⁡m)O(nd_{\max}^m) where nn is the number of jobs, dmax⁡d_{\max} is the maximum due date of any job, and mm is the number of identical machines. We show that it is sufficient to only compute part of the dynamic program and obtain the running time O~(n+dmax⁡m+1)\tilde{O}(n + d_{\max}^{m+1}) where O~\tilde{O} suppresses polylogarithmic factors. This affirmatively answers the open question posed by Hermelin, Molter, and Shabtay [INFORMS J. Comput., 2024], whether a running time of O~(n+dmax⁡2)\tilde{O}(n + d_{\max}^2) is possible on a single machine.

Keywords. Scheduling, Dynamic Programming

*Kiel University, kj@informatik.uni-kiel.de, https://orcid.org/0000-0001-8358-6796. This author was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project Number 453769249. †Kiel University, bsch@informatik.uni-kiel.de, https://orcid.org/0009-0002-2448-4794. This author was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project Number 528381760. ‡Kiel University, cwa@informatik.uni-kiel.de, https://orcid.org/0009-0002-4820-9017. This author was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project Number 453769249.

1 Introduction

Minimizing the total weight of tardy jobs is a classic scheduling problem. We are given nn jobs with processing times pj∈Z≥1p_j \in \mathbb{Z}_{\geq 1}, weights wj∈Z≥1w_j \in \mathbb{Z}_{\geq 1}, and due dates dj∈Z≥1d_j \in \mathbb{Z}_{\geq 1} such that pj≤djp_j \leq d_j as well as mm parallel identical machines. A schedule τ\tau for this problem is an assignment of jobs to machines together with an order of execution on every machine. Let Cj(τ)C_j(\tau) be the completion time of job jj in schedule τ\tau. A job jj is on time in τ\tau if Cj(τ)≤djC_j(\tau) \leq d_j and late otherwise. We set Uj(τ)=0U_j(\tau) = 0 if jj is on time and Uj(τ)=1U_j(\tau) = 1 if it is late. The goal is to find a schedule τ\tau that minimizes the total weight of late jobs

∑j=1nwjUj(τ).\sum_{j=1}^{n} w_j U_j(\tau).

On a single machine the problem is denoted by 1∣∣∑jwjUj1||\sum_j w_j U_j and on m∈O(1)m \in O(1) identical parallel machines by Pm∣∣∑jwjUjP_m||\sum_j w_j U_j using the three-field notation by Graham, Lawler, Lenstra, and Rinnooy Kan [GLLR79].

Even on a single machine the problem is NP-hard as it is one of the original 21 problems shown to be NP-hard by Karp [Kar72]. For an exact solution it is equivalent to maximize the weight of the on-time jobs instead. Thus, 1∣∣∑jwjUj1||\sum_j w_j U_j is closely related to the knapsack problem as the problems are the same in the case where all jobs share the same due date.

The classic algorithm for this problem on a single machine is the dynamic programming algorithm due to Lawler and Moore [LM69] with running time O(n⋅dmax⁡)O(n \cdot d_{\max}) where dmax⁡d_{\max} is the maximum due date of any job. It is similar to the algorithm by Bellman [Bel57] for knapsack that has a running time of O(n⋅t)O(n \cdot t) where tt is the capacity of the knapsack. Both algorithms follow the same principle: For a job index j∈[n]j \in [n] and a point in time t∈[dmax⁡]t \in [d_{\max}] the dynamic program stores the largest possible weight of on-time jobs with total processing time tt while only using jobs from the set {1,…,j}\{1, \ldots, j\}. In contrast to Bellman's algorithm, the algorithm still needs to handle the different due dates. To cope with these, the jobs are ordered non-decreasingly by due dates before filling the dynamic program table. This is sufficient since there is always an optimal solution where the on-time jobs are ordered non-decreasingly according to their due dates, also known as the earliest-due-date (EDD) order. The algorithm is depicted in Algorithm 1. It generalizes to Pm∣∣∑jwjUjP_m||\sum_j w_j U_j with running time Om(n⋅dmax⁡m)O_m(n \cdot d_{\max}^m) where OmO_m suppresses multiplicative factors depending only on mm.

We modify the algorithm by Lawler and Moore by restricting the range of values tt may take in line 3 of Algorithm 1 and updating the same row in every iteration. To justify this we give all jobs a priority based on their weight and their index. We show that there is always a canonical optimal schedule that uses high-priority jobs. Combining this with the insight that a schedule may contain at most ⌊dmax⁡p⌋\lfloor \frac{d_{\max}}{p} \rfloor on-time jobs with processing time pp, we can restrict the necessary updates. Generalizing this to multiple machines yields the following result.

Theorem 1.1. Given an instance of Pm∣∣∑jwjUjP_m||\sum_j w_j U_j, the optimal value can be calculated in O~m(n+dmax⁡m+1)\tilde{O}_m(n + d_{\max}^{m+1}) time and Om(n+dmax⁡m)O_m(n + d_{\max}^m) space. Using additional O~m(dmax⁡m+1)\tilde{O}_m(d_{\max}^{m+1}) space, we can construct an optimal schedule in the same time.

This presents an improvement over the Lawler-Moore algorithm when nn is larger than dmax⁡d_{\max} up to logarithmic factors. Together, we obtain a running time of O~m(n+dmax⁡mmin⁡{dmax⁡,n})\tilde{O}_m(n + d_{\max}^m \min\{d_{\max}, n\}). We also positively answer the open question posed by Hermelin, Molter, and Shabtay [HMS24], whether there exists an algorithm for 1∣∣∑jwjUj1||\sum_j w_j U_j with running time O~(n+dmax⁡2)\tilde{O}(n + d_{\max}^2). Moreover, this result is an extension of the folklore reduction for knapsack to reduce the number of items to O~(t)\tilde{O}(t) mentioned in Remark 1.5 of [PRW21], which also yields an O~(n+t2)\tilde{O}(n + t^2) algorithm for knapsack. The extension is not straightforward since jobs may have distinct due dates, which complicates a simple exchange argument. We cope with this difficulty by introducing a priority order on the jobs and considering the highest-priority jobs that may be on time for every point in time.

Algorithm 1 Algorithm by Lawler and Moore for 1∣∣∑jwjUj1||\sum_j w_j U_j

Require: nn jobs each with (pj,dj,wj)(p_j, d_j, w_j)

Ensure: Maximum total weight of on-time jobs

1: Initialize fj[t]←−∞f_j[t] \leftarrow -\infty for every j∈{0,…,n}j \in \{0, \ldots, n\} and t∈{0,…,dmax⁡}t \in \{0, \ldots, d_{\max}\} and f0[0]←0f_0[0] \leftarrow 0

2: for j=1,…,nj = 1, \ldots, n in non-decreasing order by due dates do

3: for t=0,1,…,dmax⁡t = 0, 1, \ldots, d_{\max} do

4: if pj≤t≤djp_j \leq t \leq d_j then

5: fj[t]←max⁡{fj−1[t],fj−1[t−pj]+wj}f_j[t] \leftarrow \max\{f_{j-1}[t], f_{j-1}[t - p_j] + w_j\}

6: else

7: fj[t]←fj−1[t]f_j[t] \leftarrow f_{j-1}[t]

8: return max⁡t∈{0,…,dmax⁡}fn[t]\max_{t \in \{0, \ldots, d_{\max}\}} f_n[t]