[Cbc] readLp fails to read LP problem without 'subjject to'

Kish Shen kish.shen at gmail.com
Mon Feb 26 12:07:06 EST 2018


Sorry, I should have included this in my last post:

I get a different error message when I try to read the same LP problem
(with no Subject to section) with standalone Cbc:

[kshn at hermes Eplex]$
/mnt/decisal/third_party/Eclipse_6.2_28/Eplex/Cbc/x86_64_linux/bin/cbc
testlp
Welcome to the CBC MILP Solver
Version: 2.9
Build Date: Feb 12 2018
Revision Number: 2362

command line -
/mnt/decisal/third_party/Eclipse_6.2_28/Eplex/Cbc/x86_64_linux/bin/cbc
testlp (default strategy 1)
At line 1 \ENCODING=ISO-8859-1
Unknown image \ENCODING=ISO-8859-1 at line 1 of file ./testlp
Coin0008I  read with -2 errors
There were -2 errors on input
Total time (CPU seconds):       0.00   (Wallclock seconds):       0.00


Is this because Cbc was unable to recognise the file as LP format due to
the missing 'Subject to' section?

Kish


On Mon, Feb 26, 2018 at 4:50 PM, Kish Shen <kish.shen at gmail.com> wrote:

> Hi,
>
> I am unable to read the following simple LP file with readLp() using Cbc:
>
> \ENCODING=ISO-8859-1
> \Problem name: eclipse
>
> Minimize
>  obj: - 2 x1 - x2 - x3
> Bounds
>  0 <= x1 <= 1
>  0 <= x2 <= 1
>  0 <= x3 <= 1
> SOS
>  s1: S1 ::  x1 : 1  x2 : 2  x3 : 3
> End
>
> I get the message:
>
> [kshn at hermes Eplex]$ ./cbcreadlp
>  ### ERROR: Change MAX_OBJECTIVES to larger number.
>
> I think the message starting from '###' comes from CoinLpIO.cpp, in
> read_moniom_obj:
>
>     if (*num_objectives == MAX_OBJECTIVES){
>        char str[8192];
>        sprintf(str,"### ERROR: Too many objective functions.\n");
>        sprintf(str,"### ERROR: Change MAX_OBJECTIVES to larger number.\n");
>        throw CoinError(str, "read_monom_obj", "CoinLpIO", __FILE__,
> __LINE__);
>     }
>
> abd is because there is no 'subject to' section, as the only constraints
> on this problem is the SOS. When I added a 'Subject to' line following the
> objective, the file was read.
>
> I include a program to reproduce this problem, and the above lp problem
> with the filename the program uses.
>
> The LP file was generated by CPLEX, and it is able to read the file back
> in.
>
> Thanks and cheers,
>
> Kish
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20180226/cd1b619d/attachment.html>


More information about the Cbc mailing list