Cut Generation LP ( CGLP)
AnsweredHi,
I am writing an algorithm in which after solving LP relaxation of several sub-problems from a two-stage stochastic model. I want to use CGLP to generate disjunctive cuts. To generate disjunctive cuts, I need to have access to constraint matrices A, b from the first stage in addition to T, W, r from the second stage for each scenario.
How can I access them in a matrix/table format, not sparse?
Does gurobi have any automatic CGLP cut generation parameter settings?
Thanks,
farzane
-
Hi Farzane,
I need to have access to constraint matrices A, b
Model.getA and Model.getAttr will be useful here, eg
m = gp.Model()
...
cons = m.getConstrs()
A = m.getA()
b = m.getAttr("RHS", cons)in addition to T, W, r
I'm not sure what this is referring to. A and b are well understood to be the constraint matrix and RHS but I'm guessing T, W, r may be specific to whatever resource you're referencing for column generation. If you can translate this into standard model attributes (such as reduced cost, dual values etc) then this would help.
How can I access them in a matrix/table format, not sparse?
If A is a sparse matrix you can convert it to a numpy matrix or numpy array with A.todense() and A.toarray() respectively.
Does gurobi have any automatic CGLP cut generation parameter settings?
No.
While not directly related to your question, you may find this previous post on column generation useful.
- Riley
0 -
Hello Riley,
Thank you so much for the help.
By T, W, r I am refering to two-stage stochastic models. I should have been more precise.
Your answer helped a lot regarding the sparse matrices.
By CGLP I am refering to Cut Generation Linear Programming which is related to generating disjunctive cuts. I order to apply CGLP I need to have access to T, W, r matrices' elements. I will read the post that you provided with the link.
Thanks,
Farzane
0
Please sign in to leave a comment.
Comments
2 comments