set the value of unused variables
回答済みHi,
In my model, there are some unused binary variables. I want to set the default value of them zero rather than one. How can I do this?
Thanks
0
-
正式なコメント
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?. -
Hi,
In Gurobi, variables don't have a default value. If there are multiple optimal solutions (for example by choosing different values for variables that do not participate in any constraint or the objective), Gurobi will return the first one it finds -- which one this is may depend on the solver path.
If you want "unused variables" to be zero, you could simply add a constraint that fixes them to zero or you could add them to your objective function with the appropriate sign (depending on whether you're maximizing or minimizing).
Silke
0
投稿コメントは受け付けていません。
コメント
2件のコメント