help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] GLPK reading <LP-file> problem


From: Andrew Makhorin
Subject: Re: [Help-glpk] GLPK reading <LP-file> problem
Date: Fri, 16 Jun 2017 16:34:06 +0300

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 <address@hidden>
> 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 <address@hidden>
>         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.
>                 >
>                 
>                 :)
>                 
>         
>         
> 
> 





reply via email to

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