List Scheduling with Precedence Constraints #
This module models non-preemptive scheduling of a finite set J of jobs with integer processing
times p : J → ℕ and a precedence relation prec on m identical machines
(P | prec | C_max) in discrete time. A schedule is given by start times s : J → ℕ. Job j
occupies the unit time slots s j, …, s j + p j - 1. IsFeasible m prec p s requires each job to
start after its predecessors finish and at most m jobs to run in each slot. IsGreedy adds
Graham's list-scheduling condition: a machine idles in a slot only if every job not yet started
has an unfinished predecessor ([Gra66], §I.1).
Main definitions #
Cslib.Algorithms.Lean.Scheduling.Precedence.running: the jobs occupying a time slot.IsFeasible,IsGreedy: feasible and greedy (list) schedules.makespan: the latest completion time (le_makespan,makespan_le_iff).
Main results #
IsGreedy.exists_chain: Graham's critical chain. For well-founded precedences there is a precedence chaincwithm · C ≤ ∑ p + (m - 1) · ∑_{j ∈ c} p j([Gra66], §II, proofs of the Proposition (p. 1567) and the Theorem (p. 1570)).IsFeasible.sum_le_mul_makespan,IsFeasible.sum_chain_le_makespan: the work and chain lower bounds for every feasible schedule.IsGreedy.mul_makespan_le: a greedy schedule is within2 - 1/mof every feasible schedule,m · C_greedy ≤ (2m - 1) · C.IsGreedy.mul_makespan_le_of_le: Graham's anomaly bound ([Gra66], §II, Theorem (p. 1570)). Relaxing the precedences, shortening jobs and changing the number of machines frommtom'changes the makespan by at most the factor1 + (m - 1)/m'.exists_isGreedy: greedy schedules exist for well-founded precedences and positive processing times, built slot by slot.
Implementation notes #
Time is discrete (ℕ), so processing times are natural numbers. Graham's bounds are
scale-invariant, so this covers rational processing times after clearing denominators. Real-valued
processing times are not modelled.
IsFeasible bounds the number of jobs running in each slot instead of assigning jobs to machines.
For non-preemptive schedules the two are equivalent: the jobs are intervals, interval graphs are
perfect, so if at most m intervals overlap at every point they can be coloured with m machines.
Graham's model fixes a priority list. IsGreedy keeps only the consequence used by the bounds,
that no machine idles while a job is ready, so the theorems apply to every list schedule and to
every other greedy rule.
References #
A non-preemptive schedule on m identical machines in integer time: job j runs without
interruption in the slots s j, …, s j + p j - 1, after all its predecessors have finished, and
at most m jobs run in any slot.
A greedy (list) schedule: a machine is left idle only when no job is ready. If fewer than m
jobs run in slot t, every job not yet started has a predecessor that is unfinished at t.
Summing the number of running jobs over the slots before the makespan counts each job's processing time once.
Graham's critical-chain bound ([Gra66], §II, proofs of the Proposition and Theorem;
[CLRS09], Theorem 27.1): for a greedy schedule on m machines with well-founded precedences
there is a precedence chain c (each job preceding the next) with
m · C ≤ ∑ p + (m - 1) · ∑_{j ∈ c} p j.
Span bound: in a feasible schedule, the jobs of a precedence chain run one after another, so their total processing time is at most the makespan.
Graham's bound with precedence constraints ([Gra66], §II, Theorem (p. 1570) with
n = n'; restated in §III, p. 1581): a greedy schedule is within 2 - 1/m of every feasible
schedule, m · C_greedy ≤ (2m - 1) · C.
Graham's anomaly bound ([Gra66], §II, Theorem (p. 1570)): let s be a greedy
schedule on m' machines for well-founded precedences prec' and processing times p', and s'
any feasible schedule on m machines for stronger precedences prec ⊇ prec' and longer processing
times p ≥ p'. Then m' · C ≤ (m + m' - 1) · C', i.e. C / C' ≤ 1 + (m - 1)/m'.
Greedy schedules exist (list scheduling, [Gra66], §I.1): for well-founded precedences
and positive processing times, a greedy schedule exists on any m ≥ 1 machines.