Skip to main content

Removing an objective or getting dual variables with multiple objectives

Answered

Comments

3 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?.
  • Matthias Miltenberger
    • Gurobi Staff Gurobi Staff

    Hi Francois,

    To return back to a single-objective optimization you need to set model.NumObj=0, call model.update(), and then reset the primary objective function (model.setObjective).

    You can also query the current optimization mode using IsMultiObj

    I hope that helps.

    Cheers,
    Matthias

    0
  • Francois Lamothe
    • Gurobi-versary
    • First Comment
    • First Question

    Thanks it seems to work!

    0

Post is closed for comments.