Update mipgap after each subproblem
AnsweredHi,
The problem that I work on requires solving the same model with a different set of constraints until the pre-determined time limit. However, I would like to update/force the optimality gap dynamically as let newgap:= min(0.01, (x-y)/x) where x and y are the solutions from the previous subproblem.
Currently I use gurobi_options "timelim=100 mipgap=newgap"; but it gives the following message
"Expected a numeric value for mipgap, not newgap"
May I know how to resolve this issue?
Thanks.
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 try Gurobot, our chatbot interface offering instant, expert-level support. -
It appears you are setting an AMPL gurobi_options string. Is newgap an AMPL parameter? Then you need to use an AMPL string expression in an option statement like this:
option gurobi_options ("timelim=100 mipgap=" & newgap);
The ( parentheses ) signal to AMPL that you are using an expression to form the option string, and & is the AMPL string concatenation operator.
0
Post is closed for comments.
Comments
2 comments