help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Re: GNU LP format


From: Andrew Makhorin
Subject: [Help-glpk] Re: GNU LP format
Date: Thu, 7 Oct 2004 11:18:28 +0300

>I have just started using the glpk package. I like your GNU LP format
>but could not find a description for it. I have figured out more or
>less.  I used glpsol program to convert some mps files into glp format
>and I don't understand why the objective function is listed twice, like
>this:
>
>    ...
>    P LP MIN 4 3 9
>    N TESTPROB
>    R 1 F
>    R 2 U 5
>    R 3 L 10
>    R 4 S 7
>    C 1 D 0 4
>    C 2 D -1 1
>    C 3 L 0
>    A 0 1 1
>    A 0 2 4
>    A 0 3 9
>    A 1 1 1
>    A 1 2 4
>    A 1 3 9
>    A 2 1 1
>    A 2 2 1
>    A 3 1 1
>    A 3 3 1
>    A 4 2 -1
>    A 4 3 1
>    I 0 COST
>    ...
>
>Is it a bug or a feature? :-)

In your example the objective does not appear twice; you see the
objective (A 0 ...) and a free row (A 1 ...) which are just identical.
This is because in mps format the objective is specified by means of a
free row while in gnu lp format (as well as in glpk api) the objective
is a separate object (so, in gnu lp format you could change the objective
coefficients not changing the corresponding free row). When lpx_read_mps
reads mps file, by default it uses the first free row as the objective,
however, the free row itself is also included in the problem object.

Andrew Makhorin






reply via email to

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