Scheduling Subject to Resource Constraints: Classification and Complexity III: The Two-Machine Algorithm for Q2 with One Resource and Unit-Time Jobs Is OptimalResearch Paper
Motivation
Many production and computing systems run jobs on parallel machines that also draw on a shared, limited resource: tools, workers, memory, power. Adding such a resource to a scheduling problem can change its complexity entirely. Błażewicz, Lenstra and Rinnooy Kan (DAM 1983) extended the three-field classification of Graham, Lawler, Lenstra and Rinnooy Kan by a resource field , and determined the complexity of every problem with unit-time jobs on identical or uniform machines under the makespan criterion. Their Fig. 2 separates the maximal polynomially solvable cases from the minimal NP-hard ones.
This mission formalizes the polynomial side. Two identical machines are easy under arbitrary resources (Theorem 1, due to Garey and Johnson, via maximum matching). Three identical machines with one resource are NP-hard in the strong sense (Theorem 4), and so are two uniform machines with unit resources (Theorem 3). What remains for uniform machines is settled by two algorithms: a sorting-and-shifting procedure for two uniform machines with one resource of arbitrary size (Theorem 5), and a bottleneck transportation problem for any number of uniform machines with one resource and 0–1 requirements (Theorem 6). The hardness results are the subject of the companion missions I and II.
Setting
There are jobs and machines . Machine has speed ; every job has unit execution requirement, so it takes time on . Identical machines () have ; uniform machines () have arbitrary speeds. There are resources with positive integer sizes , and job needs a nonnegative integer amount of throughout its execution. The field records restrictions: bounds the number of resources, their sizes, the requirements, a dot meaning "part of the input". So is one resource with arbitrary size and requirements, and is one resource with requirements in .
A schedule gives every job a machine and a start time ; the job is executed during with . It is feasible if jobs on the same machine do not overlap and, at every time , the jobs executed at use at most of each resource . The makespan is . No precedence constraints occur in this mission.
Formalization targets
Goal: Theorem 5, correctness of the algorithm
For with : put all jobs on in order of nonincreasing , then repeatedly move the last job of to the earliest feasible time on after the jobs already there, as long as this strictly reduces . For every order with nonincreasing requirements, the resulting schedule is feasible and
Milestones for the goal
The paper's proof has two steps, both milestones. Call a schedule an (a)–(c) schedule when (a) runs its jobs back to back from time in nonincreasing , (b) runs its jobs in nondecreasing , and (c) every requirement on is at least every requirement on .
- The algorithm's schedule is feasible, is an (a)–(c) schedule, and is best among feasible (a)–(c) schedules.
- Every feasible schedule can be transformed into a feasible (a)–(c) schedule with no larger .
Further results
- Theorem 1. For , with the graph joining two jobs when they can run together and a maximum matching of , the optimal makespan is .
- Theorem 6. For with the fastest machines listed first, the optimal makespan equals the optimal value of a bottleneck transportation problem that assigns jobs to slots (machine, position) with cost , resource jobs only to the fastest machines.
Significance
Theorems 5 and 6 complete the classification of Fig. 2 for uniform machines: every special case of not covered by the hardness theorems has a polynomial algorithm. Theorem 1 is the classical reduction of two-machine resource scheduling to maximum matching, the model case for later work on scheduling with conflict graphs.
The paper proves these results briefly: "clearly" for the first half of Theorem 5, "obviously" for Theorem 1, and a one-paragraph model for Theorem 6. The exchange argument of Theorem 5 is presented "in an informal way" through five steps that pass through fractional, preempted jobs. A machine-checked proof makes these arguments exact on a model with real start times. No formalization of these results is known, and the platform had no statement about resource-constrained scheduling on uniform machines before this mission.
Difficulty
With the job boundaries on the two machines are misaligned: a job on overlaps parts of several jobs on , so the resource check cannot be done slot by slot, and discrete reasoning on integer time grids does not apply. The exchange argument of Theorem 5 must control the resource usage at every real time while jobs are moved between machines and reordered, and it has to end with a nonpreemptive schedule even though the paper's intermediate steps split jobs. For Theorem 1, the hard direction is the lower bound: a feasible schedule with arbitrary real start times must be converted into a matching, which is a statement about how unit jobs on two machines can overlap. For Theorem 6, one must show that restricting resource jobs to the fastest machines and to back-to-back positions loses nothing.
Formalization scope
- Model. Jobs, machines and resources are
Fin n,Fin m,Fin l(0-based). Speeds are positive reals, sizes positive naturals, requirements naturals. Start times are nonnegative reals, execution intervals are half-open, and the resource constraint is checked at every real time. for . The model carries a precedence digraph for consistency with the companion missions; every statement here assumes it has no arcs. - Implicit hypothesis. Theorems 1 and 5 assume every job fits alone (), which the paper leaves unstated; without it no feasible schedule exists.
- The algorithm is a Lean definition following the page: the order is an argument (any nonincreasing order), "as early as possible" is the earliest start after 's last job at which the resource constraint holds throughout, and the loop stops at the first move that does not strictly reduce .
- Optimality is always stated in full: feasibility plus a lower bound against every feasible schedule. No minimum is written as an infimum of a possibly empty set.
- Theorem 6 is stated with 0–1 slot assignments, the interpretation the paper gives to ; the page's constraint is read as .
- Not formalized: the running times (Theorem 1), (Theorem 5, including the phrase "This O(n log n) algorithm") and (Theorem 6), which depend on a machine model the paper does not fix and, for Theorems 1 and 6, on cited matching and transportation algorithms.
- Ruled out: a formalization of the goal that proves optimality only against (a)–(c) schedules, against schedules with integer start times, or for one fixed tie-breaking order proves less than Theorem 5.
Contributions welcome: lemmas about step functions of resource usage on half-open intervals, a left-shifting lemma for unit-time schedules on two machines, and the exchange steps of Theorem 5 as separate lemmas.
Selected references
- J. Błażewicz, J.K. Lenstra, A.H.G. Rinnooy Kan, Scheduling subject to resource constraints: classification and complexity, Discrete Applied Mathematics 5 (1983) 11–24. https://doi.org/10.1016/0166-218X(83)90012-4
- M.R. Garey, D.S. Johnson, Complexity results for multiprocessor scheduling under resource constraints, SIAM Journal on Computing 4 (1975) 397–411. https://doi.org/10.1137/0204035
- R.L. Graham, E.L. Lawler, J.K. Lenstra, A.H.G. Rinnooy Kan, Optimization and approximation in deterministic sequencing and scheduling: a survey, Annals of Discrete Mathematics 5 (1979) 287–326. https://doi.org/10.1016/S0167-5060(08)70356-X
- S. Even, O. Kariv, An O(n^{2.5}) algorithm for maximum matching in general graphs, Proc. 16th IEEE FOCS (1975) 100–112. https://doi.org/10.1109/SFCS.1975.23