Newbie question for writing constraints in python

27 views
Skip to first unread message

Haeseung Lee

unread,
Nov 4, 2015, 4:27:31 PM11/4/15
to Gurobi Optimization
Hi.

I just started to use gurobi and python.
I want to implement the constraint equation, but I'm not sure whether this is correct way.
I attached the equation figure that I want to implement and i put my python code for the equation.

Could you please look at these figure and equation and give some feedback?
Any suggestion will be helpful to me

Thank you.


----- Python code -------------------------------------------------------------------------------------------------
for i in I:
for p in P[i]:
model.addConstr( quicksum(t*x[p,t] for t in T ) + tau(p) <= quicksum(t*x[i,t] for t in T ) )
------------------------------------------------------------------------------------------------------------------------
equation.jpg

Tobias Achterberg

unread,
Nov 19, 2015, 6:45:50 AM11/19/15
to gur...@googlegroups.com
I think that your python model looks correct. Of course, this depends on whether
the involved objects are the correct sets, arrays, and so on.

Regards,

Tobias
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Gurobi Optimization" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to gurobi+un...@googlegroups.com <mailto:gurobi+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages