Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§5, pp. 9–12 — composite jobs of a run of the series parallel algorithm, in nonincreasing ratio order, form an optimal sequence

Proved
LawlerWCT.SeriesPar.series_parallel_algorithm_optimal

by mikedeng1 · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithm-correctnessp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1schedulingseries-parallel

Throughout, NNN is a finite set of jobs to be sequenced on a single machine, G=(N,A)G=(N,A)G=(N,A) is an acyclic digraph on NNN (job iii must precede job jjj when there is a directed path from iii to jjj), job jjj has a processing time pj>0p_j>0pj​>0 and a real weight wjw_jwj​, and the cost of a feasible sequence is ∑jwjCj\sum_{j} w_j C_j∑j​wj​Cj​, where CjC_jCj​ is the completion time of jjj when the machine starts at time 000 and never idles.

Let TTT be a decomposition tree of GGG: its leaves are exactly the jobs of NNN, each occurring once, and for all i,j∈Ni,j\in Ni,j∈N, job iii must precede job jjj in GGG if and only if (i,j)(i,j)(i,j) is an arc of the transitive series parallel digraph built by TTT (that is, the transitive closure of GGG is the digraph TTT builds; GGG is series parallel).

Run the series parallel algorithm bottom-up on TTT (a leaf yields its job, a PPP-node the union of its sons' sets, an SSS-node the result of the series procedure, Steps 1–3 of p. 11, on its sons' sets), with any tie-breaking, and let FFF be the set of composite jobs it produces for the root. List the composite jobs of FFF in nonincreasing order of their ratios

ρ(c)=∑j∈cwj∑j∈cpj,\rho(c)=\frac{\sum_{j\in c}w_j}{\sum_{j\in c}p_j},ρ(c)=∑j∈c​pj​∑j∈c​wj​​,

breaking ties arbitrarily, and replace each composite job by the sequence of jobs built up for it. The resulting sequence is an optimal sequence for NNN: it respects every precedence constraint and minimizes ∑j∈NwjCj\sum_{j\in N}w_jC_j∑j∈N​wj​Cj​ among all feasible sequences.

This is the correctness of Lawler's algorithm, which solves the problem for series parallel precedence constraints in O(nlog⁡n)O(n\log n)O(nlogn) time once a decomposition tree is known.

Formalization Note The decomposition tree is tied to GGG by three hypotheses: its leaves are distinct, they are exactly NNN, and the transitive closure of GGG on NNN coincides with the arc relation of the transitive series parallel digraph built by the tree. Feasibility and the objective are those of GGG itself, not of the tree. The weights are arbitrary reals and the processing times positive; ρ(∅)\rho(\emptyset)ρ(∅) never occurs, since composite jobs are nonempty.

Preamble
import Mathlib
import Definitions.Def_LawlerWCT_SeriesPar_Model
Formal statement
namespace LawlerWCT.SeriesPar

theorem series_parallel_algorithm_optimal {ι : Type*} [DecidableEq ι] (N : Finset ι) (G : ι → ι → Prop)
    (hGN : ∀ i j, G i j → i ∈ N ∧ j ∈ N) (hacyc : ∀ j, ¬ Relation.TransGen G j j)
    (p w : ι → ℝ) (hp : ∀ j ∈ N, 0 < p j)
    (T : SPTree ι) (hT : T.leaves.Nodup) (hTN : ∀ j, j ∈ T.leaves ↔ j ∈ N)
    (hTG : ∀ i ∈ N, ∀ j ∈ N, Relation.TransGen G i j ↔ T.prec i j)
    (F : List (List ι)) (hrun : Run p w T F)
    (L : List (List ι)) (hL : L.Perm F) (hord : IsRatioOrder p w L) :
    SingleMachinePrec.Biclique.IsOptimalSchedule G p w N L.flatten := by sorry

end LawlerWCT.SeriesPar
Source
Lawler, Sequencing jobs to minimize total weighted completion time subject to precedence constraints, IRIA-LABORIA Rapport de Recherche No. 205 (Dec. 1976), HAL hal-04716371v1, pp. 9–12, §5, final paragraph "At the end of the computation, an optimal sequence is found by listing the jobs in the set N in nonincreasing ratio order"
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 6, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me