Need to (re)optimize model based on parameters/input data (not variables or constraints)
回答済みOne of my constraints of the optimization model is as below. Once optimal solution is found, I am able to remove some variables & (re)optimize the model. But, I also want to update the value of param2_new = param2 - some_index_from_optimal_solution, meaning the constraint would be x=1 if param1 >param2_new.
Constraint: x = 1 if param1 > param2
Since param2 is not directly connected to any variable, when I am using model.update(), the update call is not using param2_new, model is using previous value, i.e. param2.
I tried writing a callback function. But, struggling to think fresh. Also, there's no mathematical connection between this param2 & variables of the model. I am just calling param2 from an external file that I want to update by param2_new based on recent optimal solution, then update param2, then, run the model again.
-
正式なコメント
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
Your description of the problem is not very clear to me but it sounds like you are looking for indicator constraints: How do I model conditional statements in Gurobi? – Gurobi Help Center
I hope that helps.
Best regards,
Matthias0
投稿コメントは受け付けていません。
コメント
2件のコメント