[Clp] Problem with basic optimization both in C++ and reading from mps

Bo Jensen jensen.bo at gmail.com
Fri Feb 20 03:08:25 EST 2015


A fast guess :

You specify the problem to be maximized in the LP format, but in the MPS
format your objective coefficient is positive. MPS format doesn't specify
direction of optimization, but most solvers assume minimize. Could it be
that you're mixing up maximize and minimize ?

On Fri, Feb 20, 2015 at 8:44 AM, Andy Somogyi <andy.somogyi at gmail.com>
wrote:

> Hi All,
>
> I’m trying to use Clp, works fine for the built-in examples, but I can’t
> seem to get this simple attached problem to work. I’ve tried hard-coding
> this in C++, following the modify.cpp example, and I’ve tried reading it
> form a mps file, using either the command line clp program, or direction
> into the ClpModel object via readMps.
>
> It always results in a zero solution, but this problem has an analytic
> solution of [1, 1, 1, 0], and Mathematica finds this solution just fine if
> I import the mps and use NMinimise.
>
> Any ideas why this simple problem won’t converge to the correct solution
> in Clp.
>
> Thanks
>
> Here is the mps:
>
> ************************************************************************
> *
> *  Maximize
> *  objective1_objf:
> *  + 1.0 R2
> *
> * Subject To
> *  A: +R1      -X1 -X2 = 0
> *  B:     -R2  +X1 +X2 = 0
> *
> *  Bounds
> *  0.0 <= R1 <= 1.0
> *  0.0 <= R2 <= +inf
> *  0.0 <= X1 <= +inf
> *  0.0 <= X2 <= +inf
> *
> ************************************************************************
> NAME          EXAMPLE
> ROWS
>  N  OBJ
>  E  A
>  E  B
> COLUMNS
>     R1        A                  1.0
>     R2        OBJ                1.0   B                 -1.0
>     X1        A                 -1.0   B                  1.0
>     X2        A                 -1.0   B                  1.0
>
> RHS
>     RHS1      A                  0
>     RHS1      B                  0
>
> BOUNDS
>  LO BND1      R1                 0
>  UP BND1      R1                 1
>  LO BND1      R2                 0
>  LO BND1      X1                 0
>  LO BND1      X2                 0
> ENDATA
>
>
> _______________________________________________
> 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/20150220/64eb86f2/attachment.html>


More information about the Clp mailing list