Just-in-Time Scheduling on Unrelated Parallel Machines
Lax117284.JustInTime · concepts/Lax117284/JustInTime.lean · lax-117284
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
An instance of consists of jobs and unrelated parallel machines. Job has a due date and a processing time on machine . A job is just in time if it is executed on some machine and completes exactly at its due date, so that, when assigned to machine , it occupies the interval of that machine; two jobs assigned to the same machine may not overlap. The objective counts the jobs that are just in time, and the decision problem asks whether all jobs can be just in time at once. It is NP-hard.
Concept map
Evidence
Each proof establishes this claim relative to its assumptions.
Lean source view on GitHub
| 1 | import Lax117284.Problems |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Just-in-Time Scheduling on Unrelated Parallel Machines |
| 6 | type: definition |
| 7 | --- |
| 8 | An instance of consists of jobs and unrelated parallel |
| 9 | machines. Job has a due date and a processing time on machine . A job |
| 10 | is *just in time* if it is executed on some machine and completes exactly at its due date, |
| 11 | so that, when assigned to machine , it occupies the interval |
| 12 | of that machine; two jobs assigned to the same machine may not |
| 13 | overlap. The objective counts the jobs that are just in time, and the decision |
| 14 | problem asks whether all jobs can be just in time at once. It is NP-hard. |
| 15 | |
| 16 | # Formalization Notes |
| 17 | |
| 18 | The problem is stated at the maximum value of the objective, which is the form the |
| 19 | reduction into fair repetitive interval scheduling uses and the form in which it is hard: a |
| 20 | schedule is an assignment of every job to a machine such that no two jobs on a machine |
| 21 | overlap. |
| 22 | |
| 23 | Due dates do not depend on the machine, and processing times do, which is what makes the |
| 24 | machines unrelated. |
| 25 | -/ |
| 26 | |
| 27 | namespace Lax117284.JustInTime |
| 28 | |
| 29 | open Lax434930.PolynomialTime |
| 30 | |
| 31 | /-- An instance of `R || ∑_j Z_j`: `jobs` jobs and `machines` unrelated machines, where job |
| 32 | `j` has due date `d j` and processing time `p i j` on machine `i`. -/ |
| 33 | structure Instance where |
| 34 | /-- The number `n` of jobs. -/ |
| 35 | jobs : ℕ |
| 36 | /-- The number `m` of machines. -/ |
| 37 | machines : ℕ |
| 38 | /-- The processing time `p i j` of job `j` on machine `i`. -/ |
| 39 | p : Fin machines → Fin jobs → ℕ |
| 40 | /-- The due date `d j` of job `j`, the same on every machine. -/ |
| 41 | d : Fin jobs → ℕ |
| 42 | /-- Every job takes some time. -/ |
| 43 | p_pos : ∀ i j, 0 < p i j |
| 44 | /-- No job starts before time `0`. -/ |
| 45 | p_le_d : ∀ i j, p i j ≤ d j |
| 46 | |
| 47 | namespace Instance |
| 48 | |
| 49 | variable (R : Instance) |
| 50 | |
| 51 | /-- The interval `(d j - p i j, d j]` occupied by job `j` when it is executed just in time |
| 52 | on machine `i`. -/ |
| 53 | def job (i : Fin R.machines) (j : Fin R.jobs) : Set ℕ := |
| 54 | Set.Ioc (R.d j - R.p i j) (R.d j) |
| 55 | |
| 56 | /-- Jobs `j` and `j'` **overlap on machine `i`**: executing both just in time on that |
| 57 | machine would have them share a time point. -/ |
| 58 | def Overlap (i : Fin R.machines) (j j' : Fin R.jobs) : Prop := |
| 59 | (R.job i j ∩ R.job i j').Nonempty |
| 60 | |
| 61 | /-- **The question of `R || ∑_j Z_j` at its maximum value**: can every job be executed just |
| 62 | in time, that is, is there an assignment of the jobs to machines under which no two jobs of |
| 63 | a machine overlap? -/ |
| 64 | def AllJustInTime : Prop := |
| 65 | ∃ f : Fin R.jobs → Fin R.machines, |
| 66 | ∀ j j', j ≠ j' → f j = f j' → ¬ R.Overlap (f j) j j' |
| 67 | |
| 68 | end Instance |
| 69 | |
| 70 | /-- An instance as a binary word: the number of jobs, the number of machines, the due |
| 71 | dates, and then the processing times machine by machine. -/ |
| 72 | def encodeInstance (R : Instance) : Word := |
| 73 | Problems.encodeNat R.jobs ++ Problems.encodeNat R.machines ++ |
| 74 | ((List.finRange R.jobs).flatMap fun j => Problems.encodeNat (R.d j)) ++ |
| 75 | (List.finRange R.machines).flatMap fun i => |
| 76 | (List.finRange R.jobs).flatMap fun j => Problems.encodeNat (R.p i j) |
| 77 | |
| 78 | /-- **`R || ∑_j Z_j`**, as a language. -/ |
| 79 | def AllJIT : Language := |
| 80 | {w | ∃ R : Instance, encodeInstance R = w ∧ R.AllJustInTime} |
| 81 | |
| 82 | /-- **`R || ∑_j Z_j` is NP-hard.** -/ |
| 83 | axiom allJIT_npHard : Problems.NPHard AllJIT |
| 84 | |
| 85 | end Lax117284.JustInTime |
| 86 |
Formalization Notes
The problem is stated at the maximum value of the objective, which is the form the reduction into fair repetitive interval scheduling uses and the form in which it is hard: a schedule is an assignment of every job to a machine such that no two jobs on a machine overlap.
Due dates do not depend on the machine, and processing times do, which is what makes the machines unrelated.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments