Maximizing the minimum machine load
Lax434175.MachineCovering · concepts/Lax434175/MachineCovering.lean · lax-434175
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The problem . An instance has jobs with processing times and identical machines. A solution assigns every job to a machine. The load of a machine is the sum of the processing times of its jobs, and the goal is to maximize the smallest load.
As a minimization problem, the cost of an assignment is the negative of the smallest load; without machines it is .
Concept map
Lean source view on GitHub
| 1 | import Mathlib.Algebra.BigOperators.Group.Finset.Basic |
| 2 | import Mathlib.Data.Finset.Lattice.Fold |
| 3 | import Mathlib.Data.Fintype.BigOperators |
| 4 | import Lax434175.Problems |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: Maximizing the minimum machine load |
| 9 | type: definition |
| 10 | --- |
| 11 | The problem . An instance has jobs with processing |
| 12 | times and identical machines. A solution assigns every job to a |
| 13 | machine. The load of a machine is the sum of the processing times of its |
| 14 | jobs, and the goal is to maximize the smallest load. |
| 15 | |
| 16 | As a minimization problem, the cost of an assignment is the negative of the |
| 17 | smallest load; without machines it is . |
| 18 | -/ |
| 19 | |
| 20 | namespace Lax434175.MachineCovering |
| 21 | open Lax434175.Problems |
| 22 | |
| 23 | structure Inst where |
| 24 | jobs : ℕ |
| 25 | machines : ℕ |
| 26 | p : Fin jobs → ℕ |
| 27 | |
| 28 | /-- The load of a machine. -/ |
| 29 | def load (x : Inst) (σ : Fin x.jobs → Fin x.machines) (i : Fin x.machines) : ℕ := |
| 30 | ∑ j ∈ Finset.univ.filter (fun j => σ j = i), x.p j |
| 31 | |
| 32 | /-- The smallest load of a machine; `0` without machines. -/ |
| 33 | def minLoad (x : Inst) (σ : Fin x.jobs → Fin x.machines) : ℕ := |
| 34 | if h : 0 < x.machines then Finset.univ.inf' ⟨⟨0, h⟩, Finset.mem_univ _⟩ (load x σ) else 0 |
| 35 | |
| 36 | /-- `P || C_min` -/ |
| 37 | def problem : Problem where |
| 38 | Inst := Inst |
| 39 | Sched x := Fin x.jobs → Fin x.machines |
| 40 | feasible _ _ := True |
| 41 | cost x σ := -(minLoad x σ : ℚ) |
| 42 | |
| 43 | end Lax434175.MachineCovering |
| 44 |
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments