[Coin-discuss] How to create a .mps file?
Matthew Saltzman
mjs at ces.clemson.edu
Wed Feb 16 08:14:59 EST 2005
On Wed, 16 Feb 2005, Agnes Thomas wrote:
> Hi,
> I'm working on the COIN/Cbc library in order to write a Branch-and-cut
> algorithm. I know the existing programs use .mps files to read a
> model. Is any program existing in order to read a model and create the
> corresponding Mps file? Or do I have to write a C++ program that
> creates the Mps file corresponding to a model? Does anyone know how
> were created the .mps files in the COIN/Mps/Sample directory? Are they
> hand-writing?
> Thanx,
> Agi
Agi-
When you say "read a model", in what form is your model?
What usually happens is this:
At some point, you generally have a source of data for your model, but it
is in a database or spreadsheet or some specialized format produced by a
report writer. As there are no standard formats for such data, one would
need to write a program to read that data and produce either input for a
modeling system like AMPL or an MPS file.
If you already have the modeling-language format, you can usually use the
modeling system to automatically produce the MPS file. If not, you will
need to write a program to do so yourself.
If you are writing your own program, you can use COIN-OR libraries to help
you. You write the program to read your data or query your database and
load your problem in an OSI model or CoinPackedMatrix and some vectors.
You can then call CoinMpsIO::writeMps() to produce the MPS file. That
way, you don't need to worry about the ugly details of MPS format.
The other possibility is to skip the MPS file completely. Once you've
read your input data and construced the OSI model, you can simply pass it
directly to your solver.
I believe the files in COIN/Mps/Sample include a few small MIPLib problems
and some files that were created by hand or by excerpting pieces of the
MIPLib problems. There are a couple of larger ones that I'm not sure of
the origin of, but I would guess that anything over a couple thousand
characters or so is machine-generated.
Francois Margot and Robin Lougee-Heimer already posted the link
http://www-306.ibm.com/software/data/bi/osl/pubs/Library/featur11.htm for
details on MPS format.
--
Matthew Saltzman
Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs
More information about the Coin-discuss
mailing list