Originally posted by: Ketov
Hello dear community,
I am solving large-scale MILPs and using CPLEX C++ API. The original problem scale is too large, so I am dividing the problem and solving smaller sub problems. Therefore, I have currently one single IloEnv. For every sub problem I am initialising one IloCplex instance. But the necessary memory magnitude of the (empty) IloCplex instances is growing with the amount of decision variables and constraints in the concerning IloEnv. Unfortunately, for my target problem every single IloCplex instance is using far too much memory which is not applicable, since I have approximately 400 sub problems.
How can I change my program architecture in order to solve that problem? I thought about dealing with one IloEnv instance by problem, but I read that this should be avoided.
Given the case I have to work with several IloEnv. How can I copy constraints or decision variable easily from one IloEnv to another? This is an important question for me since the constraints and variables will come (in any case, I cannot change this) from one single IloEnv.
The approach works with smaller problems.
Current approach:
IloEnv * env = new IloEnv;
/*
//Initialising all IloConstraints, of all Subproblems, with env .... (several millions, it is a MILP)
*/
for (int iCountSubProblem = 0 ; iCountSubProblem< iAmountSubProblems; iCountSubProblem++)
{ //Here the memory usage is far too high, over 100GB...
IloCplex cplex_temp(env);
vector_cplex.push_back(cplex_temp);
}
//Construct target funktions with env
//add IloConstraints and IloExpr (as tagret function) to curtain IloCplex instances
//solve subproblems ....
Thank you very much!
Have a nice week,
Ketov
#CPLEXOptimizers#DecisionOptimization