Originally posted by: JimDan
I use C Callable library to populate an LP. I figured out that this LP solves quicker using baropt rather than primopt. So, in my code, I first solve this using baropt. Then, since I need a basis for subsequent operations, perform a primal basis crossover.
Via code, this is:
CPXsetintparam(env, CPXPARAM_Barrier_Crossover, 1);
int ret = CPXbaropt(env, lp);//Solve using barrier and perform primal basis crossover.
The problem is that there seems to be some discrepancy between the optimal LP value as queried after the above two lines via
ret = CPXsolution (env, lpptr, &lpstat, &zval, xsol, pi,NULL,red_cost);
The zval value after the above is 97153.47
Immediately after the above line, I have
int ret = CPXprimopt(env,lp);//solve via primal LP
ret = CPXsolution (env, lpptr, &lpstat, &zval, xsol, pi,NULL,red_cost);
However, the zval value here is 96846.
When I save the .lp file and open up interactive optimizer (IO) and read the lp file and solve it using baropt, it gives me 96846.
So, there seems to be some discrepancy between IO baropt (which seems to be giving the right answer) and baropt accessible via callable library.
Thanks.
ETA: I have observed this strange behavior both with CPLEX version 12.6.3 as well as 12.7 to which I have just upgraded.
#CPLEXOptimizers#DecisionOptimization