help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] MPS model has zero objective function in version 4_32


From: Andrew Makhorin
Subject: Re: [Help-glpk] MPS model has zero objective function in version 4_32
Date: Thu, 20 Nov 2008 01:28:42 +0300

> I am writing an identical GLPK problem out in MPS
> format and LP format from the API.  I then read and solve the models
> with glpsol.  The LP model solves correctly.  The MPS model solves but
> has objective function zero.  A similar behavior occurred in earlier
> version unless the parameter LPS_K_MPSOBJ was set to 1.  However, the
> function lpx_set_int_parm is no longer available in version 4.32.  How
> do I specify the objective function in the MPS model with version 4_32
> (and I assume the current version as well).  The following lines are
> the output of the LP and the MPS models solved with glpsol.
> Thanks

> glpsol_4_32 --freemps VRP100_best.mps
> glp_read_mps: reading problem data from `VRP100_best.mps'...
> glp_read_mps: problem VRP100_Best
> glp_read_mps: 102 rows, 9 columns, 108 non-zeros
> glp_read_mps: 8 integer columns, all of which are binary
> glp_read_mps: 232 records were read
> ipp_basic_tech:  102 row(s) and 9 column(s) removed
> ipp_reduce_bnds: 1 pass(es) made, 0 bound(s) reduced
> ipp_basic_tech:  0 row(s) and 0 column(s) removed
> ipp_reduce_coef: 1 pass(es) made, 0 coefficient(s) reduced
> Objective value = 0
> INTEGER OPTIMAL SOLUTION FOUND BY MIP PRESOLVER
> Time used:   0.0 secs
> Memory used: 0.1 Mb (61348 bytes)

> glpsol_4_32 --cpxlp VRP100_best.lp
> glp_read_lp: reading problem data from `VRP100_best.lp'...
> glp_read_lp: 101 rows, 9 columns, 108 non-zeros
> glp_read_lp: 8 integer columns, all of which are binary
> glp_read_lp: 134 lines were read
> ipp_basic_tech:  101 row(s) and 9 column(s) removed
> ipp_reduce_bnds: 1 pass(es) made, 0 bound(s) reduced
> ipp_basic_tech:  0 row(s) and 0 column(s) removed
> ipp_reduce_coef: 1 pass(es) made, 0 coefficient(s) reduced
> Objective value = 113800.9085
> INTEGER OPTIMAL SOLUTION FOUND BY MIP PRESOLVER
> Time used:   0.0 secs
> Memory used: 0.1 Mb (53324 bytes)

Unlike cplex lp format it is impossible to specify the objective in
mps format, so by default the first free row in mps file is considered
as the objective row. Currently on writing mps file glpsol writes
the objective only if there is no free rows in the model. I guess that
your model has free rows, so the objective row is not written; thus, on
reading mps file some wrong free row is used as the objective row.

To avoid the issue either remove all free rows from the problem object
before writing mps file or use the cplex lp format.

> However, the
> function lpx_set_int_parm is no longer available in version 4.32.

It is still available for backward compatibility. However you then
should use lpx_write_mps or lpx_write_freemps rather than glp_write_mps.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]