How to get the value of a variable before the solution is generated
Let's say I have a variable X. I'm trying to write a constraint for a math model, which contains some metrics in the constraint that requires the current value of X.
How should I write those kinds of constraints?
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?. -
There are several alternatives to introduce new constraints in the model based on the X values. For instance, you can start by using a callback function, check the status of your X variable periodically, and introduce new constraints in your MIP.
I think you need to give more details about your model or your problem.
0
Post is closed for comments.
Comments
2 comments