Hi,
Now I am trying to generate multiple clones from the original model for branch and bound algorithm.
Original model is for example
Min 3x+2y
subject to x+y<=10, 0<=x<=10 and 0<=y<=10 integers
And I want to modify the upper and lower bound of a certain variable, for example 0<=x<=5.
However, I could not get access to the variable because the model is simply a clone.
Is there any way I can modify the cloned model?
Thank you in advance and I attach the sample code for reference.
Following is the sample code.
#include"ilcplex/ilocplex.h";
using namespace std;
int main()
{
IloNumVar Y(env, 0, 10, ILOFLOAT);
IloNumVar X(env, 0, 10, ILOFLOAT);
IloEnv env;
IloModel Model(env);
Model.add(IloMinimize(env, 3*X+2*Y));
Model.add(X+2Y <= 10);
IloModel Model1 = Model.getClone(env);
//I want to add Model1.add(X<=5); for example. However, it identifies this X as a totally new variable in the cloned model in this case, which different from X in the original model.
}
Best,
Samuel
------------------------------
Sangjeong Lee
------------------------------
#DecisionOptimization