Can I get the inverse of an LP basis from a GUROBI model object in Python API?
進行中I 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^+_i-z^-_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)
-
正式なコメント
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support. -
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 cross-posted somewhere else next time I post a question.
I have two follow-up 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
投稿コメントは受け付けていません。
コメント
4件のコメント