[MathOptFormat.jl] Error when reading MPS file: objective functions with constant terms

The objective function of a math programming problem usually does not have constant terms. But occasionally, MILP models processed by the solvers (CPLEX in this case) have constants in objective functions. When JuMP.read_from_file is called, it will produce the following error message:

ERROR: ROW name obj not recognised. Is it in the ROWS field?

This is a message from this file MathOptFormat.jl/MPS.jl at master · odow/MathOptFormat.jl · GitHub

I have to write codes to remove the constant term in objective from mps files. But it would be nice that MathOptFormat package can handle this (e.g., remove the constants). Thanks!

Thanks for the report, that looks like a bug.

I’ve opened an issue so we can track: Support objective constants in MPS · Issue #1247 · jump-dev/MathOptInterface.jl · GitHub. If you want to start contributing to JuMP, it’s a good first issue to tackle.