Can I get the inverse of an LP basis from a GUROBI model object in Python API?
OngoingI am solving L1 regression which has the following generic LP model.
\[\begin{aligned}
& \underset{\beta, z^+\geq0,z^\geq0}{\min}
& & \sum_{i=1}^n z^+_i+z^_i \\
& \text{s.t.}
& & \left\langle \beta, (1,\mathbf{x}_i)\right\rangle+z^+_iz^_i = \mathbf{y}_i, \;\; i=1,\ldots,n.\\
\end{aligned}\]
Is it possible to get the inverse of the basis of this model once the model is solved?
For example, I can get the names of the variables that are in the basis with the following code. I am looking for something similar to the following code.
gurobiBasisVarNames=[]
for variable in model.getVars():
if variable.VBasis == 0:
gurobiBasisVarNames.append(variable.VarName)

No, the inverse of the basis matrix is not available, unfortunately.
Best regards,
Matthias1 
Thank you for responding. I will indicate if my question is crossposted somewhere else next time I post a question.
I have two followup questions, please let me know if I should ask them separately.
 Is there a function equivalent to GRBBinvcolj() from the C API for the Python API?
 If an equivalent function to GRBBinvcolj() is not available for Python, what can I do? Do you have examples of Gurobi C API functions being used inside a Python code?
0
Please sign in to leave a comment.
Comments
3 comments