Originally posted by: fabioftv
Hello,
I am trying to solve some linear benchmark problems using the CPXpivot subroutine. These problems are written in MPS format and do not include any slack, surplus, or artificial variables. My code first reads the MPS file and finds a starting basic feasible solution to the problem. I use the subroutine CPXgetbase (int CPXgetbase(CPXENVptr env, CPXLPptr lp, int *cstat, int *rstat))to obtain the correspondent basis. The basis returned is partitioned into the basis status of the columns in the LP problem object (cstat) and the basis status of the slack/surplus/artificial variable associated with each row in the constraint matrix (rstat).
However, CPXpivot can only handle cstat and not rstat. For instance, suppose a maximization problem with three variables and three constraints. Let the starting feasible basis be cstat = [1,1,0] and rstat = [0,0,1] where 1 represents a variable is basic and 0 a nonbasic variable at its lower bound. I can easily swap cstat[0] with cstat[2] by using CPXpivot(env, lp, 2, 0, CPX_AT_LOWER). However, I cannot swap cstat[0] with rstat[0]. This returns an illegal pivot.
Does anyone have suggestions on how to handle this issue? One way I though was to include the slack, surplus, or artificial variables into the MPS file but I guess there should be an easier way. Any help is appreciated.
Thanks
#CPLEXOptimizers#DecisionOptimization