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

How to implement constraint in which nodes are visited optionally?

回答済み

コメント

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?.
  • Silke Horn
    • Gurobi Staff

    Hi,

    Welcome to the Gurobi community!

    Here are a few ideas you could look into:

    • You can model optional constraints (that is, constraints that would be nice but may be violated if necessary) by adding a penalty for violating them to the objective function (instead of adding the constraint itself).
    • If you are looking to implement if-then-constraints, you might want to look at indicator constraints.

    Silke

    0
  • Subramanian Ramasamy
    • Gurobi-versary
    • Conversationalist
    • First Question

    Hi,

    Thank you for your input. I will look into these options. I could understand how indicator constraints would work. I guess I would need indicator constraints for my problem (as I need to implement such a way that a node will be visited only if a variable's value is lesser than some threshold value - hence I guess I need indicator constraints). Though I guess I would need indicator constraints for my problem, I could vaguely understand how does optional constraints that you mentioned in the first bullet point would work. It would be helpful for me if you could provide a short and crisp sample for implementing that optional constraint that you mentioned in the first point. Thank you so much for your help.

    0

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