If the objective sense (minimize or maximize) is not specified in the .mps file, the Rose solver will default to minimizing the objective function. Some model building tools omit the sense information when generating .mps files, so you may need to specify the direction yourself. To ensure the solver maximizes the objective function, include the following line at the top of your .mps file.
OBJSENSE MAX
To verify that the Rose solver used the correct sense, check the 'sense' field under the 'solve information' tab in the web output. This field will indicate whether the solver minimized or maximized the objective.
If you want the solver to minimize the objective function explicitly, you can add this line to the top of your .mps file.
OBJSENSE MIN
Note that .mps files are stored in plain text and can be opened with any text editor.
Why is the sign on my objective function value reversed? A note for Julia users.
Some modeling languages, such as Julia, always export optimization problems to the .mps file format as minimization problems. If your original problem is specified as a maximization, Julia will first invert the objective function by multiplying it by -1 before exporting it.
For example, if you are working with the maximization problem
$$max z = x + 2y$$
Julia will export the problem as
$$min z = -x - 2y$$
This transformation will allow the model to work correctly. You will still get the correct decision variable values, but be aware that the sign of the optimal objective value will be reversed (negative instead of positive, or positive instead of negative for other problems).
Comments
0 comments
Please sign in to leave a comment.