Re: GLPK reading <LP-file> problem

Andrew Makhorin <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <1497620046.4477.8.camel@corvax>
On Fri, 2017-06-16 at 07:59 -0500, Shuo Xu wrote:
> Hi, Andrew, 
> 
> I think I find a bug that:
> 
> I am using a special case that :
> 
>   I have a special matrix A with m-by-n, and write lp with
> glp_write_lp. 
> 
>   And, I read the written-lp file, the matrix A is not the same as the
> original matrix A.  
> 
> 
> So, would you like to see that case to help me? 

It happens if your instance has double-bounded rows, i.e. rows like
l <= ... <= u. Cplex lp format has no feature to specify such rows, so
glp_write_lp introduces additional rows and columns which are missing in
the original lp.

To avoid these troubles and keep the instance unchanged on reading it
from a file I recommend you to use glpk lp/mip format provided by the
api routines glp_read_prob and glp_write_prob.

> 
> 
> Shuo
> 
> 
> 
> 
> On Thu, Jun 15, 2017 at 9:55 AM, Shuo Xu <[email protected]>
> wrote:
>         thanks, Andrew, 
>         
>         
>         I think I can deal with this problem by re-assigning the
>         problem-name using glp_set_prob_name. 
>         
>         
>         Shuo
>         
>         
>         
>         
>         
>         On Thu, Jun 15, 2017 at 9:49 AM, Andrew Makhorin <[email protected]>
>         wrote:
>                 
>                 > well, as far I read the LP-file generated by glpk,
>                 it put the name in
>                 > the first line as
>                 > "
>                 > \* Problem: Level_1 *\
>                 >
>                 > Minimize
>                 >  obj: - 8 x_1..............................
>                 > "
>                 >
>                 > although this is just a comment line, but we (you)
>                 have put the
>                 > LP_Name here.
>                 >
>                 > So, I think this is the way to get a file name
>                 there.
>                 
>                 It is not a good idea, because it would be a
>                 non-standard feature.
>                 
>                 If you need to keep all problem components on reading
>                 the instance,
>                 which was previously written to a file with glpk, I'd
>                 recommend you
>                 using the glpk lp format.
>                 
>                 >
>                 >
>                 > So, it looks that <glp_write_lp> and <glp_read_lp>
>                 are not
>                 > compatible.
>                 >
>                 
>                 :)
>                 
>         
>         
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.