Linear program with ceiling or floor functions (HOW?)
AnsweredHow I can linearize a constraint with ceiling or floor functions in gurobi.
0
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?. -
You could model the expression \(\lfloor x\rfloor\) for a decision variable \(x\) by introducing a new integer variable \(y\) and adding the constraints
$$y <= x$$
$$y + 1 >= x + \epsilon$$
where \(\epsilon\) should a little bigger than the feasibility tolerance and the integer feasibility tolerance.
Of course, \(\lceil x\rceil\) can be modeled similarly.
Silke
1 -
Thank you this help me a lot
0 -
This is the best article I could have found in Gurobi! Thank you!
0
Post is closed for comments.
Comments
4 comments