Non-preemptive scheduling on parallel machines
Lax434175.Nonpreemptive · concepts/Lax434175/Nonpreemptive.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
A non-preemptive schedule assigns to every job a nonempty set of machines and an integral start time. The job occupies these machines without interruption from its start time until its completion time, which is the start time plus the time it needs on these machines. A schedule is feasible for the kernel if no two jobs that share a machine overlap.
In the classical problems every job occupies a single machine; which sets of machines a job may occupy is the subject of the machine-set field.
Theorem. Every job starts no later than it completes.
Concept map
Lean source view on GitHub
| 1 | import Lax434175.ParallelMachines |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Non-preemptive scheduling on parallel machines |
| 6 | type: theorem |
| 7 | --- |
| 8 | A non-preemptive schedule assigns to every job a nonempty set of machines |
| 9 | and an integral start time. The job occupies these machines without |
| 10 | interruption from its start time until its completion time, which is the |
| 11 | start time plus the time it needs on these machines. A schedule is feasible |
| 12 | for the kernel if no two jobs that share a machine overlap. |
| 13 | |
| 14 | In the classical problems every job occupies a single machine; which sets of |
| 15 | machines a job may occupy is the subject of the machine-set field. |
| 16 | |
| 17 | **Theorem.** Every job starts no later than it completes. |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax434175.Nonpreemptive |
| 21 | open Lax434175.Kernels Lax434175.ParallelMachines |
| 22 | |
| 23 | structure Sched (x : Inst) where |
| 24 | machines : Fin x.jobs → Finset (Fin x.machines) |
| 25 | start : Fin x.jobs → ℕ |
| 26 | |
| 27 | def completion (x : Inst) (σ : Sched x) (j : Fin x.jobs) : ℕ := |
| 28 | σ.start j + duration x j (σ.machines j) |
| 29 | |
| 30 | /-- Every job occupies some machine, and two distinct jobs that share a |
| 31 | machine do not overlap. -/ |
| 32 | def feasible (x : Inst) (σ : Sched x) : Prop := |
| 33 | (∀ j, (σ.machines j).Nonempty) ∧ |
| 34 | ∀ i j, i ≠ j → ¬ Disjoint (σ.machines i) (σ.machines j) → |
| 35 | completion x σ i ≤ σ.start j ∨ completion x σ j ≤ σ.start i |
| 36 | |
| 37 | /-- The kernel of non-preemptive scheduling on parallel machines. -/ |
| 38 | def kernel : Kernel where |
| 39 | Inst := Inst |
| 40 | jobs := Inst.jobs |
| 41 | release := Inst.r |
| 42 | Sched := Sched |
| 43 | feasible := feasible |
| 44 | start _ σ j := (σ.start j : NNRat) |
| 45 | completion x σ j := (completion x σ j : NNRat) |
| 46 | |
| 47 | /-- Non-preemptive scheduling as a machine model. -/ |
| 48 | def model : Model where |
| 49 | kernel := kernel |
| 50 | inst x := x |
| 51 | jobs_eq _ := rfl |
| 52 | uses _ σ j S := Sched.machines σ j = S |
| 53 | |
| 54 | axiom startsBeforeCompletion : kernel.StartsBeforeCompletion |
| 55 | |
| 56 | end Lax434175.Nonpreemptive |
| 57 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments