Skip to main content

Cut Generation LP ( CGLP)




  • Riley Clement
    Gurobi Staff Gurobi Staff

    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?


    While not directly related to your question, you may find this previous post on column generation useful.

    - Riley

  • Farzane Ezzati
    First Comment
    First Question

    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.





Please sign in to leave a comment.