Tobias Achterberg
unread,Jun 15, 2016, 2:58:05 PM6/15/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gur...@googlegroups.com
There are basically two ways:
1. You do not use S in your Gurobi model but instead calculate it yourself after
Gurobi found an optimal value for your Y variable. Then, all this has nothing to
do with Gurobi---you would just use regular Python statements to calculate S.
2. You add a new variable using addVar() for S with infinite lower and upper
bound and add an equality constraint that states S = c*Y. Then, Gurobi will
calculate the value of S for you. Note that in terms of performance this
additional variable and constraint is most likely not an issue at all, because
the presolver of Gurobi (more precisely, the aggregator) will eliminate S and
the equation from the model and calculate the value of S in a post-processing
step, just like what you would have done manually in approach 1 above.
Hope this helps,
Tobias