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

Andy Somogyi andy.somogyi at gmail.com
Fri Feb 20 02:44:30 EST 2015


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




More information about the Clp mailing list