Originally posted by: Selectedbetter
Thank for you reply!
We think the constraints of the simple problem are all correct, so what lead to the wrong result would be the cut generated by subproblem.
We are not so familiar with the C++ API, hence we think there would be some wrong in using the codes, especially how to get the extrem point.
For example, if the subproblem is optimal, we want to get the extrem point of dual variables,like alpha, beta and gamma, to genera the cut.
else if(cplex.getStatus() == IloAlgorithm::Optimal)
{
IloNumArray alphaR(env,NumVars);
IloNumArray betaR(env,NumVars);
IloNumArray gammaR(env,NumVars);
cplex.getValues(alphaR,alpha);
cplex.getValues(betaR,beta);
cplex.getValues(gammaR,gamma);
cutLhs.clear();
cutLhs+=alphaR[0]*(2*x1-3*x2);
cutLhs+=betaR[0]*(11-2*x1+x2);
cutLhs+=gammaR[0]*(7-x1-x2);
alphaR.end();
betaR.end();
gammaR.end();
violatedCutFound = 2;
}
Is that right? When we only consider the situation of unbound of subproblem, the result is suboptimum, and then comes to the situation of both unbound and optimal of subplem, there is no available solution.
What can we do under this condition? Maybe all because we could not realize the benders with what we have grasped of C++API.
Could you please give us some tips or find what is uncorrect in our code?
Thanks!
#CPLEXOptimizers#DecisionOptimization