2
$\begingroup$

Are you aware of any tutorial that can help me learn on how to reconstruct the objective function and constraints from a MPS file once it's loaded in MATLAB. I can load the mps file given to me and solve using lpsolve. But I would like to run a sensitivity test by modifying the RHS of a certain constraint. Therefore, it would be helpful if I could reconstruct the constraints from the MPS file.

$\endgroup$
4
  • $\begingroup$ Can't you query/modify the RHS value from whichever solver you are using directly? The MPS format is described here. Be aware, MPS was not intended to be read by humans, so making modifications to such files is not user-friendly. $\endgroup$
    – mtanneau
    Nov 18, 2020 at 23:34
  • 1
    $\begingroup$ Your best bet is probably to read the MPS file and write the model out as a LP file again. LP files are non-standard (i.e. you cannot take a CPLEX LP file and give it to Gurobi), however they are human readable and you can then look at them. $\endgroup$
    – Richard
    Nov 20, 2020 at 8:49
  • $\begingroup$ Thank you, would be able to tell how to output CPLEX LP file from within MATLAB? $\endgroup$
    – S_Scouse
    Nov 23, 2020 at 20:13
  • $\begingroup$ I work for Gurobi, so I'd suggest that you use that :) For Gurobi, you can use this: gurobi.com/documentation/9.1/refman/matlab_grb_write.html $\endgroup$
    – Richard
    Nov 25, 2020 at 8:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.