By default, the termination criteria (e.g. TimeLimit, SolutionLimit, etc.) for each pass in a hierarchical multiple-objective optimization are controlled by the parameters defined in the model environment. However, we provide a feature called multi-objective environments that allows you to create a Gurobi environment for each objective function and set parameters on those environments. Those settings will only affect the corresponding pass of the multi-objective optimization. Thus, for example, if the TimeLimit parameter for the model is 100, but you use a multi-objective environment to set the parameter to 10 for a particular multi-objective pass, then the multi-objective optimization will spend at most 10 seconds on that particular pass (and at most 100 seconds in total).
To create a multi-objective environment for a particular multi-objective pass,
getMultiobjEnv method from your language API (e.g.
in Python). The
index argument gives the index of the
multi-objective pass that you want to control.
Note that multi-objective environments are tied to a given multi-objective optimization pass and not to a given multi-objective function, so multi-objective environment 0 is always tied to the highest priority (possibly blended) objective, while multi-objective environment 1 is always tied to the second highest priority objective (if any). For details on how multiple objectives with the same priority are treated, please refer to the hierarchical objectives section.
Once you create multi-objective environments, they will be used for
every subsequent multi-objective optimization on that model. Use the
discardMultiobjEnvs method from your language API (e.g.
in Python) to revert back to default multi-objective optimization
We haven't attempted to generalize the notions of dual solutions or simplex bases for continuous multi-objective models, so you can't query attributes such as Pi, RC, VBasis, or CBasis for multi-objective solutions. Because of this, we've concluded that the most consistent result to return for attribute IsMIP is 1. Note, however, that several MIP-specific attributes such as ObjBound, ObjBoundC and MIPGap don't make sense for multi-objective models and are also not available.
Gurobi will only solve multi-objective models with strictly linear objectives. If the primary objective is quadratic or piecewise linear, the solve call will return an error.
When solving a continuous multi-objective model using a hierarchical approach, you have a choice of which optimization algorithm to use for the different passes (primal simplex, dual simplex, or barrier). The first pass will always use the algorithm specified in the Method parameter. The algorithm for subsequent passes is controlled by the MultiObjMethod parameter. This parameter has no effect for multi-objective MIP models. Note you can get finer-grained control over the algorithm choice using our multi-objective environment feature, by setting the Method parameter for individual objectives.
For the hierarchical approach, Gurobi will perform a conservative presolve step at the beginning of the multi-objective optimization, and a more aggressive presolve step at the beginning of each pass (assuming presolve hasn't been turned off). You can optionally perform a more aggressive presolve step at the beginning of the multi-objective optimization by setting parameter MultiObjPre to value 2. This can help performance, but it makes a few simplifying assumptions that could lead to small degradations in the values achieved for lower-priority objectives.
The log file when using a hierarchical approach will show optimization progress for each pass in the process. You'll see log lines that look like this:
Multi-objectives: optimize objective 1 (Obj1Name) ... ... Multi-objectives: optimize objective 2 (weighted) ... ...For further details, please see section Multi-Objective Logging.
Callbacks are available for multi-objective optimization, but they are
a bit more involved than those for single-objective optimization.
When you are solving for a specific objective (either in one phase of
a hierarchical optimization or when solving a blended objective), you
will receive callbacks from the algorithm that solves that model: MIP
callbacks if the model is a MIP, and simplex or barrier callbacks if
the model is continuous. For a hierarchical objective, you will also
MULTIOBJ callback at the end of each phase that allows
you to query the current solution, the number of solutions found, and
the number of objectives that have been solved for at that point.
Refer to the Callback
discussion for further details.