The max objective problem in JuMP when written to an mps file is converted to a min type objective by flipping the signs. However, it didn’t do it for the bilinear terms in the objective.
Am I missing something?
Following is the MWE
model = Model()
# Define variables x1 and x2
@variable(model, x1 >= 0)
@variable(model, x2 >= 0)
# Define the bilinear objective function
@objective(model, Max, 3*x1 + 2*x2 + x1 * x2)
# Add the constraints
@constraint(model, x1^2 + x2^2 <= 10)
@constraint(model, x1 + x2 >= 1)
# Write the model to an mps file
write_to_file(model, "my_model.mps")
# Read the saved model
new_model = read_from_file("my_model.mps")
print(model)
# Max x1*x2 + 3 x1 + 2 x2
# Subject to
# x1 + x2 >= 1.0
# x1² + x2² <= 10.0
# x1 >= 0.0
# x2 >= 0.0
print(new_model)
# Min x1*x2 - 3 x1 - 2 x2
# Subject to
# c1 : x1 + x2 >= 1.0
# c1_1 : x1² + x2² <= 10.0
# x1 >= 0.0
# x2 >= 0.0