Skip to main content

add constraints in callback

Answered

Comments

4 comments

  • David Torres Sanchez
    Gurobi Staff Gurobi Staff

    Hi Peilin,

    You can add some lazy cuts to achieve this.
    See our TSP example:

    Cheers, 
    David

    0
  • peilin chan
    Gurobi-versary
    First Comment
    First Question

    Hi David,

    Thanks for your advices.

    Does lazy cuts be considered in the following solve? The cuts I want to add is to exclude some unpromising feasible solutions, which is different from that in TSP model to exclude infeasible solutions.

    Best regards,

    Peilin

    0
  • David Torres Sanchez
    Gurobi Staff Gurobi Staff

    Hi Peilin,

    In that case you can use user cuts (instead of lazy cuts), however these will not remain for the next solve.
    One way to keep these would be to save them in a separate container and add them all after the solve.

    Cheers, 
    David

    0
  • peilin chan
    Gurobi-versary
    First Comment
    First Question

    Get it. Thank you David

    0

Please sign in to leave a comment.