In my JuMP model, the LP file preserves the original variable names, but the MPS file appears to rename them, so how can I map the Gurobi .sol solution back to the original JuMP variables?

Hi everyone,

I’m generating both .lp and .mps files from the same JuMP model using Gurobi.

In the LP file, the original JuMP variable names are preserved, for example:

1200 x2[1,(1,_0)]
- 41054.62117964038 B2[1,(1,_0)]
- 0.15 Tnk[1,1]

However, in the MPS file, the variables/constraints appear to be renamed to generic names such as:

c0
c1
c2
...

I solve the MPS file on another machine using Gurobi and get a feasible solution in a .sol file.

My problem is that I want to map the .sol solution back to the original JuMP variables, such as:

x2[1,(1,_0)]
B2[1,(1,_0)]
Tnk[1,1]

but because the MPS file uses different/generic names, I’m not able to identify which solution variable corresponds to which original JuMP variable.

The model is generated in Julia, solved on another machine from the exported MPS, and then I want to analyze the solution back in my original Julia code.

Any recommended workflow for this would be helpful. Thanks!

This answer by Oscar showed up, could you try that? JuMP : how to read a lp problem from file (lp FORMAT) with variables names? - #2 by odow