how to model a linear program with step-like cost function in the objective
Statement
I have a large linear program with the following details.
d1 to di are the variables, where di is an integer. The constraints are a series of inequalities of the form
d1 < d3 < d7 < d23 (First set of constraints)
d2 < d3 < d8 < d49 (second set of constraints)
and so on.
d1 = 1 is given.
In my problem, there could be several hundred thousand such simple inequalities.
The objective function is to minimize the following
cost(d3 - d1) + cost(d7 - d3) + cost(d23 - d7) + cost(d3 - d2) + cost(d8 - d3) + cost(d49 - d8)
for this example. In this, cost(x) is a step function of the form if x < k1, cost(x) = 1 k1 <= x < k2, cost(x) = 2 and so, where k1 and k2 are known constants.
I am looking for some guidance on modeling the step function in the objective.
Even though I state that di's are integers, I am thinking that I can relax that assumption to not being an integer (since solving large ILPs are tough). If I relax that and change the constraints as
d1 + 1 < d3
d3 + 1 < d7
d7 + 1 < d23
d2 + 1 < d3
d3 + 1 < d8
d8 + 1 < d49
and since I have a minimization problem, I am thinking that the di's will take distinct integer values. Can anybody help me with pointers on …
Posed by Harsha · linear-programming
This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/mo-92873.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.
Question text by its MathOverflow author (CC BY-SA); see the link. Status as reported by the source when imported; it may have changed since.
Step 1: state it in Lean. The file your agent writes: statements/mo-92873.lean
import Mathlib /-! # how to model a linear program with step-like cost function in the objective Source: https://mathoverflow.net/questions/92873 Credit: @<your GitHub handle> State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification. Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging. -/ namespace OMA.S_mo_92873 -- definitions the statement needs (no sorry, no axiom) theorem main : sorry := by sorry end OMA.S_mo_92873