The Endpoint Sweep of Section 4, and Its Table
Lax496464.Sweep · concepts/Lax496464/Sweep.lean · lax-496464
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The algorithm behind the first half of the third theorem. The time axis is swept from left to right through the endpoints — the start times and the due dates — and the state carried at an instant is the set of selected jobs alive then, together with the weight selected so far and the preprocessing time spent. The table entry
records whether a feasible selection of weight , all of whose jobs have started by , is alive at in exactly and costs at most to preprocess.
Between two consecutive endpoints nothing happens, and at an endpoint exactly one thing does: a job becomes due, or a job starts. The two recursions of Section 4 say what each does to the table.
Since is a set of jobs alive at one instant, it has at most members, so the table has columns — which is where the running time comes from.
Concept map
In the paper
- page 4 of this submission's paper
Lean source view on GitHub
| 1 | import Lax496464.Conditions |
| 2 | import Lax496464.EstOrder |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: The Endpoint Sweep of Section 4, and Its Table |
| 7 | type: definition |
| 8 | --- |
| 9 | The algorithm behind the first half of the third theorem. The time axis is swept from |
| 10 | left to right through the *endpoints* — the start times and the due dates — and the |
| 11 | state carried at an instant is the set of selected jobs alive then, together with |
| 12 | the weight selected so far and the preprocessing time spent. The table entry |
| 13 | |
| 14 | records whether a feasible selection of weight , all of whose jobs have started by |
| 15 | , is alive at in exactly and costs at most to preprocess. |
| 16 | |
| 17 | Between two consecutive endpoints nothing happens, and at an endpoint exactly one thing |
| 18 | does: a job becomes due, or a job starts. The two recursions of Section 4 say what each |
| 19 | does to the table. |
| 20 | |
| 21 | Since is a set of jobs alive at one instant, it has at most members, so the |
| 22 | table has columns — which is where the running time comes from. |
| 23 | |
| 24 | # Formalization Notes |
| 25 | |
| 26 | The table is again a predicate rather than a value, downward closed in the preprocessing |
| 27 | budget, for the reason given for the table of Section 3. |
| 28 | |
| 29 | The state is the set of *selected* jobs alive at , not a set of machines: which machine |
| 30 | runs which job never matters, because at most jobs alive at once is the whole of |
| 31 | Condition 2. That is the depth characterization, and it is what makes a subset of the |
| 32 | alive jobs the right index. |
| 33 | |
| 34 | The preprocessing budget runs forwards here and backwards in Section 3, so the two |
| 35 | programs carry the same information in opposite directions. Nothing is claimed about |
| 36 | their relationship; each is proved against the definition of a feasible set. |
| 37 | |
| 38 | The endpoints are collected as a finite set of integers, with no order imposed. The |
| 39 | sweep's step needs consecutive endpoints, and that two consecutive ones enclose exactly |
| 40 | one event is where the distinctness of the endpoints is used. |
| 41 | -/ |
| 42 | |
| 43 | namespace Lax496464.Sweep |
| 44 | |
| 45 | open Lax496464.FlowShop Lax496464.FlowShop.Instance |
| 46 | |
| 47 | variable (I : Instance) |
| 48 | |
| 49 | /-- The total preprocessing time of `Z`. -/ |
| 50 | def pload (Z : Finset I.Job) : ℤ := ∑ i ∈ Z, (I.p i : ℤ) |
| 51 | |
| 52 | /-- The table: a feasible set of weight `W'`, all of whose jobs have started by `t`, is |
| 53 | alive at `t` in exactly `X` and costs at most `P'` to preprocess. -/ |
| 54 | def Reachable (t : ℤ) (X : Finset I.Job) (W' : ℕ) (P' : ℤ) : Prop := |
| 55 | ∃ Z : Finset I.Job, Feasible I Z ∧ (∀ k ∈ Z, s k ≤ t) ∧ |
| 56 | running I Z t = X ∧ weight I Z = W' ∧ pload I Z ≤ P' |
| 57 | |
| 58 | /-- The `2n` endpoints: the start times and the due dates. -/ |
| 59 | def endpoints : Finset ℤ := |
| 60 | (Finset.univ.image fun k : I.Job => s k) ∪ |
| 61 | (Finset.univ.image fun k : I.Job => (I.d k : ℤ)) |
| 62 | |
| 63 | end Lax496464.Sweep |
| 64 |
Formalization Notes
The table is again a predicate rather than a value, downward closed in the preprocessing budget, for the reason given for the table of Section 3.
The state is the set of selected jobs alive at , not a set of machines: which machine runs which job never matters, because at most jobs alive at once is the whole of Condition 2. That is the depth characterization, and it is what makes a subset of the alive jobs the right index.
The preprocessing budget runs forwards here and backwards in Section 3, so the two programs carry the same information in opposite directions. Nothing is claimed about their relationship; each is proved against the definition of a feasible set.
The endpoints are collected as a finite set of integers, with no order imposed. The sweep's step needs consecutive endpoints, and that two consecutive ones enclose exactly one event is where the distinctness of the endpoints is used.
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments