, I face the problem that CPLEX does not return the “true” optimal solution to the problem.
When I manually fix some binaries, I can increase the objective value (without breaking any constraints) by more than 1%.
I’m sure that this is caused by a mistake I made in setting up the model, but I can’t seem to find it.
P.S.: I attached the model to this post, in there you may find the binary fixes that lead to the increased optimum at the end of the file (wrapped in $ontext/$offtext) cropRot_optCR.gms (19.7 KB)
You did set the upper bound for the variable v_binCatchcrop() earlier in the program to zero and later wanted to fix it to one. CPLEX is usually right. To catch the problem I inserted a bit of code:
enter this some place before you fix the CatchCrop variables
parameter Catchcropup(curCrops,curPlots) upper bound already set to 0;
Catchcropup(curCrops,curPlots) = v_binCatchcrop.up(curCrops,curPlots);
Thanks @ameeraus for the reply and the elegant solution to my problem.
As you might have guessed, I totally oversaw that my .fx was actually resetting the lower bound of the variable. If I would have actually set a lower bound of 1 (instead of fixing it), I would have received a matrix error stating that the lower bound > upper bound.
Anyways, thanks a lot for the help!
Best
Christoph