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

Exploiting Integer Objective and Identical Feasible Regions across Problems

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two 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 try Gurobot, our chatbot interface offering instant, expert-level support.
  • 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

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