Scheduling Algorithms V: Preemptive Scheduling on Uniform MachinesTextbook
Motivation
When several processors share a workload, the first question is how long the workload takes if it is spread out as well as possible. If a job may be interrupted and resumed later, possibly on another processor — preemption, the setting of operating systems, of communication links and of any resource that can be time-shared — the answer is a closed formula, and it is one of the oldest results in scheduling: McNaughton's wrap-around rule of 1959 (Scheduling with deadlines and loss functions, Management Science 6, doi:10.1287/mnsc.6.1.1) shows that on identical machines the optimal makespan is the larger of the longest job and the average load. Horvath, Lam and Sethi (A level algorithm for preemptive scheduling, Journal of the ACM 24, 1977, doi:10.1145/321992.321995) extended this to machines of different speeds, and Gonzalez and Sahni (Preemptive scheduling of uniform processor systems, Journal of the ACM 25, 1978, doi:10.1145/322047.322055) gave the fast algorithm with few preemptions. Brucker's Chapter 5 (doi:10.1007/978-3-540-69516-5) presents the level-algorithm version, and this mission formalizes the statements it proves about schedules.
Setting
There are jobs with processing requirements and uniform machines with speeds : running job on machine for a period of length performs units of its requirement, so the whole job would take time units there. Identical machines are the case .
A preemptive schedule is a finite list of pieces, each a job, a machine, a start time and a stop time. It is feasible for the data when every piece lies in , no two pieces on the same machine overlap, no two pieces of the same job overlap (a job is on at most one machine at any instant), and every job receives total work exactly over its pieces. Its makespan is the largest stop time; the completion time of job is the largest stop time of one of its pieces. A schedule is nonpreemptive when every job consists of a single piece.
Following Section 5.1.2 the data are sorted, and , with , and one writes , . For a set of jobs, if and otherwise: the largest combined speed that jobs can use at one instant.
Formalization targets
Goal — Theorem 5.8 (printed p. 127)
The optimal makespan of is the bound (5.5):
in the sense that some feasible preemptive schedule has makespan exactly and no feasible preemptive schedule has a smaller makespan.
The lower bound (5.5) (printed p. 125)
Every feasible preemptive schedule has makespan at least .
(printed p. 108)
On identical machines, is a lower bound on the makespan and is attained by some feasible preemptive schedule.
Condition (5.8) (printed p. 129)
The jobs can be scheduled preemptively within if and only if for every set of jobs.
Theorem 5.7 (printed p. 121)
For with nonnegative weights there is an optimal schedule without preemption.
Significance
Theorem 5.8 turns an optimization over an infinite family of schedules into a formula in the data, and the formula is tight in both directions: each of its terms is a resource bound that some schedule meets exactly. That is what makes preemptive makespan minimization one of the few parallel-machine problems that is solvable at all — its nonpreemptive counterpart is NP-hard (p. 124) — and it is why the preemptive relaxation appears as a bound inside branch-and-bound methods for the nonpreemptive problems.
Condition (5.8) is the form in which the result is reused. It is a Hall-type condition, one inequality per set of jobs, and it is exactly what Section 5.1.2 needs to prove Theorem 5.9, which decides by a maximum flow in an expanded network. Theorem 5.7 is the complementary statement for the other classical objective: for total weighted completion time preemption buys nothing, so the nonpreemptive solutions of Section 5.1.1 are optimal in the larger class too.
On status: every statement here is classical and proved, and the formalization adds a checked
model of preemptive schedules. Mathlib has no scheduling material, and the platform's
SchedulingAlgorithms series so far models only single-machine sequences (missions I, II, IV)
and two-machine permutation flow shops (mission III), none of which allow a job to be split. The
piece-list model of this mission is the first reusable object for preemptive and parallel-machine
problems, and the later sections of Chapter 5 — , — are stated in it.
Difficulty
The obvious first idea for the goal is to run McNaughton's rule with the speeds ignored. It fails on uniform machines: filling machines one after another does not respect the constraint that a long job on a slow machine is not done when a short job on a fast one is. The correct idea is the level algorithm — always process the jobs of highest remaining requirement on the fastest free machines, sharing machines among tied jobs — and the difficulty is in the analysis rather than the idea. The proof of Theorem 5.8 has to show that the schedule it produces ends exactly at one of the terms of : either no machine idles before the end, giving , or the machines finish in speed order with the first jobs busy from time , giving . Making that case analysis rigorous requires tracking that the order of remaining requirements is preserved over time (the invariant (5.6)) and that ties are broken consistently.
A second, formal difficulty is that the level algorithm's output is defined by continuous-time events (the next completion, the next time two levels coincide), so producing an explicit finite list of pieces with the required properties is itself a construction. Any proof must build a concrete schedule; "the infimum of makespans equals " is not the goal.
For the lower bound the trap is the opposite: it is tempting to argue only with total capacity , which gives but not . The latter needs the rule that a job is on at most one machine at a time, so that jobs run at combined speed at most ; a model that let a job be split across machines simultaneously would make the theorem false, and the definition of feasibility rules it out explicitly.
Formalization scope
A schedule is a List of Pieces over jobs Fin n and machines Fin m, with real start and
stop times. Feasibility is the three-part condition of the Setting, disjointness of two pieces
meaning one stops no later than the other starts. Work is measured with the machine's speed, so
the same definitions cover identical machines as the constant speed . Pieces of length zero
and unsorted lists are allowed; both are harmless.
The sorted orders are hypotheses Antitone p and Antitone s, the speeds and requirements are
positive, and, where the book assumes it, . The book's normalization is
not assumed: every statement here is invariant under scaling all speeds, and the book uses the
normalization only for a running-time estimate. The bound is defined as the maximum of an
explicit nonempty finite set, so no supremum of an empty or unbounded set occurs; takes a
proof that so that is meaningful.
Two things are deliberately not stated. The level algorithm itself is not transcribed: Theorem 5.8 is stated as the existence of an optimal schedule of makespan , which is what its proof establishes. And Theorem 5.9, the flow characterization for , is left for a later mission, since it needs release times and the expanded network on top of this model.
A trivializing reading is excluded by the existential form of the goal and of Theorem 5.7: each asserts that an optimal schedule exists, not merely that any optimal schedule has a property. A proof of the goal has to construct a schedule; a proof of Theorem 5.7 has to construct a nonpreemptive one that beats every preemptive competitor. Contributions welcome beyond the milestones: a general lemma that a feasible schedule can be normalized to sorted, positive-length pieces, and a proof that (5.8) for the sets is equivalent to .
Selected references
- Peter Brucker, Scheduling Algorithms, 5th ed., Springer, 2007, Chapter 5. doi:10.1007/978-3-540-69516-5
- Robert McNaughton, Scheduling with deadlines and loss functions, Management Science 6 (1959). doi:10.1287/mnsc.6.1.1
- E. C. Horvath, S. Lam and R. Sethi, A level algorithm for preemptive scheduling, Journal of the ACM 24 (1977). doi:10.1145/321992.321995
- Teofilo Gonzalez and Sartaj Sahni, Preemptive scheduling of uniform processor systems, Journal of the ACM 25 (1978). doi:10.1145/322047.322055