I have a minimization problem that I solve with JuMP and CPLEX, but I can't figure out how to find which variables are in the basis from the final solution.
Using getbasis I get two basis vectors, column basis and row basis, but I don't understand them. For example, in the following case, a problem with 4 variables $x_i$, the basis vectors are:
cbasis: [:Basic, :Basic, :NonBasicAtUpper, :Basic]
rbasis: [:NonbasicAtLower,:NonbasicAtLower,:Basic,:NonbasicAtUpper]
Which ones are the basic variables in this case?
Most LP solvers add (implicitly) a slack variable to each row (constraint). So they solve $$\begin{align} \min\> & c^Tx\\ &Ax - s =b\\ &\ell \le x \le u\\ &\ell_s \le s \le u_s\end{align}$$ The basis status of $x$ is returned in
cbasisand the basis status of $s$ is returned inrbasis.If the number of equations is $m=4$, there must be 4 basic variables. Indeed the basic variables are $x_1, x_2, x_4, s_3$.