Hello everyone,
I am trying to implement the automatic benders decomposition to my problem using CPLEX version 20.10. I want to use USER strategy to decompose the model according to my annotations.
So first I initialize the strategy of benders algorithm and cplex.newLongAnnotation to specify cpxBendersPartition of variables.
cplex.setParam(IloCplex.Param.Benders.Strategy, IloCplex.BendersStrategy.User);
IloCplex.LongAnnotation benders = cplex.newLongAnnotation(IloCplex.CPX_BENDERS_ANNOTATION,IloCplex.CPX_BENDERS_MASTERVALUE + 1);
Then after initializing the integer variable x in X.
IloIntVar [] x = new IloIntVar[NumofRoute]; //integer
I tried to annotate it as following and add it to the master problem (value = 0)
for(int k=0; k < x.length; k++) {
x [k] = cplex.intVar(0,cluster.getNbVeh(),"x_"+k);
cplex.setAnnotation(benders, x[k],IloCplex.CPX_BENDERS_MASTERVALUE);
}
However at this point I got the following errors:
ilog.cplex.IloCplex$UnknownObjectException: CPLEX Error: object is unknown to IloCplex
at ilog.cplex.IloCplex.getIndexOrException(IloCplex.java:11470)
at ilog.cplex.IloCplex.access$7400(IloCplex.java:453)
at ilog.cplex.IloCplex$AnnotationList.getIndexAndType(IloCplex.java:22273)
at ilog.cplex.IloCplex$AnnotationList.setAnnotation(IloCplex.java:22302)
at ilog.cplex.IloCplex.setAnnotation(IloCplex.java:22851)
So my questions are why am I getting this error ? and how to annotate the variables to use in an annotated decomposition for Benders algorithm?
And is there a way to export the .LP files of the master and the sub-problem(s) ?
Thank you so much in advance.
------------------------------
ISSA bou zeid
------------------------------
#DecisionOptimization