Adding and removing Scenarios in multiscenario setting
AnsweredHi,
I noticed that in the multi-scenario feature of Gurobi, there is no option of removing scenarios.
This is problematic when we use a model iteratively instead of creating and deleting a model in each iteration. For instance, if we define a scenario in an iteration by changing the right-hand side of constraint 1. In the next iteration, if we want to change the base scenario and then define scenario 1 by changing the right-hand side of constraint 2. Scenario one would have the information from the previous iteration ( change on the right-hand side of constraint 1 ) and the change on the right-hand side of constraint 2!
I would highly appreciate it if you help with that. Thank you!
Kianoush
-
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?. -
In your example, you can remove the RHS change of constraint 1 in scenario 1 by setting the constraint's ScenNRHS attribute to \( \texttt{GRB_UNDEFINED} \) or \( \texttt{GRB.UNDEFINED} \) (depending on your API). This way, scenario 1 would only include the change to the RHS of constraint 2. Does this work for you?
0 -
Thank you very Much! It solved my issue!
Regards,
Kianoush
0
Post is closed for comments.
Comments
3 comments