• Gurobi Staff

This is expected behavior - the feasibility relaxation creates a single objective to minimize the solution's violation of the original constraints with respect to the specified metric. Note that only $$\texttt{minrelax=False}$$ is currently supported for multi-objective models.

To evaluate your multiple objectives at the feasibility relaxation's solution, you can store each objective function as a LinExpr object, then call LinExpr.getValue() once the feasibility relaxation finishes solving. For example, the following code

import gurobipy as gp# Build simple modelm = gp.Model()x = m.addVars(3, name='x')m.addConstr(x[0] >= 20)m.addConstr(x[1] >= 10)m.addConstr(x[2] >= 5)# Store objectives as LinExpr objectsobj1 = x[0] + x[2]obj2 = 2*x[1]# Solve feasibility relaxation (minrelax=False)# For illustrative purposes - our model is feasiblem.feasRelaxS(0, False, True, True)m.optimize()# Evaluate objectives at current solutionprint(f'obj1 = {obj1.getValue()}')print(f'obj2 = {obj2.getValue()}')

evaluates the two linear expressions given the feasibility relaxation solution:

obj1 = 25.0obj2 = 20.0

Yes, this is the kind of solution I was looking for. Thank you!