The Integer Program of Section 6.2
Lax496464.IntegerProgram · concepts/Lax496464/IntegerProgram.lean · lax-496464
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
When all preprocessing times are equal to , a set of jobs is feasible exactly when it satisfies two families of linear inequalities in its own indicator vector :
one of each per job . The first is Condition 1 — with equal preprocessing times, the time the first stage has spent is the number of jobs it has run — and the second is Condition 2 in its depth form, tested at the start times, where the number of jobs alive can only increase.
Maximizing subject to these is therefore the problem itself, written as an integer program with constraints and variables.
Concept map
In the paper
- page 6 of this submission's paper
Lean source view on GitHub
| 1 | import Lax496464.Conditions |
| 2 | import Lax496464.EstOrder |
| 3 | import Lax496464.ProperInstances |
| 4 | import Mathlib.Data.Matrix.Mul |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: The Integer Program of Section 6.2 |
| 9 | type: definition |
| 10 | --- |
| 11 | When all preprocessing times are equal to , a set of jobs is feasible exactly when it |
| 12 | satisfies two families of linear inequalities in its own indicator vector |
| 13 | : |
| 14 | |
| 15 | |
| 16 | one of each per job . The first is Condition 1 — with equal preprocessing times, the |
| 17 | time the first stage has spent is the number of jobs it has run — and the second is |
| 18 | Condition 2 in its depth form, tested at the start times, where the number of jobs alive |
| 19 | can only increase. |
| 20 | |
| 21 | Maximizing subject to these is therefore the problem itself, written as |
| 22 | an integer program with constraints and variables. |
| 23 | |
| 24 | # Formalization Notes |
| 25 | |
| 26 | The constraint matrix is indexed by a sum type, one copy of the jobs for each family, so |
| 27 | that the two families can be told apart without an arithmetic encoding of the row index. |
| 28 | Its entries are integers rather than naturals, because the inequalities are, and because |
| 29 | total unimodularity is a statement about an integer matrix. |
| 30 | |
| 31 | Constraint (6) is imposed for *every* job, selected or not. That is what the program |
| 32 | says, and it makes the correspondence to feasible sets fail on an instance with a |
| 33 | negative start time: the row of such a job is unsatisfiable even at |
| 34 | , while the empty set is feasible. Such a job can never be completed just in |
| 35 | time and would be deleted in advance, which is presumably what the paper intends; since |
| 36 | the model here admits negative start times, the correspondence carries the hypothesis |
| 37 | that they are nonnegative. |
| 38 | |
| 39 | Properness is *not* needed for the correspondence. It is needed only for the consecutive |
| 40 | ones property of the second family, which is what the fifth lemma is about. |
| 41 | -/ |
| 42 | |
| 43 | namespace Lax496464.IntegerProgram |
| 44 | |
| 45 | open Lax496464.FlowShop Lax496464.FlowShop.Instance |
| 46 | |
| 47 | variable (I : Instance) |
| 48 | |
| 49 | /-- The constraint matrix: the rows `inl j` are the prefix sums of constraint (6), the |
| 50 | rows `inr j` the jobs alive at `s j` of constraint (7). -/ |
| 51 | def matrix : Matrix (I.Job ⊕ I.Job) I.Job ℤ |
| 52 | | Sum.inl j, i => if i ≤ j then 1 else 0 |
| 53 | | Sum.inr j, i => if s i ≤ s j ∧ s j < (I.d i : ℤ) then 1 else 0 |
| 54 | |
| 55 | /-- The right-hand sides: `⌊s j / p⌋` for (6) and `m` for (7). -/ |
| 56 | def rhs (p : ℕ) : I.Job ⊕ I.Job → ℤ |
| 57 | | Sum.inl j => s j / p |
| 58 | | Sum.inr _ => I.machines |
| 59 | |
| 60 | /-- The `0/1` vector of a set of jobs. -/ |
| 61 | def indicator (Z : Finset I.Job) : I.Job → ℤ := fun i => if i ∈ Z then 1 else 0 |
| 62 | |
| 63 | end Lax496464.IntegerProgram |
| 64 |
Formalization Notes
The constraint matrix is indexed by a sum type, one copy of the jobs for each family, so that the two families can be told apart without an arithmetic encoding of the row index. Its entries are integers rather than naturals, because the inequalities are, and because total unimodularity is a statement about an integer matrix.
Constraint (6) is imposed for every job, selected or not. That is what the program says, and it makes the correspondence to feasible sets fail on an instance with a negative start time: the row of such a job is unsatisfiable even at , while the empty set is feasible. Such a job can never be completed just in time and would be deleted in advance, which is presumably what the paper intends; since the model here admits negative start times, the correspondence carries the hypothesis that they are nonnegative.
Properness is not needed for the correspondence. It is needed only for the consecutive ones property of the second family, which is what the fifth lemma is about.
Used by
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments