Job sequencing with deadlines and profits
AbbreviationJob-sequencing instances#✓fully proved
An instance of job sequencing with deadlines, processing times and profits is a pair \((J, K)\) of a finite list \(J\) of jobs, each a triple \((p, d, w)\) of natural numbers giving its processing time \(p\), deadline \(d\) and profit \(w\), and a natural number \(K\), the profit bound.
abbrev JobSequencingWithProcessingTimesInstance := List (ℕ × ℕ × ℕ) × ℕ
DefinitionFeasible job-sequencing instances#✓fully proved
Let \((J, K)\) be a job-sequencing instance with jobs \(J = (p_0, d_0, w_0), \dots, (p_{n-1}, d_{n-1}, w_{n-1})\). The instance is feasible when there are distinct indices \(j_1, \dots, j_m < n\), for some \(m \ge 0\), such that \(w_{j_1} + \dots + w_{j_m} \ge K\) and, for every \(t\) with \(1 \le t \le m\), \(p_{j_1} + \dots + p_{j_t} \le d_{j_t}\): the selected jobs, run one after another in this order from time \(0\), each finish by their deadlines, and their total profit is at least \(K\).
def JobSequencingWithProcessingTimesFeasible
(i : JobSequencingWithProcessingTimesInstance) : Prop :=
∃ order : List ℕ, order.Nodup ∧ (∀ j ∈ order, j < i.1.length) ∧
i.2 ≤ (order.map (fun j => (i.1.getD j (0, 0, 0)).2.2)).sum ∧
∀ t < order.length,
((order.take (t + 1)).map (fun j => (i.1.getD j (0, 0, 0)).1)).sum ≤
(i.1.getD (order.getD t 0) (0, 0, 0)).2.1
abbrev JobSequencingWithProcessingTimesInstance := List (ℕ × ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/JobSequencingWithProcessingTimesWanted.lean:47
Uses 1 · Used by 1
DefinitionJob sequencing with deadlines, processing times and profits as a decision problem#✓fully proved
This decision problem accepts a bitstring \(x\) exactly when \(x\) decodes, under the canonical bitstring encoding, to a job-sequencing instance that is feasible; bitstrings that do not decode to an instance are rejected.
noncomputable def jobSequencingWithProcessingTimesDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := JobSequencingWithProcessingTimesInstance) x with
| some i => decide (JobSequencingWithProcessingTimesFeasible i)
| none => false
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def bitDecode [BitstringEncoding α] (l : List Bool) : Option α := toEncoding.decode l
MathlibExt/Computability/Complexity.lean:58
abbrev JobSequencingWithProcessingTimesInstance := List (ℕ × ℕ × ℕ) × ℕ
WantedExt/Complexity/NPComplete/JobSequencingWithProcessingTimesWanted.lean:47
def JobSequencingWithProcessingTimesFeasible
(i : JobSequencingWithProcessingTimesInstance) : Prop :=
∃ order : List ℕ, order.Nodup ∧ (∀ j ∈ order, j < i.1.length) ∧
i.2 ≤ (order.map (fun j => (i.1.getD j (0, 0, 0)).2.2)).sum ∧
∀ t < order.length,
((order.take (t + 1)).map (fun j => (i.1.getD j (0, 0, 0)).1)).sum ≤
(i.1.getD (order.getD t 0) (0, 0, 0)).2.1
WantedExt/Complexity/NPComplete/JobSequencingWithProcessingTimesWanted.lean:50
Uses 11 · Used by 1
TheoremJOB SEQUENCING WITH DEADLINES, PROCESSING TIMES, AND PROFITS is NP-complete#●ready to prove
The decision problem of job sequencing with deadlines, processing times and profits on bitstrings is NP-complete: it belongs to NP, and every decision problem in NP has a polynomial-time many-one reduction to it.
public theorem_wanted jobSequencingWithProcessingTimes_npComplete :
jobSequencingWithProcessingTimesDec ∈ MetaMathlibExt.ComplexityTheory.NP ∧
∀ L : MetaMathlibExt.ComplexityTheory.DecisionProblem,
L ∈ MetaMathlibExt.ComplexityTheory.NP →
Cslib.CookLevin.PolyManyOneRed L jobSequencingWithProcessingTimesDec
noncomputable def jobSequencingWithProcessingTimesDec :
MetaMathlibExt.ComplexityTheory.DecisionProblem := fun x =>
match MetaMathlibExt.BitstringEncoding.bitDecode
(α := JobSequencingWithProcessingTimesInstance) x with
| some i => decide (JobSequencingWithProcessingTimesFeasible i)
| none => false
WantedExt/Complexity/NPComplete/JobSequencingWithProcessingTimesWanted.lean:61
def NP : DecisionComplexityClass :=
{ L | ∃ (p : Polynomial ℕ), ∃ R : (List Bool × List Bool) → Bool,
IsPolyTime R ∧
∀ x, L x ↔ ∃ w : List Bool, w.length ≤ p.eval x.length ∧ R (x, w) }
MathlibExt/Computability/Complexity.lean:200
abbrev DecisionProblem := List Bool → Bool
MathlibExt/Computability/Complexity.lean:170
def PolyManyOneRed (L₁ L₂ : MetaMathlibExt.ComplexityTheory.DecisionProblem) : Prop :=
∃ reduce : List Bool → List Bool,
MetaMathlibExt.ComplexityTheory.IsPolyTime reduce ∧ ∀ x, L₁ x = L₂ (reduce x)
CSLibExt/Computability/CookLevin.lean:396
Sources
- M. R. Garey and D. S. Johnson, Computers and Intractability (1979), SEQUENCING WITH DEADLINES AND PROFITS (arbitrary processing times); R. M. Karp, "Reducibility among combinatorial problems" (1972).
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.