Skip to main content

Exploiting Integer Objective and Identical Feasible Regions across Problems

Answered

Comments

1 comment

  • Riley Clement
    • Gurobi Staff

    Hi Alexander,

    Gurobi will identify that the objective value is integral, you don't need to provide this.  The logs will print ObjBoundC  but use the rounded value ObjBound for pruning the branch and bound tree.

    For your second question, there are several approaches you could take to speed up the process.  The simplest approach is simply to define your first model and call Model.optimize(), then extract and store the solution, then use Model.setObjective to set a new objective and call Model.optimize() to reoptimize for the new objective, and so on... 

    Another option (perhaps the better one) is to define a multi-scenario model, where each scenario represents a different objective.  You would need to use this functionality to redefine the variable coefficients in the objective function wherever they change from the base model.  Our example multiscenario.py will help, although it shows modifications to the constraints, and not the objective function.  If you haven't used this functionality before then there will be a small learning curve but I'd expect Gurobi to produce solutions for all models faster than the previous approach.

    If you try both it then please consider posting some solve times below.

    - Riley

    0

Please sign in to leave a comment.