[Clp] constant in MPS objective

John J Forrest jjforre at us.ibm.com
Mon Feb 16 04:56:39 EST 2009


I don't have a copy of an MPSX manual to hand.  Can someone who has an MPSX
manual check this out?  OSL behaves in the same way as Clp, and I am sure
that would have conformed to MPSX standards.

Thanks

John Forrest


                                                                                                                         
  From:       "William H. Patton" <pattonwh at comcast.net>                                                                 
                                                                                                                         
  To:         <clp at list.coin-or.org>                                                                                     
                                                                                                                         
  Date:       02/15/2009 10:45 AM                                                                                        
                                                                                                                         
  Subject:    [Clp]  constant in MPS objective                                                                           
                                                                                                                         






CLP interprets a constant in the objective with the opposite sign compared
to lp_solve and glpsol. I think they got it right.

NAME          ex1c
ROWS
 N  OBJROW
 L  C1
 L  R2
COLUMNS
    x1        OBJROW    1.             C1        2.
    x1        R2         -4.
    x2        OBJROW     -2.           C1        1.
    x2        R2        4.
RHS
    RHS       OBJROW     +10.          C1        5.
    RHS       R2        5.
ENDATA

Or

NAME          ex1b
ROWS
 N  OBJROW
 L  C1
 L  R2
COLUMNS
    x1        OBJROW    1.             C1        2.
    x1        R2         -4.
    x2        OBJROW     -2.           C1        1.
    x2        R2        4.
RHS
    RHS       OBJROW     -10.          C1        5.
    RHS       R2        5.
ENDATA

Solve oppositely to lp_solve
Clp:import ex1b.MPS
At line 1 NAME          ex1b
At line 2 ROWS
At line 6 COLUMNS
At line 11 RHS
At line 14 ENDATA
Problem ex1b has 2 rows, 2 columns and 4 elements
Model was imported from .\ex1b.MPS in 0 seconds
Clp:solve
0  Obj 10 Dual inf 2 (1)
2  Obj 6.25
Optimal - objective value 6.25
Optimal objective 6.25 - 2 iterations time 0.002
Clp:
Clp:import ex1c.MPS
At line 1 NAME          ex1c
At line 2 ROWS
At line 6 COLUMNS
At line 11 RHS
At line 14 ENDATA
Problem ex1c has 2 rows, 2 columns and 4 elements
Model was imported from .\ex1c.MPS in 0 seconds
Clp:solve
0  Obj -10 Dual inf 2 (1)
2  Obj -13.75
Optimal - objective value -13.75
Optimal objective -13.75 - 2 iterations time 0.002
Clp:

==============================================
\Jun>lp_solve -mps ex1b.mps

Value of objective function: -13.75000000

Actual values of the variables:
x1                           1.25
x2                            2.5

\Jun>lp_solve -mps ex1c.mps

Value of objective function: 6.25000000

Actual values of the variables:
x1                           1.25
x2                            2.5

\Jun>

==============================================
\glpk\glpk-4.8>glpsol ex1b.mps
lpx_read_mps: reading problem data from `ex1b.mps'...
lpx_read_mps: problem ex1b
lpx_read_mps: 3 rows, 2 columns, 6 non-zeros
lpx_read_mps: 14 cards were read
lpx_simplex: original LP has 3 rows, 2 columns, 6 non-zeros
lpx_simplex: presolved LP has 2 rows, 2 columns, 4 non-zeros
lpx_adv_basis: size of triangular part = 2
*     0:   objval = -1.000000000e+001   infeas =  0.000000000e+000 (0)
*     2:   objval = -1.375000000e+001   infeas =  0.000000000e+000 (0)
OPTIMAL SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.1M (91756 bytes)

\glpk\glpk-4.8>
\glpk\glpk-4.8>glpsol ex1c.mps
lpx_read_mps: reading problem data from `ex1c.mps'...
lpx_read_mps: problem ex1c
lpx_read_mps: 3 rows, 2 columns, 6 non-zeros
lpx_read_mps: 14 cards were read
lpx_simplex: original LP has 3 rows, 2 columns, 6 non-zeros
lpx_simplex: presolved LP has 2 rows, 2 columns, 4 non-zeros
lpx_adv_basis: size of triangular part = 2
*     0:   objval =  1.000000000e+001   infeas =  0.000000000e+000 (0)
*     2:   objval =  6.250000000e+000   infeas =  0.000000000e+000 (0)
OPTIMAL SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.1M (91756 bytes)

\glpk\glpk-4.8>

William

_______________________________________________
Clp mailing list
Clp at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/clp

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20090216/d59771eb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20090216/d59771eb/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/clp/attachments/20090216/d59771eb/attachment-0001.gif>


More information about the Clp mailing list