Originally posted by: Amira Hijazi
Hi everyone,
I am trying to apply benders decomposition in my model using annotation with blocks of variables.
This is my main part in the model:
main{
thisOplModel.generate();
var masterDef = thisOplModel.modelDefinition;
var masterElts = thisOplModel.dataElements;
// use annotation with blocks of variables.
// if partitioning is bad, then an error will be raised by CPLEX...
var subCplex3 = new IloCplex();
var subOpl3 = new IloOplModel(masterDef, subCplex3);
subOpl3.addDataSource(masterElts);
subOpl3.generate();
subCplex3.bendersstrategy = 1;
subCplex3.newLongAnnotation("cpxBendersPartition");
subCplex3.setLongAnnotations("cpxBendersPartition", subOpl3.y, subOpl3.bendersPartition);
subCplex3.solve();
writeln(subCplex3.getObjValue());
subCplex3.delLongAnnotation("cpxBendersPartition");
subOpl3.end();
subCplex3.end();
}
and this is my partitioning:
int bendersPartition[i in I][scenario_no in scenario_index] = scenario_no;
I am not sure what is missing or wrong?
I keep getting an erro "invalid benders decomposition? Do i need to add any thing else like cuts?
#DecisionOptimization#OPLusingCPLEXOptimizer