Riley Clement
-
Gurobi Staff
- Total activity 1955
- Last activity
- Member since
- Following 0 users
- Followed by 3 users
- Votes 14
- Subscriptions 792
Comments
Recent activity by Riley Clement-
Hi Alberto, You are correct. You can verify this by adding the following code for (int i = 0; i < model.getCol(x).size(); i++) { cout << "Coeff term:" << i << ": " << model.getCol(x).getCoeff(i...
-
Hi Zheren, It's not quite clear to me what you mean by the value of "a". Consider the following minimum reproducible example import guropbipym = gp.Model()n=1M=5x = m.addVar(vtype=gp.GRB.BINARY)a =...
-
Hi Mohammed, You are creating quadratic expressions (QuadExpr objects) trot1 and trot2. When you use them in a constraint you will be creating a quadratic constraint and they needed to be added wi...
-
Hi Xuan, You can just make your delta values a coefficient to this special variable in each constraint. Eg let's call the special variable D. Then for the i-th constraint add delta[i]*D to the RHS....
-
Hi Xuan, If the delta is the same for all constraints, then a good alternative would be to define a gurobipy variable called "delta", which you add to the RHS of every constraint when defining your...
-
Hi Madhushini, We might need to see what your dataframes look like in order for someone to provide an appropriate answer. - Riley
-
Hi Weihang, The elements in your "product array" are gurobipy.MLinExpr. The initial arguments to gurobipy.min_ need to be variables. You can fix this by introducing auxiliary variables like so: #...
-
Here is another way I have been using that may be worth mentioning, for anyone that stumbles across this in the future. # define model m here# define iterable of fixed_vars (containing variables yo...
-
No worries Daniel, perhaps a simple metaheuristic such as simulated annealing would be better in this case as the objective function can be a "black box". You may find a handy python framework if ...
-
Hi Jingwei,Perhaps Model.getCol can help here? If that doesn't work for you case then my advice would be to just set a "_col" attribute on your variables which you use to store the corresponding co...