Originally posted by: midkiffj
Hello,
I am using Cplex 12.6.3 with Java and am looking to solve a model, modify multiple constraints, solve again, and repeat.
I have many constraints similar to U*x_i - U <= z_i where I'll need to update the value of U in between solutions.
At the current time I found that something along the following works:
IloNumExpr constraint = cplex.numExpr()
// .....
// Creating constraint
// .....
IloRange[] constraints = new IloRange[10];
constraints[0] = cplex.addLe(constraint, 0);
I store the constraints in IloRange arrays and can then modify the expression and bounds on the ranges to edit the constraints. My question is: Is there a better, more efficient way to edit the constraints? Similar to some strategies I've been told exist in the c++ library, is there a way to modify the value of U without having to recreate the expressions in the IloRange arrays. Preferably a method that would lower the amount of work cplex would have to do between solutions to modify the problem.
#CPLEXOptimizers#DecisionOptimization