Originally posted by: Eumpfenbach
I am trying to find more information about where these implied bound cuts are coming from. I am trying to avoid getting the actual cuts generates unless absolutely necessary (C and C++ coding is outside of my comfort zone. I like Matlab).
My plan was to generate every implied bound cut I possibly could, even if they are redundant. Then I would solve, and look to see which ones were binding. I ran my script to add all these cuts to the model, but after doing so, it became infeasible. Clearly I am generating invalid cuts. Here is my script. Can anyone tell me where the error is?
yidx is an indicator for the binary variables. Everything else is defined in the loops from a cplex object.
yidx = [
false(18144,1);
true(24,1);
false(36882,1);
true(64,1);
false(6,1);
true(198,1)]; temp = find(yidx);
for i=1:1:size(temp,1) i
for j = 1:1:size(cplex.Model.A,1)
if cplex.Model.A(j,temp(i)) ~= 0 temp_row = cplex.Model.A(j,:); temp2 = find(temp_row ~= 0); temp3 = find(temp2 == temp(i)); temp2(temp3) = []; bin_coefficient = temp_row(1,temp(i));
for k = 1:1:size(temp2,1) var = [j,temp2(k)]; b = cplex.Model.rhs(j,1) - bin_coefficient; u = cplex.Model.rhs(j,1); new_row = sparse(1,size(cplex.Model.A,2)); new_row(1,temp2(k)) = 1; new_row(1,temp(i)) = (u-b); cplex.Model.rhs = [cplex.Model.rhs;u]; cplex.Model.lhs = [cplex.Model.lhs;-Inf]; cplex.Model.A = [cplex.Model.A;new_row]; end end end end
#CPLEXOptimizers#DecisionOptimization