GRBBinvcolj function returning different order of indices
AnsweredI am using the function GRBBinvColj to solve the equation x = (B-inv)(Aj) where B-inv is the basis inverse and Aj is the j-th column of constraint matrix. After printing the resulting sparse vector, I see that the ordering of the vector is not as I would expect although the values are same. I am not sure if I am missing something while trying to interpret it. For instance, I calculated the values manually and the vector I get is [-2/3,1,2/3] but the output I get from Gurobi is [1,-2/3,2/3], and in yet another instance, I calculated [1/3,0,-1/3] but the output I get is [0,1/3,-1/3]. So, it changes the ordering without any way for me to know which value corresponds to which basic variable. Thanking you in advance, any help is appreciated.
-
Official comment
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 why not try our AI Gurobot?. -
You can obtain the order of the variables in the current basis, see here: https://www.gurobi.com/documentation/9.0/refman/c_getbasishead.html
0 -
Thank you for your response. I did use the getbasishead function and obtained the order of the variables. The difficulty that I am facing now is with the values that it return after calculating (B-inv)(Aj) for a particular column. For example, for j = 0, I expect the values to be (2,1) but it returns (1,2) and for another column, expected vector is (1,-1) but returned vector is (-1,1). I will appreciate any insight you can provide me. Thanks again!
0
Post is closed for comments.
Comments
3 comments