Is it possible to have constraints such as z^1.5 <= v in the model
AnsweredI have a problem with constraints: z^1.5 <= v.
It is possible to write power constraints as z^1.5 = v.
But, is it possible to have constraints such as z^1.5 <= v, where z, v >=0?
Is it possible to have z^1.5 <= vx, where x is binary?
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 why not try our AI Gurobot?. -
Hi Ebru,
Have you tried using the GRBModel.addGenConstrPow() method? To model \( z^{1.5} \leq v\), you can have:
z = model.addVar(name="z")
y = model.addVar(name="y")
v = model.addVar(name="v")
model.addGenConstrPow(z, y, 1.5, name="map_power") # y = z^1.5
model.addConstr(y <= v, name="inequality_constr")Gurobi versions 9.0 and later support bilinear constraints. To model \( z^{1.5} \leq vx\), you can have:
x = model.addVar(vtype=GRB.BINARY, name="x")
model.addConstr( y <= v * x, name="bilinear_constr")Best regrads,
Maliheh
1 -
Thank you Maliheh.
0
Post is closed for comments.
Comments
3 comments