benders decomposition for a largescale MILP

Hi everyone,

 

I’m currently working on benders decomposition for  a large scale scenario based stochastic MILP using cplex benders strategy. I want to decompose my model into a master problem with both integer vars and continuous vars and ‘sc’ subproblems with all continuous vars. I tried using different strategies including strategy 3 even though it considers all continuous vars in sub problems. With strategy 3, I actually got the exact answer but it took a very long time compared to the original problem. When I checked the .ann file, I could see that all the second stage variables were considered in 1 sub problem rather than ‘sc’ sub problems. I had defined at first to partition the model based on scenarios as:

int bendersPartition[sc in 1..scenarios][i in 1..numclientjobs][s in 1..bigstatesize][1..maxTU] = sc;
int bendersPartition2[sc in 1..scenarios] = sc;

Then, in my main, I defined:

var masterDef = thisOplModel.modelDefinition;
var masterElts = thisOplModel.dataElements;

// standard solve + force benders strategy to full.
var subCplex1 = new IloCplex();
subCplex1.bendersstrategy = 3;
var subOpl1 = new IloOplModel(masterDef, subCplex1);
subOpl1.addDataSource(masterElts);
subOpl1.generate();
subCplex1.solve();

//output
cplex.exportModel(“benders.lp”);
subCplex1.writeBendersAnnotation(“cplex1.ann”);
writeln(subCplex1.getObjValue());

//clean memory
subOpl1.end();
subCplex1.end();

 

I also tried strategy 2 with annotations, but in that case, I got errors like : scripting runtime error:cannot convert to an integer. Following is the code lines for strategy 2.

 

var subCplex2 = new IloCplex();
var subOpl2 = new IloOplModel(masterDef, subCplex2);
subOpl2.addDataSource(masterElts);
subOpl2.generate();
subCplex2.bendersstrategy = 2;

subCplex2.newLongAnnotation(“cpxBendersPartition”);
for(var sc=1; sc<=thisOplModel.scenarios;sc++){
    for(var cj=1; cj<=thisOplModel.numclientjobs;cj++){    
        for(var s=1; s<=thisOplModel.statesizes[cj];s++){            
            for(var t=1;t <= thisOplModel.numTU[thisOplModel.TSin[cj][s]]; t++){    
subCplex2.setLongAnnotation(“cpxBendersPartition”, subOpl2.BB[sc][cj][s][t],  subOpl2.bendersPartition);
subCplex2.setLongAnnotation(“cpxBendersPartition”, subOpl2.SS[sc][cj][s][t],  subOpl2.bendersPartition);
subCplex2.setLongAnnotation(“cpxBendersPartition”, subOpl2.DB[sc][cj][s][t],  subOpl2.bendersPartition);
subCplex2.setLongAnnotation(“cpxBendersPartition”, subOpl2.DS[sc][cj][s][t],  subOpl2.bendersPartition);

            }
        }
    }
}
subCplex2.solve();

t
cplex.exportModel(“benders.lp”);
subCplex2.writeBendersAnnotation(“cplex2.ann”);
writeln(subCplex2.getObjValue());

 

 

Can someone please help me with this error?

 

 

Thanks in advance!

Source: benders decomposition for a largescale MILP