The scheduling problems, parameterized
Lax470956.SchedulingProblems · concepts/Lax470956/SchedulingProblems.lean · lax-470956
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Interval scheduling with eligible machine sets, as parameterized problems on words: the decision problem "is weight attainable?" parameterized by the number of machines, the same problem parameterized by , and the problem "can every job be scheduled?" parameterized by .
The three theorems of this submission are about these three problems: the first is W[1]-hard, the second is fixed-parameter tractable, and the third is NP-hard already when its parameter is bounded by an absolute constant.
Concept map
Lean source view on GitHub
| 1 | import Lax470956.InstanceEncoding |
| 2 | import Lax470956.ParameterizedComplexity |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: The scheduling problems, parameterized |
| 7 | type: definition |
| 8 | --- |
| 9 | Interval scheduling with eligible machine sets, as parameterized problems on words: |
| 10 | the decision problem "is weight attainable?" parameterized by the number of |
| 11 | machines, the same problem parameterized by , and the problem "can every |
| 12 | job be scheduled?" parameterized by . |
| 13 | |
| 14 | The three theorems of this submission are about these three problems: the first is |
| 15 | W[1]-hard, the second is fixed-parameter tractable, and the third is NP-hard already |
| 16 | when its parameter is bounded by an absolute constant. |
| 17 | |
| 18 | # Formalization notes |
| 19 | |
| 20 | Each parameter is read off the word rather than supplied beside it. The number of |
| 21 | machines is the word's second entry, so it costs a program nothing to obtain; |
| 22 | is the largest processing time, which a program computes in one pass over the |
| 23 | processing-time block, and which the parameter function therefore also computes rather |
| 24 | than reads. Both are functions of the word alone, as the definition of a parameterized problem asks. |
| 25 | |
| 26 | A word outside the domain has no meaningful parameter. The parameter function is total |
| 27 | regardless — it returns the second entry, or the largest entry of a block that may not |
| 28 | exist — and nothing is claimed about its value there, since every statement quantifies |
| 29 | over admissible words only. |
| 30 | |
| 31 | `pmaxOf` is defined on the word rather than on the decoded instance so that the |
| 32 | parameter of a problem is manifestly a function of the input. On an admissible word the |
| 33 | two agree, which is a lemma of the proof layer rather than part of the definition. |
| 34 | -/ |
| 35 | |
| 36 | namespace Lax470956.SchedulingProblems |
| 37 | |
| 38 | open Lax470956.Scheduling Lax470956.InstanceEncoding Lax470956.ParameterizedComplexity |
| 39 | open Lax808846.Ram Lax808846.RamComputes |
| 40 | |
| 41 | /-- The largest processing time declared by a word: the largest of the `n` entries of |
| 42 | its processing-time block. -/ |
| 43 | def pmaxOf (x : List ℕ) : ℕ := |
| 44 | ((List.range (jobCount x)).map (proc x)).foldr max 0 |
| 45 | |
| 46 | /-- **Interval scheduling with eligible machine sets**, parameterized by the number of |
| 47 | machines. -/ |
| 48 | def byMachines : Problem where |
| 49 | Domain := DecisionInstances |
| 50 | Yes x := ∃ I W, EncodesDecisionInstance x I W ∧ I.HasWeight W |
| 51 | param x := machineCount x |
| 52 | |
| 53 | /-- The same problem, parameterized by the number of machines together with the largest |
| 54 | processing time. -/ |
| 55 | def byMachinesAndPmax : Problem where |
| 56 | Domain := DecisionInstances |
| 57 | Yes x := ∃ I W, EncodesDecisionInstance x I W ∧ I.HasWeight W |
| 58 | param x := machineCount x + pmaxOf x |
| 59 | |
| 60 | /-- **Scheduling every job**: is there a feasible schedule that rejects no job? |
| 61 | Parameterized by the largest processing time. Instances carry no threshold. -/ |
| 62 | def allSchedulableByPmax : Problem where |
| 63 | Domain := Instances |
| 64 | Yes x := ∃ I, EncodesInstance x I ∧ I.AllSchedulable |
| 65 | param x := pmaxOf x |
| 66 | |
| 67 | /-- **The parameter is computed by a word RAM program in linear time.** One program and |
| 68 | one constant `c` such that, at every word length, on every decision instance whose |
| 69 | entries fit, the program halts within `c · (|x| + 1)` instructions having written the |
| 70 | largest processing time. |
| 71 | |
| 72 | A parameterized problem whose parameter no machine can read is not one a machine can be |
| 73 | handed, and the parameter of the second and third problems above is not an entry of the |
| 74 | word but a maximum over a block of it. This says that reading it costs a single pass, |
| 75 | so that nothing in the running time of the third theorem is hidden in obtaining the |
| 76 | parameter it is stated in terms of. -/ |
| 77 | axiom pmaxOf_computesInTime : |
| 78 | ∃ (prog : Program) (c : ℕ), ∀ w : ℕ, |
| 79 | ComputesInTime w prog |
| 80 | {x | x ∈ DecisionInstances ∧ Fits c w x} |
| 81 | (fun x => [pmaxOf x]) |
| 82 | (fun x => c * (x.length + 1)) |
| 83 | |
| 84 | end Lax470956.SchedulingProblems |
| 85 |
Formalization notes
Each parameter is read off the word rather than supplied beside it. The number of machines is the word's second entry, so it costs a program nothing to obtain; is the largest processing time, which a program computes in one pass over the processing-time block, and which the parameter function therefore also computes rather than reads. Both are functions of the word alone, as the definition of a parameterized problem asks.
A word outside the domain has no meaningful parameter. The parameter function is total regardless — it returns the second entry, or the largest entry of a block that may not exist — and nothing is claimed about its value there, since every statement quantifies over admissible words only.
is defined on the word rather than on the decoded instance so that the parameter of a problem is manifestly a function of the input. On an admissible word the two agree, which is a lemma of the proof layer rather than part of the definition.
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments