Work, Span and Brent's Theorem #
The span span prec p of a job system is the largest total processing time of a precedence chain
(the critical-path length). For unit processing times, Fintype.card J is the work W (the
number of nodes of the computation DAG) and span prec (fun _ => 1) is its depth D. This module
proves the work and span laws, the greedy-scheduler bound and Brent's scheduling lemma.
Main definitions #
Cslib.Algorithms.Lean.Scheduling.Precedence.span: the critical-path length.
Main results #
exists_chain_sum_eq_span,sum_chain_le_span: the span is attained by a chain and bounds all chains.IsFeasible.span_le_makespan, together withIsFeasible.sum_le_mul_makespan: the span lawD ≤ Tand the work lawW ≤ m · T, so every schedule satisfiesT ≥ max(W/m, D).IsGreedy.mul_makespan_le_sum_add_span: the greedy-scheduler boundm · T ≤ ∑ p + (m - 1) · span([CLRS09], Theorem 27.1, in Graham's sharper form).IsGreedy.mul_makespan_le_card_add_span,IsGreedy.makespan_le_card_div_add_span: Brent's bound for unit-time DAGs,m · T ≤ W + (m - 1) · D, soT ≤ (W - D)/m + DandT ≤ ⌊W/m⌋ + D([Bre74], Lemma 2).exists_isFeasible_mul_makespan_le: Brent's scheduling lemma as an existence statement: every unit-time DAG has anm-processor schedule withm · T ≤ W + (m - 1) · D.
References #
A precedence chain of a well-founded relation has no repeated job.
The weighted length of every chain is at most the total processing time.
The span (critical-path length) of a job system: the largest total processing time of a precedence chain. For unit processing times this is the number of jobs on a longest chain.
Every precedence chain has weighted length at most the span.
The span is attained by a precedence chain (a critical path).
Greedy-scheduler bound ([CLRS09], Theorem 27.1, with Graham's refinement):
m · C ≤ ∑ p + (m - 1) · span.
Brent's bound for a greedy schedule of a unit-time DAG with W = |J| nodes and span D
(the number of nodes on a longest chain): m · T ≤ W + (m - 1) · D, i.e.
T ≤ (W - D)/m + D ([Bre74], Lemma 2; [CLRS09], Theorem 27.1).
Brent's bound in the form T ≤ ⌊W/m⌋ + D.
A feasible schedule with positive processing times forces the precedences to be well-founded.
Brent's scheduling lemma ([Bre74], Lemma 2), in the unit-time DAG form: every finite
DAG of W = |J| unit jobs with span D = span prec (fun _ => 1) (the number of jobs on a longest
chain, i.e. the time needed with unboundedly many processors) has a feasible schedule on m ≥ 1
processors with m · T ≤ W + (m - 1) · D.