GAMS and the MPS format

Frequently asked questions about GAMS

Moderator: aileen

Forum rules
Please ask questions in the other sub-forums
Locked
aileen
User
User
Posts: 102
Joined: 2 months ago

GAMS and the MPS format

Post by aileen » 1 month ago

How do I import and export a model instance formated as a MPS file?

aileen
User
User
Posts: 102
Joined: 2 months ago

Re: GAMS and the MPS format

Post by aileen » 1 month ago

GAMS can import and export model instances formated as a MPS file:
  • Export from GAMS:
    • The "solver" Convert (with option CplexMPS or fixed) writes an MPS file with trivial names (x1,x2,…,e1,e2,…), but it can also write a mapping file (use the Convert option dict) that allows you to map the trivial names to your name space.
    • Most LP/MIP solver have an option to write out an MPS file. Some of them even support to write the GAMS names to the MPS file, e.g.: CPLEX options (names yes, writemps mpsfile) or COINCBC options (names 1, writemps mpsfile).
  • Import to GAMS:
    • The command line tool mps2gms creates an almost generic gms file and a gdx file with the matrix data. mps2gms is part of any current GAMS distribution, please enter mps2gms at a command line prompt to get more information about it.
    • If you are a licensed academic user or hold a license to GAMS/SCIP you can use GAMS/SCIP to read MPS and LP files and convert them to scalar GAMS model files via the gams/interactive option in scip.opt: gams/interactive = "read somemodel.lp write genprob somemodel.gms quit".

Locked