Skip to main content

Is it possible to use different time limits for each hierarchy when using lexicographic optimization?.

Answered

Comments

4 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff 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?.
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi José Miguel,

    It is possible by using multi objective environments, see here.

    Best regards,
    Jaromił

    1
  • José Miguel Quesada Pérez
    Gurobi-versary
    First Question
    First Comment

    Thank you Jaromił

    I tried using the function Model.getMultiobjEnv (in Java), and it is not working as expected. I have tried to use the following programming flows without making Gurobi change its behavior when solving my second objective.

     

    OPTION 1

    model = new GRBModel(env);
    GRBEnv secondaryEnv = model.getMultiobjEnv(1);
    secondaryEnv.set(GRB.DoubleParam.TimeLimit, 15);
    secondaryEnv.set(GRB.DoubleParam.MIPGap, 0.01);
    secondaryEnv.set(GRB.IntParam.OutputFlag, 0);
    createFlowModel()  // function that creates the lexicographic model
    model.update();

     

    OPTION 2

    model = new GRBModel(env);
    createFlowModel()  // function that creates the lexicographic model
    GRBEnv secondaryEnv = model.getMultiobjEnv(1);
    secondaryEnv.set(GRB.DoubleParam.TimeLimit, 15);
    secondaryEnv.set(GRB.DoubleParam.MIPGap, 0.01);
    secondaryEnv.set(GRB.IntParam.OutputFlag, 0);
    model.update();

     

     

    Is there any indication as of the moment at which I need to change the environment?

    Thanks you

    José Miguel

     

     

     

     

     

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi José Miguel,

    Both of your options should work. It is possible that the parameters you set don't have any visible influence on the solution behavior of your second objective. The changed parameters will also not be displayed. In order to check whether your approach really works try setting, e.g., the Presolve parameter to 0 via \(\texttt{secondaryEnv.set(GRB.IntParam.Presolve,0)}\), which should have a visible impact on the solution process of your second objective.

    Please note that the OutputFlag parameter, which you set for your secondary environment is overwritten by the default OutputFlag parameter of the overall environment.

    Best regards,
    Jaromił

    0

Post is closed for comments.