Originally posted by: SystemAdmin
[alain.chabrier said:]
Hi,
let's look at the warmstart example :
You have some variables to which you want to provide some initial values :
dvar int+ x[r];
Which initial values will be stored in :
float values[i in r
For this, before you call solve() on cplex, you have to:
1. create a vector container
var vectors = new IloOplCplexVectors();
2. add into it all the combinations variables/values that you want to pass to the engine (does not need to be for all variables) :
vectors.attach(opl2.x,opl2.values);
3. attach the vector to the cplex instance that will use it :
vectors.setVectors(cplex);
4. run CPLEX serach :
cplex.solve();
In the CPELX log you can see the provided solutions is used :
1 of 1 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 65.0000.
In the didactical example, the improvement of performance is obviously not visible, both version (with and without start values) go too fast), but in general providing an initial starting point to CPLEX will help the search.
Hope this helps,
Alain
#DecisionOptimization#OPLusingCPLEXOptimizer