I'm not a C++ user, and it is hard to read the model as formatted. For future reference, the editor button "{;}" lets you insert code and specify the language the code is in. The editor then does some formatting to make it more readable.
You seem to putting FlightAssign and PassengerPath in the master problem. Are they integer variables?
FlightCancel appears to be an integer variable that you have relaxed and put in a subproblem. That seems like a reasonable thing to do, but I don't know whether CPLEX allows it. (It is possible that the internal Benders code still sees FlightCancel as an integer variable.) To test this, you could try declaring FlightCancel as a continuous variable in the original model (and removing the line that applies the IloConversion to it). If Benders works on that, it will confirm that CPLEX is balking at allowing a discrete variable with an attached IloConversion in a subproblem.
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
------------------------------
Original Message:
Sent: Mon November 02, 2020 07:31 PM
From: Keji Wei
Subject: ERROR Ilog exception:CPLEX Error 2002: Invalid Benders decomposition.
Hi Paul
Thanks for your reply.
I have defined the c++ code as follows AnnotateCplexvoid SrmModel::AnnotatedBenders(){ OPT_LOGGER_DEBUG(" We are using benders user" << std::endl); _model.add(IloConversion(_env, FlightCancel, ILOFLOAT)); if (!modelExtracted) { // Extract assembled model and solve using Cplex _algo = IloCplex(_model); modelExtracted = true; //_algo.setOut(solver_srm); } IloCplex::LongAnnotation benders = _algo.newLongAnnotation("cpxBendersPartition"); for (int i = 0; i < _srmEquips.size(); i++) { _algo.setAnnotation(benders, FlightAssign[i], 0); } for (int i = 0; i < flights.size(); i++) { _algo.setAnnotation(benders, FlightCancel[i], 1); } for (int i = 0; i < validPathAsgnIndex.size(); i++) { _algo.setAnnotation(benders, PassengerPath[i], 0); } _algo.out() << "Solving with explicit Benders decomposition." << endl; _algo.setParam(IloCplex::Param::Benders::Strategy, IloCplex::BendersUser);}But it still returns invalid benders decompositions. Do you have some suggestion?
Keji Wei
Senior Operations Research Developer
Sabre, Dallas, TX
Webpage: https://kejiwei.github.io/
------------------------------
------------------------------
Keji Wei
Original Message:
Sent: Mon October 26, 2020 02:57 PM
From: Paul Rubin
Subject: ERROR Ilog exception:CPLEX Error 2002: Invalid Benders decomposition.
You did not post the annotation file, and the LP file does not (AFAIK cannot) contain any annotations. In any case, your model does not have any continuous variables, only integer variables, so there is no way to apply Benders to it. CPLEX only supports traditional Benders decomposition (MILP master problem, LP subproblems), not any of the more recent extensions such as combinatorial Benders, logical Benders, implicit hitting set, ...
------------------------------
Paul Rubin
Professor Emeritus
Michigan State University
Original Message:
Sent: Thu October 22, 2020 04:47 PM
From: Keji Wei
Subject: ERROR Ilog exception:CPLEX Error 2002: Invalid Benders decomposition.
Hi Folks
No matter how I specify variable under the cplex c++ bender decomposition annotation, it always returns
ERROR Ilog exception:CPLEX Error 2002: Invalid Benders decomposition.AnnotatedBenders,
I think I have strictly followed Paul Rubin's example.
The lp is as attached, can anyone diagnose that lp file for me to explain why there is no way to use annotation to solve that model?
--
-------------------------------------------------------------------------------
Keji Wei
Senior Operations Research Developer
Sabre, Dallas, TX
Webpage: https://kejiwei.github.io/
------------------------------
Keji Wei
------------------------------
#DecisionOptimization