The Construction of Section 8
Lax496464.Construction · concepts/Lax496464/Construction.lean · lax-496464
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The shop built from a Hitting Set instance over with solution size . It has second-stage machines and unit weights.
The time axis is measured in the unit and divided into segments, each of which is divided into epochs, one per set of the family. The epoch of segment and set is numbered and occupies the interval from to ; the squares make each epoch exactly long, which is what the jobs are cut to fit.
Each epoch carries three families of jobs.
- One selection job for every element of . It needs no preprocessing, occupies the whole epoch, and is due at its end, offset by .
- Two dummy jobs for every element of the universe. The first occupies the first of the epoch, the second the last ; both need units of preprocessing, which is what limits how many of them an epoch can afford.
A hitting set of size selects, in every epoch, one selection job — the one for the element hitting that epoch's set — and dummies, one pair for each of the other elements. The target is just-in-time jobs.
Concept map
In the paper
- page 7 of this submission's paper
Lean source view on GitHub
| 1 | import Lax496464.FlowShop |
| 2 | import Lax496464.HittingSet |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: The Construction of Section 8 |
| 7 | type: definition |
| 8 | --- |
| 9 | The shop built from a Hitting Set instance over |
| 10 | with solution size . It has second-stage machines and unit weights. |
| 11 | |
| 12 | The time axis is measured in the unit and divided into *segments*, |
| 13 | each of which is divided into *epochs*, one per set of the family. The epoch of |
| 14 | segment and set is numbered and occupies the interval from |
| 15 | to ; the squares make each |
| 16 | epoch exactly long, which is what the jobs are cut to fit. |
| 17 | |
| 18 | Each epoch carries three families of jobs. |
| 19 | |
| 20 | * One *selection job* for every element of . It needs no preprocessing, occupies |
| 21 | the whole epoch, and is due at its end, offset by . |
| 22 | * Two *dummy jobs* for every element of the universe. The first occupies the first |
| 23 | of the epoch, the second the last ; both need units |
| 24 | of preprocessing, which is what limits how many of them an epoch can afford. |
| 25 | |
| 26 | A hitting set of size selects, in every epoch, one selection job — the one for the |
| 27 | element hitting that epoch's set — and dummies, one pair for each of the other |
| 28 | elements. The target is just-in-time jobs. |
| 29 | |
| 30 | # Formalization Notes |
| 31 | |
| 32 | **Two corrections to the published construction.** Both are recorded here because the |
| 33 | construction below is the corrected one. |
| 34 | |
| 35 | The first is the number of segments. The paper takes , and that is one too |
| 36 | few. The extraction of a hitting set is a pigeonhole: each machine's offset is |
| 37 | nondecreasing across segments and confined to , so it changes at most |
| 38 | times, and at most of the gaps between consecutive segments see any |
| 39 | change. A gap across which nothing changes therefore exists only if there are *more* than |
| 40 | gaps, that is only if . The published value gives exactly |
| 41 | , and the count is not slack: let the first machine change across the |
| 42 | first gaps, the second across the next , and so on, and every gap is consumed |
| 43 | with no two segments alike. Taking repairs it, and costs nothing: every |
| 44 | statement about the construction is generic in . |
| 45 | |
| 46 | The second is the range of . The paper writes , |
| 47 | which presupposes and says so nowhere. At the construction does not |
| 48 | merely degenerate, it is wrong: there , so every second operation has length zero, |
| 49 | every interval is empty and no two jobs conflict at all. Every dummy still costs |
| 50 | more to preprocess than it has time for, but *all* selection jobs become schedulable |
| 51 | simultaneously, whatever the family looks like, and the target is met with no hitting set |
| 52 | in sight. The problem reduced from is accordingly restricted to , which |
| 53 | costs nothing. |
| 54 | |
| 55 | Two smaller things: the printed is the integer , |
| 56 | which is what appears below, and the target size printed in the opening paragraph of the |
| 57 | section as is the that the section's own subsections |
| 58 | and lemmas use. |
| 59 | |
| 60 | **Numbering.** Jobs are numbered rather than tagged, because an instance is something a |
| 61 | machine is handed and a word presents its jobs in an order. The selection block comes |
| 62 | first, copies of one job per membership pair with , in the order |
| 63 | in which the pairs are enumerated; then the two dummy blocks, each |
| 64 | jobs indexed by segment, set and element in that order. Only the memberships that exist |
| 65 | are given jobs, so the weights are all one and the hardness claim lands on the |
| 66 | unit-weight slice, which is the problem the paper's first |
| 67 | theorem is about. |
| 68 | |
| 69 | The universe is counted from zero here and from one in the paper, and the offset that |
| 70 | distinguishes the jobs of an epoch from one another is correspondingly . It has |
| 71 | to be nonzero: an offset of zero would make two jobs of one epoch share a due date, and |
| 72 | the extraction of the hitting set reads the element off the due date. |
| 73 | |
| 74 | The element offsets are smaller than , so they perturb the due dates without |
| 75 | disturbing the tiling of an epoch. That is exactly what buys. |
| 76 | -/ |
| 77 | |
| 78 | namespace Lax496464.Construction |
| 79 | |
| 80 | open Lax496464.FlowShop |
| 81 | |
| 82 | variable (P : HittingSet.Instance) (k : ℕ) |
| 83 | |
| 84 | /-- `R = k(n − 1) + 2`, the number of segments. The paper's value is one smaller; see the |
| 85 | notes above. -/ |
| 86 | def R : ℕ := k * (P.n - 1) + 2 |
| 87 | |
| 88 | /-- `Q = (k − 1)(n + 1)`, the unit the whole time axis is measured in. -/ |
| 89 | def Q : ℕ := (k - 1) * (P.n + 1) |
| 90 | |
| 91 | /-- `g(r,j) = rm + j`, the position of the epoch of segment `r` and set `j`, counted from |
| 92 | one. -/ |
| 93 | def g (r j : ℕ) : ℕ := r * P.m + (j + 1) |
| 94 | |
| 95 | /-- `G(r,j) = g(r,j)²Q`, the instant that epoch begins. -/ |
| 96 | def G (r j : ℕ) : ℕ := g P r j ^ 2 * Q P k |
| 97 | |
| 98 | /-- The membership pairs `(j, i)` with `i ∈ F j`, enumerated. Each of them contributes one |
| 99 | selection job per segment. -/ |
| 100 | def memberList : List (ℕ × ℕ) := |
| 101 | (List.finRange P.m).flatMap fun j => |
| 102 | (P.members j).map fun i : Fin P.n => ((j : ℕ), (i : ℕ)) |
| 103 | |
| 104 | /-- The number of selection jobs: one per segment and membership pair. -/ |
| 105 | def selCount : ℕ := R P k * (memberList P).length |
| 106 | |
| 107 | /-- The number of jobs in one dummy block: one per segment, set and universe element. -/ |
| 108 | def dumCount : ℕ := R P k * P.m * P.n |
| 109 | |
| 110 | /-- The number of jobs of the constructed shop. -/ |
| 111 | def numJobs : ℕ := selCount P k + 2 * dumCount P k |
| 112 | |
| 113 | /-- Job `t` described: which of the three families it belongs to — `0` selection, `1` the |
| 114 | first dummy, `2` the second — and its segment, set and element. -/ |
| 115 | def slot (t : ℕ) : ℕ × ℕ × ℕ × ℕ := |
| 116 | if t < selCount P k then |
| 117 | let e := (memberList P).getD (t % (memberList P).length) (0, 0) |
| 118 | (0, t / (memberList P).length, e.1, e.2) |
| 119 | else |
| 120 | let u := t - selCount P k |
| 121 | let v := if u < dumCount P k then u else u - dumCount P k |
| 122 | (if u < dumCount P k then 1 else 2, |
| 123 | v / (P.m * P.n), v % (P.m * P.n) / P.n, v % P.n) |
| 124 | |
| 125 | /-- Which of the three families job `t` belongs to. -/ |
| 126 | def family (t : ℕ) : ℕ := (slot P k t).1 |
| 127 | |
| 128 | /-- The segment of job `t`. -/ |
| 129 | def seg (t : ℕ) : ℕ := (slot P k t).2.1 |
| 130 | |
| 131 | /-- The set of the family job `t` belongs to. -/ |
| 132 | def setIdx (t : ℕ) : ℕ := (slot P k t).2.2.1 |
| 133 | |
| 134 | /-- The universe element of job `t`. -/ |
| 135 | def elem (t : ℕ) : ℕ := (slot P k t).2.2.2 |
| 136 | |
| 137 | /-- Preprocessing times: a selection job needs none, a dummy of epoch `(r,j)` needs |
| 138 | `g(r,j)(n+1)`, which is the paper's `g(r,j)Q/(k−1)`. -/ |
| 139 | def jp (t : ℕ) : ℕ := |
| 140 | if family P k t = 0 then 0 else g P (seg P k t) (setIdx P k t) * (P.n + 1) |
| 141 | |
| 142 | /-- Processing times: a selection job fills its whole epoch, and the two dummies split it |
| 143 | in the ratio `g : g+1`. -/ |
| 144 | def jq (t : ℕ) : ℕ := |
| 145 | if family P k t = 0 then (2 * g P (seg P k t) (setIdx P k t) + 1) * Q P k |
| 146 | else if family P k t = 1 then g P (seg P k t) (setIdx P k t) * Q P k |
| 147 | else (g P (seg P k t) (setIdx P k t) + 1) * Q P k |
| 148 | |
| 149 | /-- Due dates: the first dummy is due a `g(r,j)Q` into its epoch, the other two at its |
| 150 | end; all three are offset by the element they carry. -/ |
| 151 | def jd (t : ℕ) : ℕ := |
| 152 | if family P k t = 1 then |
| 153 | G P k (seg P k t) (setIdx P k t) + g P (seg P k t) (setIdx P k t) * Q P k |
| 154 | + (elem P k t + 1) |
| 155 | else |
| 156 | G P k (seg P k t) (setIdx P k t) + (2 * g P (seg P k t) (setIdx P k t) + 1) * Q P k |
| 157 | + (elem P k t + 1) |
| 158 | |
| 159 | /-- The shop built from `P` and `k`: `k` machines and unit weights. -/ |
| 160 | def construct : FlowShop.Instance where |
| 161 | jobs := numJobs P k |
| 162 | machines := k |
| 163 | p t := jp P k t |
| 164 | q t := jq P k t |
| 165 | d t := jd P k t |
| 166 | w _ := 1 |
| 167 | |
| 168 | /-- The number of just-in-time jobs the construction asks for: one selection job and |
| 169 | `2(k−1)` dummies in each of the `R·m` epochs. -/ |
| 170 | def target : ℕ := R P k * P.m * (2 * k - 1) |
| 171 | |
| 172 | end Lax496464.Construction |
| 173 |
Formalization Notes
Two corrections to the published construction. Both are recorded here because the construction below is the corrected one.
The first is the number of segments. The paper takes , and that is one too few. The extraction of a hitting set is a pigeonhole: each machine's offset is nondecreasing across segments and confined to , so it changes at most times, and at most of the gaps between consecutive segments see any change. A gap across which nothing changes therefore exists only if there are more than gaps, that is only if . The published value gives exactly , and the count is not slack: let the first machine change across the first gaps, the second across the next , and so on, and every gap is consumed with no two segments alike. Taking repairs it, and costs nothing: every statement about the construction is generic in .
The second is the range of . The paper writes , which presupposes and says so nowhere. At the construction does not merely degenerate, it is wrong: there , so every second operation has length zero, every interval is empty and no two jobs conflict at all. Every dummy still costs more to preprocess than it has time for, but all selection jobs become schedulable simultaneously, whatever the family looks like, and the target is met with no hitting set in sight. The problem reduced from is accordingly restricted to , which costs nothing.
Two smaller things: the printed is the integer , which is what appears below, and the target size printed in the opening paragraph of the section as is the that the section's own subsections and lemmas use.
Numbering. Jobs are numbered rather than tagged, because an instance is something a machine is handed and a word presents its jobs in an order. The selection block comes first, copies of one job per membership pair with , in the order in which the pairs are enumerated; then the two dummy blocks, each jobs indexed by segment, set and element in that order. Only the memberships that exist are given jobs, so the weights are all one and the hardness claim lands on the unit-weight slice, which is the problem the paper's first theorem is about.
The universe is counted from zero here and from one in the paper, and the offset that distinguishes the jobs of an epoch from one another is correspondingly . It has to be nonzero: an offset of zero would make two jobs of one epoch share a due date, and the extraction of the hitting set reads the element off the due date.
The element offsets are smaller than , so they perturb the due dates without disturbing the tiling of an epoch. That is exactly what buys.
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments