Iterating over Non-Zero variables
AnsweredI have an LP (in standard form Ax=b, x>=0) with around 1 million decision variables, of which only about 1000 will be non-zero. After optimizing, is it possible to directly iterate over those non-zero variables? I currently iterate over every variable in my model and check whether var.x > 0.0001, but since I do this frequently it is becoming a bottleneck.
Re-stated, I imagine I just want to know which variables are in the basis.
0
-
Official comment
This post is more than two 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. -
Hi Alexander,
Re-stated, I imagine I just want to know which variables are in the basis.
You should query the attribute VBasis on each variable to find its status on the current basis.Best regards,
Maliheh
0
Post is closed for comments.
Comments
2 comments