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

Usercut callback via python : repeated cut

回答済み

コメント

3件のコメント

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Yilu,

    I think a similar question was asked here last year.  Please take a look at the following post:

    https://support.gurobi.com/hc/en-us/community/posts/27095292925969/comments/27140622551825

    - Riley

    0
  • Yilu LONG
    First Comment
    First Question

    Hi Mr. Riley,

    Thank you for suggesting the post to me. However, I think my case is different from the one in the post you referenced.

    In my situation, the cuts are user cuts, which I add within the callback using model.cbcut() under the MIPNODE, rather than using addLazyConstraints() in the MIPNODE.

    Additionally, as Mrs. Maliheh mentioned, "The capacity inequalities added via callbacks in your application are indeed lazy constraints because the model without them would be incorrect." However, in my case, the model remains correct even without adding these cuts. The cuts are simply introduced to speed up the optimization process, and they are only added when the current solution violates the cut.

    I hope this clarification helps. Thank you again for your support!

    Best regards,

    Yilu

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Yilu,

    The mechanisms behind cuts and lazy constraints are almost identical so the explanations in that post and others linked from it generalize to user cuts:

    user cuts are not necessarily added to the LP relaxation immediately. They must first survive an internal Gurobi filtering process based on criteria such as orthogonality to other cuts, strength, and quantity. Therefore, it is not surprising that the same user cut is generated multiple times, as it may reside in Gurobi's internal cut pool without being incorporated into the LP relaxation

     

    multiple heuristics applied to the same LP relaxation solution found solutions that violate the same [user cut]. The second heuristic might not have been aware of the [user cut] generated for the first heuristic solution, which is why you had to add the same [user cut] again.

     

    Due to multi-threading and the time it takes for newly added [user cuts] to sync among all threads, you might encounter solutions that violate previously added [user cuts].

    If there's anything you still think is missing then let me know.

    Kind Regards,
    Riley

    0

サインインしてコメントを残してください。