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

How to remove a specific set of constraints from a bigger dictionary of constraints

回答済み

コメント

3件のコメント

  • 正式なコメント
    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 why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi Sabrin,

    You could define \(\texttt{infeasible_arc4}\) before you add the constraints and then add an \(\texttt{if}\)-statement to the quicksum. This should be similar to \(\texttt{quicksum(x[k,i,j] for j in N for k in K if (i,j) not in infeasible_arc4)}\).

    Best regards,
    Jaromił

    0
  • Sabrin Rashwan
    • Gurobi-versary
    • Conversationalist
    • Investigator

    Thank you Jaromil for your prompt response. I used the if - statement incorrectly.  Now, I have applied your recommendations. and the model returns to work again. However, I faced another relevant issue please refer to this post.

     

    Thanks a lot,

    Sabreen

     

    0

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