Simranjit Kaur
Gurobi Staff- Total activity 329
- Last activity
- Member since
- Following 0 users
- Followed by 2 users
- Votes 4
- Subscriptions 137
Comments
Recent activity by Simranjit Kaur-
Hi, Unfortunately, it is not possible to write lazy constraints or user cuts added via callback with Model.write() function directly. However, you can workaround this by tracking the lazy constrain...
-
Hi Qiru, Please introduce an auxiliary variable y, and replace the constraint MODEL.addConstr(b[2]*e1 + b[4]*e2 + b[7]*e3 == gb.max_([b[k] for k in range(0, 8)]) ) with the following y = MODEL.addV...
-
Hi Qiru, The error “gurobipy.GurobiError: Variable has not yet been added to the model” happens due to Gurobi’s lazy update approach, precisely when we try to access and use a variable before updat...
-
Hi Dagm, In general, to model a product of n variables, you will need to add (n-1) auxiliary variables and constraints as described in How do I model multilinear terms in Gurobi? However, from your...
-
Hi Myat, The error "KeyError: 'Missing constraint index'" occurs when you try to add a single constraint using the method Model.addConstrs(). Please use Model.addConstr() instead of using Model.ad...
-
Hi Dagm, The error is coming from constraint 'a22' in your example, as it contains a product of three variables. Modelling multilinear terms directly is not supported in Gurobi at present. However...
-
Hi Siqi, To model your objective function, specifically the term x^(1-z), we will need to use Gurobi’s general constraints. Let’s see how this can be done. x^(1-z) is same as exp( (1-z)*log(x) ). T...
-
Hi, The behaviour you are observing occurs mostly when a model has numerical issues. Numerical issues can sometimes result in the simplex algorithm declaring the model infeasible while the IIS cons...
-
Hi Siqi Zhang, The method model.addVars() returns a tupledict. You should use ox_2[i,h,l] instead of ox_2[i][h][l] to access the variable associated with the tuple (i,h,l), as shown below: for i in...
-
Hi Ramesh, To ensure that D is zero when the binary variable C is zero, you can add another indicator constraint: m.addConstr( (C==0) >> (D==0) ) Alternatively, you can add a Big-M constraint, m.a...