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

Remove cbCut

回答済み

コメント

5件のコメント

  • 正式なコメント
    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?.
  • Eli Towle
    • Gurobi Staff

    No, there isn't a way to remove constraints/cuts in a callback. To "remove" a user cut, you would have to store the cut, restart the optimization, then make sure you don't add the cut (or a sufficiently similar cut) in the next optimization run. But this requires restarting the entire optimization process.

    0
  • Tang Try
    • Gurobi-versary
    • First Comment
    • First Question

    Thank you, I noticed that we can remove constraint by model.remove(), So is it possible to use model.addConstr() rather than model.cbCut in the callback function? Are there any differences between these two methods?

    0
  • Matthias Miltenberger
    • Gurobi Staff

    Hi Tang,

    You cannot remove constraints during the optimization. This would result in a relaxation of the problem and invalidate the previously made progress in finding the optimum. The whole idea of the branch-and-bound-and-cut process relies on further and further restricting the feasible domain until optimality can be proven.

    Cheers,
    Matthias

    0
  • Tang Try
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks a lot.

    0

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