メインコンテンツへスキップ

Multiple submatrices

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    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.
  • Jaromił Najman
    • Gurobi Staff

    I see two ways of approaching your issue.

    1. You could use Gurobi's Matrix API. This way, you could define a matrix A holding all columns and quickly rebuild your model using sub-parts of this matrix. The same would hold for c,b, and x.

    2. You construct the big model holding all columns and rows. You can turn off a column by setting both bounds of a given variable to \(0\) via

    x.LB=0
    x.UB=0

    You can turn off a constraint via setting it's right hand side to \(\texttt{GRB.INFINITY}\) via

    con.RHS=GRB.INFINITY

    See documentation of attributes for mode details.

    You would have to reset variable bounds and right hand sides in between two optimization runs but you would not have to rebuild the model.

    Best regards, 
    Jaromił

    0

投稿コメントは受け付けていません。