Parallel machines
Lax434175.ParallelMachines · concepts/Lax434175/ParallelMachines.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Theorem
An instance on parallel machines has jobs, machines, and a processing time of job on machine . A machine model on parallel machines is a kernel whose instances are of this form, together with the relation "at some time of schedule , job occupies exactly the set of machines". Non-preemptive and preemptive scheduling are two such models. A job may occupy several machines at once; the time it then needs is its largest processing time on these machines.
The following fields restrict the instances of every machine model.
The machine-environment field:
- identical machines: the processing time of a job is the same on every machine;
- uniform machines: there are a length for every job and a positive speed for every machine with ;
- unrelated machines: no restriction.
Processing times are integral, so uniform machines are represented with the time unit chosen fine enough that every quotient is an integer.
The processing-time field:
- unit: ;
- equal: there is a number with ;
- one or two: ;
- arbitrary: no restriction.
In the environment field each value is a special case of the next. Unit processing times are a special case of equal ones and of one or two, and every value of arbitrary ones.
Theorem. Over every machine model, the machine-environment and processing-time fields are sound.
Concept map
Evidence
Lean source view on GitHub
| 1 | import Mathlib.Data.Finset.Lattice.Fold |
| 2 | import Mathlib.Data.Fintype.Basic |
| 3 | import Lax434175.Modules |
| 4 | |
| 5 | /-! |
| 6 | --- |
| 7 | title: Parallel machines |
| 8 | type: theorem |
| 9 | --- |
| 10 | An instance on parallel machines has jobs, machines, and a |
| 11 | processing time of job on machine . A machine model on |
| 12 | parallel machines is a kernel whose instances are of this form, together |
| 13 | with the relation "at some time of schedule , job occupies |
| 14 | exactly the set of machines". Non-preemptive and preemptive scheduling |
| 15 | are two such models. A job may occupy several machines at once; the time it |
| 16 | then needs is its largest processing time on these machines. |
| 17 | |
| 18 | The following fields restrict the instances of every machine model. |
| 19 | |
| 20 | The machine-environment field: |
| 21 | |
| 22 | - identical machines: the processing time of a job is the same on every |
| 23 | machine; |
| 24 | - uniform machines: there are a length for every job and a positive |
| 25 | speed for every machine with ; |
| 26 | - unrelated machines: no restriction. |
| 27 | |
| 28 | Processing times are integral, so uniform machines are represented with the |
| 29 | time unit chosen fine enough that every quotient is an integer. |
| 30 | |
| 31 | The processing-time field: |
| 32 | |
| 33 | - unit: ; |
| 34 | - equal: there is a number with ; |
| 35 | - one or two: ; |
| 36 | - arbitrary: no restriction. |
| 37 | |
| 38 | In the environment field each value is a special case of the next. Unit |
| 39 | processing times are a special case of equal ones and of one or two, and |
| 40 | every value of arbitrary ones. |
| 41 | |
| 42 | **Theorem.** Over every machine model, the machine-environment and |
| 43 | processing-time fields are sound. |
| 44 | -/ |
| 45 | |
| 46 | namespace Lax434175.ParallelMachines |
| 47 | open Lax434175.Kernels Lax434175.Modules |
| 48 | |
| 49 | structure Inst where |
| 50 | jobs : ℕ |
| 51 | machines : ℕ |
| 52 | /-- The processing time of a job on a machine. -/ |
| 53 | p : Fin jobs → Fin machines → ℕ |
| 54 | /-- The release date of a job. -/ |
| 55 | r : Fin jobs → ℕ |
| 56 | |
| 57 | /-- The time a job needs when it occupies a set of machines. -/ |
| 58 | def duration (x : Inst) (j : Fin x.jobs) (S : Finset (Fin x.machines)) : ℕ := |
| 59 | S.sup (x.p j) |
| 60 | |
| 61 | /-- A kernel on parallel machines. -/ |
| 62 | structure Model where |
| 63 | kernel : Kernel |
| 64 | /-- The parallel-machine instance underlying an instance of the kernel. -/ |
| 65 | inst : kernel.Inst → Inst |
| 66 | /-- The jobs of the kernel are those of the underlying instance. -/ |
| 67 | jobs_eq : ∀ x, kernel.jobs x = (inst x).jobs |
| 68 | /-- At some time of the schedule the job occupies exactly this set of |
| 69 | machines. -/ |
| 70 | uses : (x : kernel.Inst) → kernel.Sched x → Fin (inst x).jobs → |
| 71 | Finset (Fin (inst x).machines) → Prop |
| 72 | |
| 73 | inductive Environment |
| 74 | | identical |
| 75 | | uniform |
| 76 | | unrelated |
| 77 | |
| 78 | /-- The instances of a machine environment. -/ |
| 79 | def Environment.holds : Environment → Inst → Prop |
| 80 | | .identical, x => ∀ j i i', x.p j i = x.p j i' |
| 81 | | .uniform, x => ∃ (q : Fin x.jobs → ℕ) (s : Fin x.machines → ℕ), |
| 82 | ∀ j i, 0 < s i ∧ x.p j i * s i = q j |
| 83 | | .unrelated, _ => True |
| 84 | |
| 85 | /-- The position of an environment in the chain identical, uniform, unrelated. -/ |
| 86 | def Environment.rank : Environment → ℕ |
| 87 | | .identical => 0 |
| 88 | | .uniform => 1 |
| 89 | | .unrelated => 2 |
| 90 | |
| 91 | /-- The machine-environment field. -/ |
| 92 | def environment (M : Model) : Module M.kernel := |
| 93 | Module.ofRestriction Environment (fun v x => v.holds (M.inst x)) |
| 94 | (fun v w => decide (v.rank ≤ w.rank)) |
| 95 | |
| 96 | inductive ProcessingTimes |
| 97 | | unit |
| 98 | | equal |
| 99 | | oneOrTwo |
| 100 | | arbitrary |
| 101 | deriving DecidableEq |
| 102 | |
| 103 | /-- The instances of a processing-time restriction. -/ |
| 104 | def ProcessingTimes.holds : ProcessingTimes → Inst → Prop |
| 105 | | .unit, x => ∀ j i, x.p j i = 1 |
| 106 | | .equal, x => ∃ p, ∀ j i, x.p j i = p |
| 107 | | .oneOrTwo, x => ∀ j i, x.p j i = 1 ∨ x.p j i = 2 |
| 108 | | .arbitrary, _ => True |
| 109 | |
| 110 | def ProcessingTimes.le : ProcessingTimes → ProcessingTimes → Bool |
| 111 | | _, .arbitrary => true |
| 112 | | .unit, _ => true |
| 113 | | v, w => decide (v = w) |
| 114 | |
| 115 | /-- The processing-time field. -/ |
| 116 | def processingTimes (M : Model) : Module M.kernel := |
| 117 | Module.ofRestriction ProcessingTimes (fun v x => v.holds (M.inst x)) ProcessingTimes.le |
| 118 | |
| 119 | /-- The number of machines, a parameter of every machine model. -/ |
| 120 | def machines (M : Model) : M.kernel.Inst → ℕ := fun x => (M.inst x).machines |
| 121 | |
| 122 | axiom environment_sound (M : Model) : (environment M).Sound |
| 123 | |
| 124 | axiom processingTimes_sound (M : Model) : (processingTimes M).Sound |
| 125 | |
| 126 | end Lax434175.ParallelMachines |
| 127 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments