The kinds of results on scheduling problems
Lax434175.Results · concepts/Lax434175/Results.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
A result on a scheduling problem is a statement about its decision version on words, about algorithms that output schedules, or about online play. Such statements depend on how instances and schedules are written, so they are made relative to a reading of the problem: which words encode which instance, which words write which schedule, and what an online scheduler sees at each time. A reading of a family gives one for every specification. The results of the literature are claims about the standard binary readings; here every result is a proposition about a given reading.
Fix a reading and parameters : functions of the instance and the threshold into the naturals (most depend on the instance only; some, such as the pathwidth of time windows that end at the threshold, depend on both). The decision version on words: a word of an instance, then the sign and absolute value of an integral threshold , is a yes-instance if some feasible schedule has cost at most . Running times are those of the word RAM (lax-496464, lax-808846).
Exact algorithms and hardness. In P: decided in time in the bit size . Pseudo-polynomial: in time , where is the largest number of the word. NP-hard: of lax-496464; strongly NP-hard: NP-hard on the words whose numbers are at most . In P (pseudo-polynomial) for every fixed value of ; FPT, W[t]-hard (strongly: on such words), para-NP-hard: NP-hard for one fixed value.
Running times. An algorithm can be stated with its exact running time, a function of the instance (of , , , the total weight, …): one program halts, writing the answer for the instance and the threshold, within instructions on the word of every instance , at every word length with , where is the length of the word and its largest number — words of bits, as on the word RAM of the literature. Deciding, approximating, approximating with random bits and approximation schemes each have such a form; a submitted algorithm is a program with a proof of one of them. Deciding can also be stated without the constant: one program halts with the answer within exactly instructions, a function of the instance and the threshold, at the same word lengths.
Randomized deciding. The program reads, after the word, at most random bits and halts within instructions on every choice of them. With bounded error its answer is right for at least two thirds of the choices. With one-sided error it never accepts a no-instance and accepts a yes-instance for at least half of the choices. With zero error (Las Vegas) it is always right and the bound holds for the number of instructions averaged over the choices. Repetition turns any of these into error at times the cost, so the constants and are not essential.
Approximation. A ratio is a function of the instance into the reals. A -approximation is a polynomial-time program that on the word of an instance with a feasible schedule writes the word of a feasible schedule costing at most times every feasible schedule; for a maximization problem, whose cost is the negative of its value, the value is at least times every value. A randomized one reads polynomially many random bits; every choice gives a feasible schedule, the average cost is within the ratio, and the running time is polynomial in the worst case or, for an expected-time algorithm, on average over the bits. Approximations may be restricted to the instances of a set. PTAS, EPTAS and FPTAS are as usual; inapproximability below unless P = NP says that if P ≠ NP no -approximation exists for a constant . An *additive* -approximation writes a feasible schedule costing at most every feasible cost plus , a function of the instance; an additive scheme does so with for every , in polynomial time for each fixed . A parameterized approximation scheme for a parameter is one program that writes a -approximate schedule from the word of an instance followed by , in time .
Running times and word size. A running time, upper or lower, is stated with short words, ; the classes keep the long words of the registered notions and are reached from running times through the transfer theorems. A lower bound is stated for the time plus the length of the shortest word of the instance.
Wide words. An algorithm whose running time exceeds every polynomial may need words that hold the address of every step, besides the short words above; this is the standard assumption for such algorithms, whose tables are as large as their running times. Deciding within with wide words asks the program to work only at those word lengths.
Restrictions. A result may hold on the instances satisfying a predicate only: it is then a result on the problem restricted to them, read with the same words.
Kept weight. A problem that minimizes the weight of the jobs it rejects (late, or not just in time) is read with the same instances, schedules and costs when a source maximizes the weight it keeps. The kept weight of a schedule is the total weight of the instance minus its cost. A -approximation of the kept weight, for , writes a feasible schedule that keeps at least times the weight of every feasible schedule; schemes keep times it. An online algorithm is -competitive for the kept weight, , if every feasible schedule keeps at most times what the algorithm keeps plus a constant, the convention of the sources on throughput.
Kernels. A kernelization for a parameter is a polynomial-time map on the words of instances that keeps the answer and whose output has size (bit length) and parameter at most for a computable ; a polynomial kernel has polynomial.
The exponential time hypothesis. A formula is written as the number of variables followed, for every clause, by its length and its literals, the literal of variable being if positive and if negative. ETH: for some no program decides the satisfiability of formulas whose clauses have three literals over variables below within instructions, at the word lengths above. A function is if for every rational , eventually .
Online. A deterministic algorithm is -competitive if it is non-anticipative for the revelation and, for some additive constant, its cost is at most times every feasible cost plus that constant; a randomized one is a finite distribution over non-anticipative algorithms. A lower bound says that no algorithm is -competitive for .
Concept map
Lean source view on GitHub
| 1 | import Lax434175.WordProblems |
| 2 | import Lax434175.Online |
| 3 | import Lax496464.WH_B4_Hierarchies |
| 4 | import Lax496464.WH_F3_NPHard |
| 5 | import Lax434930.PolynomialTime |
| 6 | import Lax434930.NondeterministicPolynomialTime |
| 7 | import Lax429075.CNF |
| 8 | import Mathlib.Analysis.SpecialFunctions.Log.Basic |
| 9 | import Mathlib.Analysis.SpecialFunctions.Pow.Real |
| 10 | |
| 11 | /-! |
| 12 | --- |
| 13 | title: The kinds of results on scheduling problems |
| 14 | type: definition |
| 15 | --- |
| 16 | A result on a scheduling problem is a statement about its decision version on |
| 17 | words, about algorithms that output schedules, or about online play. Such |
| 18 | statements depend on how instances and schedules are written, so they are made |
| 19 | relative to a reading of the problem: which words encode which instance, which |
| 20 | words write which schedule, and what an online scheduler sees at each time. A |
| 21 | reading of a family gives one for every specification. The results of the |
| 22 | literature are claims about the standard binary readings; here every result |
| 23 | is a proposition about a given reading. |
| 24 | |
| 25 | Fix a reading and parameters : functions of the instance and the |
| 26 | threshold into the naturals (most depend on the instance only; some, such as the |
| 27 | pathwidth of time windows that end at the threshold, depend on both). The decision version on words: a word of an instance, then the sign |
| 28 | and absolute value of an integral threshold , is a yes-instance if some |
| 29 | feasible schedule has cost at most . Running times are those of the word RAM |
| 30 | (lax-496464, lax-808846). |
| 31 | |
| 32 | **Exact algorithms and hardness.** *In P*: decided in time in |
| 33 | the bit size . *Pseudo-polynomial*: in time , where |
| 34 | is the largest number of the word. *NP-hard*: `NPHardIn` of lax-496464; |
| 35 | *strongly NP-hard*: NP-hard on the words whose numbers are at most |
| 36 | . *In P (pseudo-polynomial) for every fixed value* of |
| 37 | ; *FPT*, *W[t]-hard* (strongly: on such words), *para-NP-hard*: NP-hard |
| 38 | for one fixed value. |
| 39 | |
| 40 | **Running times.** An algorithm can be stated with its exact running time, a |
| 41 | function of the instance (of , , , the total weight, …): one |
| 42 | program halts, writing the answer for the instance and the threshold, within |
| 43 | instructions on the word of every instance , at every word length with , where is |
| 44 | the length of the word and its largest number — words of bits, as |
| 45 | on the word RAM of the literature. Deciding, approximating, approximating with |
| 46 | random bits and approximation schemes each have such a form; a submitted |
| 47 | algorithm is a program with a proof of one of them. Deciding can also be stated |
| 48 | without the constant: one program halts with the answer within exactly |
| 49 | instructions, a function of the instance and the threshold, at the same word lengths. |
| 50 | |
| 51 | **Randomized deciding.** The program reads, after the word, at most |
| 52 | random bits and halts within instructions on every choice of them. |
| 53 | With *bounded error* its answer is right for at least two thirds of the choices. |
| 54 | With *one-sided error* it never accepts a no-instance and accepts a yes-instance |
| 55 | for at least half of the choices. With *zero error* (Las Vegas) it is always |
| 56 | right and the bound holds for the number of instructions averaged |
| 57 | over the choices. Repetition turns any of these into error at times |
| 58 | the cost, so the constants and are not essential. |
| 59 | |
| 60 | **Approximation.** A ratio is a function of the instance into the reals. |
| 61 | A -approximation is a polynomial-time program that on the word of an |
| 62 | instance with a feasible schedule writes the word of a feasible schedule |
| 63 | costing at most times every feasible schedule; for a maximization |
| 64 | problem, whose cost is the negative of its value, the value is at least |
| 65 | times every value. A randomized one reads polynomially many random bits; every |
| 66 | choice gives a feasible schedule, the average cost is within the ratio, and |
| 67 | the running time is polynomial in the worst case or, for an expected-time |
| 68 | algorithm, on average over the bits. Approximations may be restricted to the |
| 69 | instances of a set. PTAS, EPTAS and FPTAS are as usual; inapproximability below |
| 70 | unless P = NP says that if P ≠ NP no -approximation exists for a |
| 71 | constant . An *additive* -approximation writes a feasible |
| 72 | schedule costing at most every feasible cost plus , a function of the |
| 73 | instance; an additive scheme does so with for every |
| 74 | , in polynomial time for each fixed . A |
| 75 | *parameterized approximation scheme* for a parameter is one program that |
| 76 | writes a -approximate schedule from the word of an instance followed |
| 77 | by , in time . |
| 78 | |
| 79 | **Running times and word size.** A running time, upper or lower, is stated with |
| 80 | short words, ; the classes keep the long words |
| 81 | of the registered notions and are reached from running times through the |
| 82 | transfer theorems. A lower bound is stated for the time plus the length of the |
| 83 | shortest word of the instance. |
| 84 | |
| 85 | **Wide words.** An algorithm whose running time exceeds every polynomial may |
| 86 | need words that hold the address of every step, besides |
| 87 | the short words above; this is the standard assumption for such algorithms, whose |
| 88 | tables are as large as their running times. Deciding within with wide words |
| 89 | asks the program to work only at those word lengths. |
| 90 | |
| 91 | **Restrictions.** A result may hold on the instances satisfying a predicate |
| 92 | only: it is then a result on the problem restricted to them, read with the |
| 93 | same words. |
| 94 | |
| 95 | **Kept weight.** A problem that minimizes the weight of the jobs it rejects |
| 96 | (late, or not just in time) is read with the same instances, schedules and |
| 97 | costs when a source maximizes the weight it keeps. The kept weight of a |
| 98 | schedule is the total weight of the instance minus its cost. A |
| 99 | -approximation of the kept weight, for , writes a feasible |
| 100 | schedule that keeps at least times the weight of every feasible |
| 101 | schedule; schemes keep times it. An online algorithm is |
| 102 | -competitive for the kept weight, , if every feasible schedule |
| 103 | keeps at most times what the algorithm keeps plus a constant, the |
| 104 | convention of the sources on throughput. |
| 105 | |
| 106 | **Kernels.** A kernelization for a parameter is a polynomial-time map on the |
| 107 | words of instances that keeps the answer and whose output has size (bit length) |
| 108 | and parameter at most for a computable ; a polynomial kernel has |
| 109 | polynomial. |
| 110 | |
| 111 | **The exponential time hypothesis.** A formula is written as the number of |
| 112 | variables followed, for every clause, by its length and its literals, the |
| 113 | literal of variable being if positive and if negative. ETH: for |
| 114 | some no program decides the satisfiability of formulas whose clauses have |
| 115 | three literals over variables below within |
| 116 | instructions, at the word lengths above. A function is if for every |
| 117 | rational , eventually . |
| 118 | |
| 119 | **Online.** A deterministic algorithm is -competitive if it is |
| 120 | non-anticipative for the revelation and, for some additive constant, its cost is |
| 121 | at most times every feasible cost plus that constant; a randomized one is |
| 122 | a finite distribution over non-anticipative algorithms. A lower bound |
| 123 | says that no algorithm is -competitive for . |
| 124 | -/ |
| 125 | |
| 126 | namespace Lax434175.Results |
| 127 | open Lax434175.Problems Lax434175.Kernels Lax434175.Assembly Lax434175.Parameters |
| 128 | open Lax434175.WordProblems Lax434175.Online |
| 129 | open Lax808846.Ram Lax759944.BinaryWordEncoding |
| 130 | open Lax496464.WH_A1_FptTime Lax496464.WH_A2_FptReductions Lax496464.WH_B4_Hierarchies |
| 131 | |
| 132 | /-- Parameterized problems on words. -/ |
| 133 | abbrev WP := Lax888481.ParameterizedComplexity.Problem |
| 134 | |
| 135 | /-- A reading of a problem: words of instances, schedules from words, and what |
| 136 | an online scheduler sees. -/ |
| 137 | structure PReading (P : Problem) where |
| 138 | /-- The word encodes the instance. -/ |
| 139 | Encodes : List ℕ → P.Inst → Prop |
| 140 | /-- The word writes the schedule of the instance. -/ |
| 141 | Decodes : (x : P.Inst) → List ℕ → P.Sched x → Prop |
| 142 | /-- What is revealed over time. -/ |
| 143 | reveal : Revelation P |
| 144 | |
| 145 | /-- A reading of a family. -/ |
| 146 | structure Reading {K : Kernel} (F : Family K) where |
| 147 | /-- The word encodes the instance. -/ |
| 148 | Encodes : (s : Spec F) → List ℕ → Inst F s → Prop |
| 149 | /-- The word writes the schedule of the instance. -/ |
| 150 | Decodes : (s : Spec F) → (x : Inst F s) → List ℕ → (problem F s).Sched x → Prop |
| 151 | /-- What is revealed over time. -/ |
| 152 | reveal : (s : Spec F) → Revelation (problem F s) |
| 153 | |
| 154 | /-- The reading of the problem of one specification. -/ |
| 155 | def Reading.at {K : Kernel} {F : Family K} (R : Reading F) (s : Spec F) : |
| 156 | PReading (problem F s) := |
| 157 | ⟨R.Encodes s, R.Decodes s, R.reveal s⟩ |
| 158 | |
| 159 | /-- The reading of a problem on the instances satisfying `φ`: the same words. -/ |
| 160 | def PReading.restrict {P : Problem} (R : PReading P) (φ : P.Inst → Prop) : |
| 161 | PReading (P.restrict φ) where |
| 162 | Encodes w x := R.Encodes w x.1 |
| 163 | Decodes x w σ := R.Decodes x.1 w σ |
| 164 | reveal := ⟨fun x y t => R.reveal.same x.1 y.1 t, fun x y σ τ t => R.reveal.agree x.1 y.1 σ τ t⟩ |
| 165 | |
| 166 | /-- A parameter of the decision version: a function of the instance and the |
| 167 | threshold. -/ |
| 168 | abbrev TParameter (P : Problem) := P.Inst → ℤ → ℕ |
| 169 | |
| 170 | /-- A parameter of the instance, ignoring the threshold. -/ |
| 171 | def lift {P : Problem} (κ : Parameter P) : TParameter P := fun x _ => κ x |
| 172 | |
| 173 | /-- The sum of two parameters. -/ |
| 174 | def tplus {P : Problem} (κ κ' : TParameter P) : TParameter P := fun x D => κ x D + κ' x D |
| 175 | |
| 176 | variable {P : Problem} (R : PReading P) |
| 177 | |
| 178 | -- Words |
| 179 | |
| 180 | /-- The largest number of a word. -/ |
| 181 | def maxEntry (w : List ℕ) : ℕ := w.foldr max 0 |
| 182 | |
| 183 | /-- The word presents the instance with the threshold. -/ |
| 184 | def EncodesDecision (w : List ℕ) (x : P.Inst) (D : ℤ) : Prop := |
| 185 | ∃ y, w = y ++ [if D < 0 then 1 else 0, D.natAbs] ∧ R.Encodes y x |
| 186 | |
| 187 | open Classical in |
| 188 | /-- The decision version with a parameter, as a parameterized problem on words. -/ |
| 189 | noncomputable def parameterized (κ : TParameter P) : WP where |
| 190 | Domain := {w | ∃ x D, EncodesDecision R w x D} |
| 191 | Yes w := ∃ x D, EncodesDecision R w x D ∧ P.Decides x D |
| 192 | param w := if h : ∃ x D, EncodesDecision R w x D then κ h.choose h.choose_spec.choose else 0 |
| 193 | |
| 194 | /-- The decision version on words. -/ |
| 195 | noncomputable def decision : WP := parameterized R fun _ => 0 |
| 196 | |
| 197 | open Classical in |
| 198 | /-- The answer of a word, `[1]` or `[0]`. -/ |
| 199 | noncomputable def answer (Q : WP) (w : List ℕ) : List ℕ := if Q.Yes w then [1] else [0] |
| 200 | |
| 201 | /-- The problem on fewer words. -/ |
| 202 | def restrict (Q : WP) (D : Set (List ℕ)) : WP where |
| 203 | Domain := Q.Domain ∩ D |
| 204 | Yes := Q.Yes |
| 205 | param := Q.param |
| 206 | |
| 207 | /-- The words whose numbers are polynomial in their length. -/ |
| 208 | def Small (c d : ℕ) : Set (List ℕ) := {w | ∀ v ∈ w, v ≤ c * (w.length + 1) ^ d} |
| 209 | |
| 210 | /-- The words of instances with parameter at most `k`. -/ |
| 211 | def Upto (κ : TParameter P) (k : ℕ) : Set (List ℕ) := |
| 212 | {w | ∃ x D, EncodesDecision R w x D ∧ κ x D ≤ k} |
| 213 | |
| 214 | -- Exact algorithms and hardness |
| 215 | |
| 216 | /-- Decided in polynomial time. -/ |
| 217 | def PolyDecides (Q : WP) : Prop := PolyTimeOn Q.Domain (answer Q) |
| 218 | |
| 219 | /-- Decided in pseudo-polynomial time. -/ |
| 220 | def PseudoPolyDecides (Q : WP) : Prop := |
| 221 | ∃ (p : Program) (c e d : ℕ), |
| 222 | ComputesInFptTime p Q.Domain maxEntry (answer Q) (fun k => c * (k + 1) ^ e) d |
| 223 | |
| 224 | /-- The problem is in P. -/ |
| 225 | def InP : Prop := PolyDecides (decision R) |
| 226 | |
| 227 | /-- The problem is solvable in pseudo-polynomial time. -/ |
| 228 | def PseudoPoly : Prop := PseudoPolyDecides (decision R) |
| 229 | |
| 230 | /-- The problem is NP-hard. -/ |
| 231 | def NPHard : Prop := Lax496464.WH_F3_NPHard.NPHardIn (decision R) |
| 232 | |
| 233 | /-- The problem is strongly NP-hard. -/ |
| 234 | def StronglyNPHard : Prop := |
| 235 | ∃ c d, Lax496464.WH_F3_NPHard.NPHardIn (restrict (decision R) (Small c d)) |
| 236 | |
| 237 | /-- In P for every fixed value of the parameter. -/ |
| 238 | def InPFixed (κ : TParameter P) : Prop := |
| 239 | ∀ k, PolyDecides (restrict (decision R) (Upto R κ k)) |
| 240 | |
| 241 | /-- Pseudo-polynomial for every fixed value of the parameter. -/ |
| 242 | def PseudoPolyFixed (κ : TParameter P) : Prop := |
| 243 | ∀ k, PseudoPolyDecides (restrict (decision R) (Upto R κ k)) |
| 244 | |
| 245 | /-- Fixed-parameter tractable. -/ |
| 246 | def IsFPT (κ : TParameter P) : Prop := parameterized R κ ∈ FPT |
| 247 | |
| 248 | /-- W[t]-hard. -/ |
| 249 | def WHard (t : ℕ) (κ : TParameter P) : Prop := Hard (W t) (parameterized R κ) |
| 250 | |
| 251 | /-- Strongly W[t]-hard: W[t]-hard on the words whose numbers are polynomial in |
| 252 | their length. -/ |
| 253 | def StronglyWHard (t : ℕ) (κ : TParameter P) : Prop := |
| 254 | ∃ c d, Hard (W t) (restrict (parameterized R κ) (Small c d)) |
| 255 | |
| 256 | /-- Para-NP-hard: NP-hard for one fixed value of the parameter. -/ |
| 257 | def ParaNPHard (κ : TParameter P) : Prop := |
| 258 | ∃ k, Lax496464.WH_F3_NPHard.NPHardIn (restrict (decision R) (Upto R κ k)) |
| 259 | |
| 260 | /-- Strongly NP-hard for one fixed value of the parameter. -/ |
| 261 | def StronglyParaNPHard (κ : TParameter P) : Prop := |
| 262 | ∃ k c d, Lax496464.WH_F3_NPHard.NPHardIn |
| 263 | (restrict (decision R) (Upto R κ k ∩ Small c d)) |
| 264 | |
| 265 | -- Approximation |
| 266 | |
| 267 | open Classical in |
| 268 | /-- The length of the shortest word of the instance, `0` if it has none. Lower |
| 269 | bounds on running times are stated for a time plus this length, so that they |
| 270 | cannot hold just because the input cannot be read. -/ |
| 271 | noncomputable def inputSize (x : P.Inst) : ℕ := sInf {k | ∃ w, R.Encodes w x ∧ w.length = k} |
| 272 | |
| 273 | /-- The instance has a feasible schedule. -/ |
| 274 | def Solvable (x : P.Inst) : Prop := ∃ τ, P.feasible x τ |
| 275 | |
| 276 | /-- `σ` is feasible and within the ratio of every feasible schedule. -/ |
| 277 | def Within (ρ : ℝ) (x : P.Inst) (σ : P.Sched x) : Prop := |
| 278 | P.feasible x σ ∧ ∀ τ, P.feasible x τ → (P.cost x σ : ℝ) ≤ ρ * P.cost x τ |
| 279 | |
| 280 | /-- For a maximization problem: `σ` is feasible and its value is at least `ρ` |
| 281 | times every value. -/ |
| 282 | def WithinMax (ρ : ℝ) (x : P.Inst) (σ : P.Sched x) : Prop := |
| 283 | P.feasible x σ ∧ ∀ τ, P.feasible x τ → ρ * (-(P.cost x τ : ℝ)) ≤ -(P.cost x σ : ℝ) |
| 284 | |
| 285 | /-- The output word, read on instance `x`, is a schedule within the ratio. -/ |
| 286 | def Good (ρ : P.Inst → ℝ) (x : P.Inst) (out : List ℕ) : Prop := |
| 287 | ∃ σ, R.Decodes x out σ ∧ Within (ρ x) x σ |
| 288 | |
| 289 | /-- The same for a maximization problem. -/ |
| 290 | def GoodMax (ρ : P.Inst → ℝ) (x : P.Inst) (out : List ℕ) : Prop := |
| 291 | ∃ σ, R.Decodes x out σ ∧ WithinMax (ρ x) x σ |
| 292 | |
| 293 | /-- All instances. -/ |
| 294 | def univ : Set P.Inst := Set.univ |
| 295 | |
| 296 | /-- A constant ratio. -/ |
| 297 | def const (ρ : ℝ) : P.Inst → ℝ := fun _ => ρ |
| 298 | |
| 299 | /-- A polynomial-time `ρ`-approximation on the instances of `S`. -/ |
| 300 | def ApproxOn (S : Set P.Inst) (ρ : P.Inst → ℝ) : Prop := |
| 301 | ∃ A : List ℕ → List ℕ, PolyTimeOn {w | ∃ x ∈ S, R.Encodes w x} A ∧ |
| 302 | ∀ w x, R.Encodes w x → x ∈ S → Solvable x → Good R ρ x (A w) |
| 303 | |
| 304 | /-- A polynomial-time `ρ`-approximation. -/ |
| 305 | def Approx (ρ : P.Inst → ℝ) : Prop := ApproxOn R univ ρ |
| 306 | |
| 307 | /-- A polynomial-time `ρ`-approximation for a maximization problem. -/ |
| 308 | def ApproxMax (ρ : P.Inst → ℝ) : Prop := |
| 309 | ∃ A : List ℕ → List ℕ, PolyTimeOn {w | ∃ x, R.Encodes w x} A ∧ |
| 310 | ∀ w x, R.Encodes w x → Solvable x → GoodMax R ρ x (A w) |
| 311 | |
| 312 | /-- A polynomial-time `ρ`-approximation for every fixed value of the parameter. -/ |
| 313 | def ApproxFixed (κ : Parameter P) (ρ : P.Inst → ℝ) : Prop := |
| 314 | ∀ k, ApproxOn R {x | κ x ≤ k} ρ |
| 315 | |
| 316 | /-- The random bits `r` as a word. -/ |
| 317 | def bits {L : ℕ} (r : Fin L → Bool) : List ℕ := List.ofFn fun i => if r i then 1 else 0 |
| 318 | |
| 319 | /-- Every choice of the random bits gives a feasible schedule, and the average |
| 320 | cost is within the ratio. -/ |
| 321 | def GoodOnAverage {L : ℕ} (ρ : ℝ) (x : P.Inst) (out : (Fin L → Bool) → List ℕ) : Prop := |
| 322 | ∃ σ : (Fin L → Bool) → P.Sched x, |
| 323 | (∀ r, R.Decodes x (out r) (σ r) ∧ P.feasible x (σ r)) ∧ |
| 324 | ∀ τ, P.feasible x τ → (∑ r, (P.cost x (σ r) : ℝ)) / 2 ^ L ≤ ρ * P.cost x τ |
| 325 | |
| 326 | /-- A randomized polynomial-time `ρ`-approximation: it reads `L(|w|)` random |
| 327 | bits, with `L` polynomial, and runs in polynomial time on every choice. -/ |
| 328 | def RandomApprox (ρ : P.Inst → ℝ) : Prop := |
| 329 | ∃ (A : List ℕ → List ℕ) (L : ℕ → ℕ) (c e : ℕ), (∀ n, L n ≤ c * (n + 1) ^ e) ∧ |
| 330 | PolyTimeOn {u | ∃ w x, R.Encodes w x ∧ ∃ r : Fin (L (bitSize w)) → Bool, u = w ++ bits r} A ∧ |
| 331 | ∀ w x, R.Encodes w x → Solvable x → |
| 332 | GoodOnAverage R (ρ x) x fun r : Fin (L (bitSize w)) → Bool => A (w ++ bits r) |
| 333 | |
| 334 | /-- The word lengths a program may use on input `u`: `c` times the logarithm of |
| 335 | the length plus the largest number. -/ |
| 336 | def WordOk (c : ℕ) (u : List ℕ) (ℓ : ℕ) : Prop := (u.length + maxEntry u + 2) ^ c ≤ 2 ^ ℓ |
| 337 | |
| 338 | /-- A randomized `ρ`-approximation in expected polynomial time: averaged over |
| 339 | the random bits, the number of instructions is at most `c (|w|+1)^c`. -/ |
| 340 | def RandomApproxExpected (ρ : P.Inst → ℝ) : Prop := |
| 341 | ∃ (p : Program) (c : ℕ) (L : ℕ → ℕ), (∀ n, L n ≤ c * (n + 1) ^ c) ∧ |
| 342 | ∀ w x, R.Encodes w x → Solvable x → |
| 343 | ∃ out : (Fin (L w.length) → Bool) → List ℕ, GoodOnAverage R (ρ x) x out ∧ |
| 344 | ∀ ℓ, (∀ r : Fin (L w.length) → Bool, WordOk c (w ++ bits r) ℓ) → |
| 345 | ∃ t : (Fin (L w.length) → Bool) → ℕ, |
| 346 | (∀ r, RunsTo ℓ p ((w ++ bits r).length :: (w ++ bits r)) (out r) (t r)) ∧ |
| 347 | (∑ r, (t r : ℝ)) / 2 ^ L w.length ≤ c * (w.length + 1 : ℝ) ^ c |
| 348 | |
| 349 | /-- A polynomial-time approximation scheme. -/ |
| 350 | def PTAS : Prop := ∀ ε : ℚ, 0 < ε → Approx R (const (1 + ε)) |
| 351 | |
| 352 | /-- A PTAS for a maximization problem: value at least `1 - ε` times every |
| 353 | value. -/ |
| 354 | def PTASMax : Prop := ∀ ε : ℚ, 0 < ε → ε < 1 → ApproxMax R (const (1 - ε)) |
| 355 | |
| 356 | /-- A PTAS for every fixed value of the parameter. -/ |
| 357 | def PTASFixed (κ : Parameter P) : Prop := |
| 358 | ∀ k (ε : ℚ), 0 < ε → ApproxOn R {x | κ x ≤ k} (const (1 + ε)) |
| 359 | |
| 360 | /-- The words of instances followed by a precision `a / b`. -/ |
| 361 | def WordsEps : Set (List ℕ) := |
| 362 | {u | ∃ w x, R.Encodes w x ∧ ∃ a b, 0 < a ∧ 0 < b ∧ u = w ++ [a, b]} |
| 363 | |
| 364 | /-- One program writes a `(1 + a / b)`-approximate schedule from the word of an |
| 365 | instance followed by `a, b`. -/ |
| 366 | def Scheme (A : List ℕ → List ℕ) : Prop := |
| 367 | ∀ w x (a b : ℕ), R.Encodes w x → 0 < a → 0 < b → Solvable x → |
| 368 | Good R (const (1 + (a : ℝ) / b)) x (A (w ++ [a, b])) |
| 369 | |
| 370 | /-- An efficient PTAS: time `f(b/a) · (|w|+1)^d`. -/ |
| 371 | def EPTAS : Prop := |
| 372 | ∃ A, Scheme R A ∧ FptTimeOn (WordsEps R) (fun u => u.getLastD 0 / u.dropLast.getLastD 1 + 1) A |
| 373 | |
| 374 | /-- A fully polynomial-time approximation scheme: time polynomial in `|w|` and |
| 375 | `b/a`. -/ |
| 376 | def FPTAS : Prop := |
| 377 | ∃ A, Scheme R A ∧ ∃ (p : Program) (c e d : ℕ), ComputesInFptTime p (WordsEps R) |
| 378 | (fun u => u.getLastD 0 / u.dropLast.getLastD 1 + 1) A (fun k => c * (k + 1) ^ e) d |
| 379 | |
| 380 | /-- P ≠ NP. -/ |
| 381 | def PneNP : Prop := |
| 382 | Lax434930.PolynomialTime.P ≠ Lax434930.NondeterministicPolynomialTime.NP |
| 383 | |
| 384 | /-- No `ρ'`-approximation for a constant `ρ' < ρ` on the instances of `S`, |
| 385 | unless P = NP. -/ |
| 386 | def NoApproxBelowOn (S : Set P.Inst) (ρ : ℝ) : Prop := |
| 387 | PneNP → ∀ ρ' : ℝ, ρ' < ρ → ¬ ApproxOn R S (const ρ') |
| 388 | |
| 389 | /-- No `ρ'`-approximation for a constant `ρ' < ρ`, unless P = NP. -/ |
| 390 | def NoApproxBelow (ρ : ℝ) : Prop := NoApproxBelowOn R univ ρ |
| 391 | |
| 392 | /-- No PTAS unless P = NP (the consequence of APX-hardness). -/ |
| 393 | def NoPTAS : Prop := PneNP → ¬ PTAS R |
| 394 | |
| 395 | /-- `σ` is feasible and costs at most every feasible cost plus `δ`. -/ |
| 396 | def WithinAdd (δ : ℝ) (x : P.Inst) (σ : P.Sched x) : Prop := |
| 397 | P.feasible x σ ∧ ∀ τ, P.feasible x τ → (P.cost x σ : ℝ) ≤ P.cost x τ + δ |
| 398 | |
| 399 | /-- The output word, read on instance `x`, is a schedule within the additive error. -/ |
| 400 | def GoodAdd (δ : P.Inst → ℝ) (x : P.Inst) (out : List ℕ) : Prop := |
| 401 | ∃ σ, R.Decodes x out σ ∧ WithinAdd (δ x) x σ |
| 402 | |
| 403 | /-- A polynomial-time approximation with additive error `δ`. -/ |
| 404 | def ApproxAdd (δ : P.Inst → ℝ) : Prop := |
| 405 | ∃ A : List ℕ → List ℕ, PolyTimeOn {w | ∃ x, R.Encodes w x} A ∧ |
| 406 | ∀ w x, R.Encodes w x → Solvable x → GoodAdd R δ x (A w) |
| 407 | |
| 408 | /-- An additive approximation scheme: additive error `ε δ` for every `ε > 0`, in polynomial |
| 409 | time for each fixed `ε`. -/ |
| 410 | def AddScheme (δ : P.Inst → ℝ) : Prop := ∀ ε : ℚ, 0 < ε → ApproxAdd R fun x => (ε : ℝ) * δ x |
| 411 | |
| 412 | open Classical in |
| 413 | /-- The parameter of the instance a word followed by a precision writes, plus the inverse |
| 414 | precision `b / a`. -/ |
| 415 | noncomputable def paramEps (κ : Parameter P) (u : List ℕ) : ℕ := |
| 416 | (if h : ∃ x, R.Encodes (u.dropLast.dropLast) x then κ h.choose else 0) + |
| 417 | u.getLastD 0 / u.dropLast.getLastD 1 + 1 |
| 418 | |
| 419 | /-- A parameterized approximation scheme: time `f(κ + b/a) · (|w|+1)^d`. -/ |
| 420 | def ParamScheme (κ : Parameter P) : Prop := |
| 421 | ∃ A, Scheme R A ∧ FptTimeOn (WordsEps R) (paramEps R κ) A |
| 422 | |
| 423 | /-- A kernelization: a polynomial-time map on the words of instances with a threshold that |
| 424 | keeps the answer and the words, and whose output has size and parameter at most `g κ`. -/ |
| 425 | def KernelWithin (κ : TParameter P) (g : ℕ → ℕ) : Prop := |
| 426 | ∃ K : List ℕ → List ℕ, PolyTimeOn (parameterized R κ).Domain K ∧ |
| 427 | ∀ w ∈ (parameterized R κ).Domain, K w ∈ (parameterized R κ).Domain ∧ |
| 428 | ((parameterized R κ).Yes w ↔ (parameterized R κ).Yes (K w)) ∧ |
| 429 | bitSize (K w) ≤ g ((parameterized R κ).param w) ∧ |
| 430 | (parameterized R κ).param (K w) ≤ g ((parameterized R κ).param w) |
| 431 | |
| 432 | /-- A kernel: a kernelization for a computable `g`. -/ |
| 433 | def HasKernel (κ : TParameter P) : Prop := ∃ g, Computable g ∧ KernelWithin R κ g |
| 434 | |
| 435 | /-- A polynomial kernel: a kernelization with `g` polynomial. -/ |
| 436 | def PolyKernel (κ : TParameter P) : Prop := ∃ c d : ℕ, KernelWithin R κ fun k => c * (k + 1) ^ d |
| 437 | |
| 438 | -- Kept weight |
| 439 | |
| 440 | /-- `σ` is feasible and keeps at least `ρ` times the weight every feasible |
| 441 | schedule keeps, the kept weight being the total weight minus the cost. -/ |
| 442 | def WithinKept (total : Parameter P) (ρ : ℝ) (x : P.Inst) (σ : P.Sched x) : Prop := |
| 443 | P.feasible x σ ∧ ∀ τ, P.feasible x τ → |
| 444 | ρ * ((total x : ℝ) - P.cost x τ) ≤ (total x : ℝ) - P.cost x σ |
| 445 | |
| 446 | /-- The output word, read on instance `x`, is a schedule within the ratio of |
| 447 | the kept weight. -/ |
| 448 | def GoodKept (total : Parameter P) (ρ : P.Inst → ℝ) (x : P.Inst) (out : List ℕ) : Prop := |
| 449 | ∃ σ, R.Decodes x out σ ∧ WithinKept total (ρ x) x σ |
| 450 | |
| 451 | /-- A polynomial-time `ρ`-approximation of the kept weight, `ρ ≤ 1`. -/ |
| 452 | def ApproxKept (total : Parameter P) (ρ : P.Inst → ℝ) : Prop := |
| 453 | ∃ A : List ℕ → List ℕ, PolyTimeOn {w | ∃ x, R.Encodes w x} A ∧ |
| 454 | ∀ w x, R.Encodes w x → Solvable x → GoodKept R total ρ x (A w) |
| 455 | |
| 456 | /-- One program keeps `1 - a / b` times the optimal kept weight, from the word |
| 457 | of an instance followed by `a, b` with `a < b`. -/ |
| 458 | def SchemeKept (total : Parameter P) (A : List ℕ → List ℕ) : Prop := |
| 459 | ∀ w x (a b : ℕ), R.Encodes w x → 0 < a → a < b → Solvable x → |
| 460 | GoodKept R total (const (1 - (a : ℝ) / b)) x (A (w ++ [a, b])) |
| 461 | |
| 462 | /-- A PTAS for the kept weight. -/ |
| 463 | def PTASKept (total : Parameter P) : Prop := |
| 464 | ∀ ε : ℚ, 0 < ε → ε < 1 → ApproxKept R total (const (1 - ε)) |
| 465 | |
| 466 | /-- An efficient PTAS for the kept weight: time `f(b/a) · (|w|+1)^d`. -/ |
| 467 | def EPTASKept (total : Parameter P) : Prop := |
| 468 | ∃ A, SchemeKept R total A ∧ |
| 469 | FptTimeOn (WordsEps R) (fun u => u.getLastD 0 / u.dropLast.getLastD 1 + 1) A |
| 470 | |
| 471 | /-- An FPTAS for the kept weight: time polynomial in `|w|` and `b/a`. -/ |
| 472 | def FPTASKept (total : Parameter P) : Prop := |
| 473 | ∃ A, SchemeKept R total A ∧ ∃ (p : Program) (c e d : ℕ), ComputesInFptTime p (WordsEps R) |
| 474 | (fun u => u.getLastD 0 / u.dropLast.getLastD 1 + 1) A (fun k => c * (k + 1) ^ e) d |
| 475 | |
| 476 | /-- A parameterized approximation scheme for the kept weight. -/ |
| 477 | def ParamSchemeKept (total : Parameter P) (κ : Parameter P) : Prop := |
| 478 | ∃ A, SchemeKept R total A ∧ FptTimeOn (WordsEps R) (paramEps R κ) A |
| 479 | |
| 480 | /-- No `ρ'`-approximation of the kept weight for a constant `ρ' > ρ`, unless |
| 481 | P = NP. -/ |
| 482 | def NoApproxKeptAbove (total : Parameter P) (ρ : ℝ) : Prop := |
| 483 | PneNP → ∀ ρ' : ℝ, ρ < ρ' → ¬ ApproxKept R total (const ρ') |
| 484 | |
| 485 | -- Running times |
| 486 | |
| 487 | open Classical in |
| 488 | /-- The answer for an instance and a threshold: `[1]` if some feasible schedule |
| 489 | costs at most the threshold, `[0]` otherwise. -/ |
| 490 | noncomputable def verdict (x : P.Inst) (D : ℤ) : List ℕ := if P.Decides x D then [1] else [0] |
| 491 | |
| 492 | /-- One program decides the decision version within `O(T(x))` instructions: on |
| 493 | every word of an instance `x` with a threshold `D` it writes the answer for `x` |
| 494 | and `D`. -/ |
| 495 | def DecidesWithin (T : P.Inst → ℕ) : Prop := |
| 496 | ∃ (p : Program) (c : ℕ), ∀ u x D, EncodesDecision R u x D → |
| 497 | ∀ ℓ, WordOk c u ℓ → ∃ t ≤ c * (T x + 1), |
| 498 | RunsTo ℓ p (u.length :: u) (verdict x D) t |
| 499 | |
| 500 | /-- One program decides the decision version within `T x D` instructions, with no |
| 501 | hidden constant: on every word of an instance `x` with a threshold `D` it writes the |
| 502 | answer within `T x D` steps of the word RAM. -/ |
| 503 | def DecidesExact (T : P.Inst → ℤ → ℕ) : Prop := |
| 504 | ∃ (p : Program) (c : ℕ), ∀ u x D, EncodesDecision R u x D → |
| 505 | ∀ ℓ, WordOk c u ℓ → ∃ t ≤ T x D, RunsTo ℓ p (u.length :: u) (verdict x D) t |
| 506 | |
| 507 | /-- One program decides the decision version within `O(T(x))` instructions with wide |
| 508 | words: on every word of an instance `x` with a threshold `D`, at every word length `ℓ` with |
| 509 | `WordOk c u ℓ` and `c (T(x) + 1) ≤ 2 ^ ℓ`, it writes the answer for `x` and `D` within |
| 510 | `c (T(x) + 1)` instructions. This is the standard assumption for algorithms whose running |
| 511 | time exceeds a polynomial: a word holds the address of every step. -/ |
| 512 | def DecidesWithinWide (T : P.Inst → ℕ) : Prop := |
| 513 | ∃ (p : Program) (c : ℕ), ∀ u x D, EncodesDecision R u x D → |
| 514 | ∀ ℓ, WordOk c u ℓ → c * (T x + 1) ≤ 2 ^ ℓ → ∃ t ≤ c * (T x + 1), |
| 515 | RunsTo ℓ p (u.length :: u) (verdict x D) t |
| 516 | |
| 517 | open Classical in |
| 518 | /-- The choices of `L` random bits for which `out` writes the answer for `x` and `D`. -/ |
| 519 | noncomputable def rightChoices {L : ℕ} (x : P.Inst) (D : ℤ) (out : (Fin L → Bool) → List ℕ) : ℕ := |
| 520 | (Finset.univ.filter fun r => out r = verdict x D).card |
| 521 | |
| 522 | /-- A randomized program decides the decision version with bounded error within |
| 523 | `O(T(x))` instructions: on the word of an instance `x` with a threshold `D` |
| 524 | followed by at most `O(T(x))` random bits, it halts within `O(T(x))` |
| 525 | instructions on every choice, and writes the answer for at least two thirds of |
| 526 | the choices. -/ |
| 527 | def RandomDecidesWithin (T : P.Inst → ℕ) : Prop := |
| 528 | ∃ (p : Program) (c : ℕ) (L : ℕ → ℕ), ∀ u x D, EncodesDecision R u x D → |
| 529 | L u.length ≤ c * (T x + 1) ∧ |
| 530 | ∃ out : (Fin (L u.length) → Bool) → List ℕ, |
| 531 | 2 * 2 ^ L u.length ≤ 3 * rightChoices x D out ∧ |
| 532 | ∀ r ℓ, WordOk c (u ++ bits r) ℓ → ∃ t ≤ c * (T x + 1), |
| 533 | RunsTo ℓ p ((u ++ bits r).length :: (u ++ bits r)) (out r) t |
| 534 | |
| 535 | /-- The same with one-sided error: a no-instance is never accepted, and a |
| 536 | yes-instance is accepted for at least half of the choices. -/ |
| 537 | def OneSidedDecidesWithin (T : P.Inst → ℕ) : Prop := |
| 538 | ∃ (p : Program) (c : ℕ) (L : ℕ → ℕ), ∀ u x D, EncodesDecision R u x D → |
| 539 | L u.length ≤ c * (T x + 1) ∧ |
| 540 | ∃ out : (Fin (L u.length) → Bool) → List ℕ, |
| 541 | (∀ r, out r = verdict x D ∨ out r = [0]) ∧ |
| 542 | 2 ^ L u.length ≤ 2 * rightChoices x D out ∧ |
| 543 | ∀ r ℓ, WordOk c (u ++ bits r) ℓ → ∃ t ≤ c * (T x + 1), |
| 544 | RunsTo ℓ p ((u ++ bits r).length :: (u ++ bits r)) (out r) t |
| 545 | |
| 546 | /-- The same with zero error (Las Vegas): the answer is always right, and the |
| 547 | number of instructions, averaged over the choices, is `O(T(x))`. -/ |
| 548 | def ZeroErrorDecidesWithin (T : P.Inst → ℕ) : Prop := |
| 549 | ∃ (p : Program) (c : ℕ) (L : ℕ → ℕ), ∀ u x D, EncodesDecision R u x D → |
| 550 | L u.length ≤ c * (T x + 1) ∧ |
| 551 | ∀ ℓ, (∀ r : Fin (L u.length) → Bool, WordOk c (u ++ bits r) ℓ) → |
| 552 | ∃ t : (Fin (L u.length) → Bool) → ℕ, |
| 553 | (∀ r, RunsTo ℓ p ((u ++ bits r).length :: (u ++ bits r)) (verdict x D) (t r)) ∧ |
| 554 | (∑ r, (t r : ℝ)) / 2 ^ L u.length ≤ c * ((T x : ℝ) + 1) |
| 555 | |
| 556 | /-- A `ρ`-approximation running within `O(T(x))` instructions. -/ |
| 557 | def ApproxWithin (ρ : P.Inst → ℝ) (T : P.Inst → ℕ) : Prop := |
| 558 | ∃ (p : Program) (c : ℕ), ∀ u x, R.Encodes u x → Solvable x → |
| 559 | ∀ ℓ, WordOk c u ℓ → ∃ out, ∃ t ≤ c * (T x + 1), |
| 560 | RunsTo ℓ p (u.length :: u) out t ∧ Good R ρ x out |
| 561 | |
| 562 | /-- A randomized `ρ`-approximation running within `O(T(x))` instructions on |
| 563 | every choice of random bits and reading at most that many. -/ |
| 564 | def RandomApproxWithin (ρ : P.Inst → ℝ) (T : P.Inst → ℕ) : Prop := |
| 565 | ∃ (p : Program) (c : ℕ) (L : ℕ → ℕ), ∀ u x, R.Encodes u x → Solvable x → |
| 566 | L u.length ≤ c * (T x + 1) ∧ |
| 567 | ∃ out : (Fin (L u.length) → Bool) → List ℕ, GoodOnAverage R (ρ x) x out ∧ |
| 568 | ∀ r ℓ, WordOk c (u ++ bits r) ℓ → ∃ t ≤ c * (T x + 1), |
| 569 | RunsTo ℓ p ((u ++ bits r).length :: (u ++ bits r)) (out r) t |
| 570 | |
| 571 | /-- An approximation scheme: one program reads the word of an instance and `a, b` |
| 572 | and writes a `(1 + a/b)`-approximate schedule within `O(T(a/b, x))` |
| 573 | instructions. -/ |
| 574 | def SchemeWithin (T : ℚ → P.Inst → ℕ) : Prop := |
| 575 | ∃ (p : Program) (c : ℕ), ∀ u x (a b : ℕ), R.Encodes u x → 0 < a → 0 < b → |
| 576 | Solvable x → ∀ ℓ, WordOk c (u ++ [a, b]) ℓ → ∃ out, ∃ t ≤ c * (T ((a : ℚ) / b) x + 1), |
| 577 | RunsTo ℓ p ((u ++ [a, b]).length :: (u ++ [a, b])) out t ∧ |
| 578 | Good R (const (1 + (a : ℝ) / b)) x out |
| 579 | |
| 580 | /-- The same for a maximization problem: value at least `1 - a/b` times every |
| 581 | value, for `a < b`. -/ |
| 582 | def SchemeMaxWithin (T : ℚ → P.Inst → ℕ) : Prop := |
| 583 | ∃ (p : Program) (c : ℕ), ∀ u x (a b : ℕ), R.Encodes u x → 0 < a → a < b → |
| 584 | Solvable x → ∀ ℓ, WordOk c (u ++ [a, b]) ℓ → ∃ out, ∃ t ≤ c * (T ((a : ℚ) / b) x + 1), |
| 585 | RunsTo ℓ p ((u ++ [a, b]).length :: (u ++ [a, b])) out t ∧ |
| 586 | GoodMax R (const (1 - (a : ℝ) / b)) x out |
| 587 | |
| 588 | -- The exponential time hypothesis |
| 589 | |
| 590 | /-- The word of a formula on `n` variables. -/ |
| 591 | def formulaWord (n : ℕ) (Φ : Lax429075.CNF.Formula) : List ℕ := |
| 592 | n :: Φ.flatMap fun C => C.length :: C.map fun l => 2 * l.index + if l.positive then 1 else 0 |
| 593 | |
| 594 | open Classical in |
| 595 | /-- The exponential time hypothesis: for some `q > 0`, no program decides 3-SAT |
| 596 | on `n` variables within `c · 2^⌊n/q⌋ · (|w|+1)^c` instructions. -/ |
| 597 | def ETH : Prop := |
| 598 | ∃ q : ℕ, 0 < q ∧ ∀ (p : Program) (c : ℕ), ¬ ∀ (n : ℕ) (Φ : Lax429075.CNF.Formula), |
| 599 | (∀ C ∈ Φ, C.length = 3 ∧ ∀ l ∈ C, l.index < n) → |
| 600 | ∀ ℓ, WordOk c (formulaWord n Φ) ℓ → |
| 601 | ∃ t ≤ c * 2 ^ (n / q) * ((formulaWord n Φ).length + 1) ^ c, |
| 602 | RunsTo ℓ p ((formulaWord n Φ).length :: formulaWord n Φ) |
| 603 | (if Lax429075.CNF.Satisfiable Φ then [1] else [0]) t |
| 604 | |
| 605 | /-- `f` is `o(g)`. -/ |
| 606 | def LittleO (f g : ℕ → ℕ) : Prop := |
| 607 | ∀ ε : ℚ, 0 < ε → ∃ N, ∀ k ≥ N, (f k : ℚ) ≤ ε * g k |
| 608 | |
| 609 | -- Online |
| 610 | |
| 611 | /-- A deterministic algorithm with ratio `ρ` and additive constant `α`, over the |
| 612 | reals. -/ |
| 613 | def CompetitiveR (A : Algorithm P) (ρ : P.Inst → ℝ) (α : ℝ) : Prop := |
| 614 | ∀ x, P.feasible x (A x) ∧ ∀ τ, P.feasible x τ → |
| 615 | (P.cost x (A x) : ℝ) ≤ ρ x * P.cost x τ + α |
| 616 | |
| 617 | /-- Some non-anticipative deterministic algorithm is `ρ`-competitive. -/ |
| 618 | def DetCompetitive (ρ : P.Inst → ℝ) : Prop := |
| 619 | ∃ A α, NonAnticipative R.reveal A ∧ CompetitiveR A ρ α |
| 620 | |
| 621 | /-- A distribution over non-anticipative algorithms is `ρ`-competitive. -/ |
| 622 | def RandCompetitive (ρ : P.Inst → ℝ) : Prop := |
| 623 | ∃ (μ : Randomized R.reveal) (α : ℝ), ∀ x, |
| 624 | (∀ a ∈ μ.algorithms, P.feasible x (a.2 x)) ∧ |
| 625 | ∀ τ, P.feasible x τ → (μ.cost x : ℝ) ≤ ρ x * P.cost x τ + α |
| 626 | |
| 627 | /-- No deterministic algorithm is `ρ'`-competitive for a constant `ρ' < ρ`. -/ |
| 628 | def DetLowerBound (ρ : ℝ) : Prop := ∀ ρ' < ρ, ¬ DetCompetitive R (const ρ') |
| 629 | |
| 630 | /-- No randomized algorithm is `ρ'`-competitive for a constant `ρ' < ρ`. -/ |
| 631 | def RandLowerBound (ρ : ℝ) : Prop := ∀ ρ' < ρ, ¬ RandCompetitive R (const ρ') |
| 632 | |
| 633 | /-- For some `c > 0`, no deterministic algorithm is `c f`-competitive. -/ |
| 634 | def DetLowerBoundFn (f : P.Inst → ℝ) : Prop := |
| 635 | ∃ c : ℝ, 0 < c ∧ ¬ DetCompetitive R fun x => c * f x |
| 636 | |
| 637 | /-- For some `c > 0`, no randomized algorithm is `c f`-competitive. -/ |
| 638 | def RandLowerBoundFn (f : P.Inst → ℝ) : Prop := |
| 639 | ∃ c : ℝ, 0 < c ∧ ¬ RandCompetitive R fun x => c * f x |
| 640 | |
| 641 | -- Online, kept weight |
| 642 | |
| 643 | /-- A deterministic algorithm with ratio `ρ ≥ 1` and additive constant `α` for |
| 644 | the kept weight: every feasible schedule keeps at most `ρ` times what the |
| 645 | algorithm keeps, plus `α`. -/ |
| 646 | def CompetitiveKeptR (total : Parameter P) (A : Algorithm P) (ρ : P.Inst → ℝ) (α : ℝ) : Prop := |
| 647 | ∀ x, P.feasible x (A x) ∧ ∀ τ, P.feasible x τ → |
| 648 | (total x : ℝ) - P.cost x τ ≤ ρ x * ((total x : ℝ) - P.cost x (A x)) + α |
| 649 | |
| 650 | /-- Some non-anticipative deterministic algorithm is `ρ`-competitive for the |
| 651 | kept weight. -/ |
| 652 | def DetCompetitiveKept (total : Parameter P) (ρ : P.Inst → ℝ) : Prop := |
| 653 | ∃ A α, NonAnticipative R.reveal A ∧ CompetitiveKeptR total A ρ α |
| 654 | |
| 655 | /-- A distribution over non-anticipative algorithms is `ρ`-competitive for the |
| 656 | kept weight, in expectation. -/ |
| 657 | def RandCompetitiveKept (total : Parameter P) (ρ : P.Inst → ℝ) : Prop := |
| 658 | ∃ (μ : Randomized R.reveal) (α : ℝ), ∀ x, |
| 659 | (∀ a ∈ μ.algorithms, P.feasible x (a.2 x)) ∧ |
| 660 | ∀ τ, P.feasible x τ → (total x : ℝ) - P.cost x τ ≤ ρ x * ((total x : ℝ) - μ.cost x) + α |
| 661 | |
| 662 | /-- No deterministic algorithm is `ρ'`-competitive for the kept weight, for a |
| 663 | constant `ρ' < ρ`. -/ |
| 664 | def DetLowerBoundKept (total : Parameter P) (ρ : ℝ) : Prop := |
| 665 | ∀ ρ' < ρ, ¬ DetCompetitiveKept R total (const ρ') |
| 666 | |
| 667 | /-- No randomized algorithm is `ρ'`-competitive for the kept weight, for a |
| 668 | constant `ρ' < ρ`. -/ |
| 669 | def RandLowerBoundKept (total : Parameter P) (ρ : ℝ) : Prop := |
| 670 | ∀ ρ' < ρ, ¬ RandCompetitiveKept R total (const ρ') |
| 671 | |
| 672 | /-- For some `c > 0`, no deterministic algorithm is `c f`-competitive for the |
| 673 | kept weight. -/ |
| 674 | def DetLowerBoundFnKept (total : Parameter P) (f : P.Inst → ℝ) : Prop := |
| 675 | ∃ c : ℝ, 0 < c ∧ ¬ DetCompetitiveKept R total fun x => c * f x |
| 676 | |
| 677 | /-- For some `c > 0`, no randomized algorithm is `c f`-competitive for the kept |
| 678 | weight. -/ |
| 679 | def RandLowerBoundFnKept (total : Parameter P) (f : P.Inst → ℝ) : Prop := |
| 680 | ∃ c : ℝ, 0 < c ∧ ¬ RandCompetitiveKept R total fun x => c * f x |
| 681 | |
| 682 | end Lax434175.Results |
| 683 |
Builds on
Used by
Lax434175.BoundedLax434175.FineGrainedLax434175.IsemStandardLax434175.ResultParametersLax434175.ResultTransferLax434175.StandardReadingLax434175.StrongHardnessLax434175.ZooOpenLax434175.ZooOpenParamsLax434175.ZooParallelBatchingResultsLax434175.ZooParallelResultsLax434175.ZooPreemptiveResultsLax434175.ZooPreemptiveShopsResultsLax434175.ZooRestartsResultsLax434175.ZooSerialBatchingResultsLax434175.ZooShopsResultsLax434175.ZooStandaloneResults
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments