[Cbc] Fwd: SOS gramar for LP file for CBC
Andres Sommerhoff
sommerhoff at gmail.com
Fri May 18 15:23:18 EDT 2012
Hello, somebody knows how do you use SOS with a LP format file read by CBC?
I have tried several form of SOS grammatics, but CBC fails to interpret the
LP file. For example, if I use the following simplified LP file:
MINIMIZE
Obj: +1000 A1 +1200 A2 +1500 A3 +1200 B1 +1300 B2 +1400 B3 +1100 C1 +1200
C2 +1300 C3
SUBJECT TO
//+1 A1 +1 A2 +1 A3 = 1 //Should not be necessary if using SOS, I have
tried this without comments also.
//+1 B1 +1 B2 +1 B3 = 1 //Should not be necessary if using SOS, I have
tried this without comments also.
//+1 C1 +1 C2 +1 C3 = 1 //Should not be necessary if using SOS, I have
tried this without comments also.
+10 A1 +15 B1 +3 C1 >= 3
+10 A2 +15 B2 +3 C2 >= 10
+10 A3 +15 B3 +3 C3 >= 3
+10 A1 +15 B1 +3 C1 <= 15
+10 A2 +15 B2 +3 C2 <= 15
+10 A3 +15 B3 +3 C3 <= 15
BINARY
A1 A2 A3 B1 B2 B3 C1 C2 C3
SOS
set1: S1:: A1 A2 A3
set2: S1:: B1 B2 B3
set3: S1:: C1 C2 C3
END
However, I get the following when trying to read the previous LP file:
Coin3007W ### CoinLpIO::readLp(): Binary variable SOS does not appear in
objective function or constraints
Coin3007W ### CoinLpIO::readLp(): Binary variable set1: does not appear in
objective function or constraints
Coin3007W ### CoinLpIO::readLp(): Binary variable S1:: does not appear in
objective function or constraints
Coin3007W ### CoinLpIO::readLp(): Binary variable set2: does not appear in
objective function or constraints
Coin3007W ### CoinLpIO::readLp(): Binary variable set3: does not appear in
objective function or constraints
Coin3007W ### CoinLpIO::is_invalid_name(): Name set1: contains illegal
character ':'
Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[10]: set1:
Coin3007W ### CoinLpIO::is_invalid_name(): Name S1:: contains illegal
character ':'
Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[11]: S1::
Coin3007W ### CoinLpIO::is_invalid_name(): Name set2: contains illegal
character ':'
Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[12]: set2:
Coin3007W ### CoinLpIO::is_invalid_name(): Name set3: contains illegal
character ':'
Coin3007W ### CoinLpIO::are_invalid_names(): Invalid name: vnames[13]: set3:
Coin3007W ### CoinLpIO::readLp(): Invalid column names
I have tried also other forms of SOS but no good results. Unfortunately,
I'm fix to LP (because I'm using OpenSolver for Excel) without chances for
using MPS format (that I have seen few CBC examples of SOS for MPS).
Somebody knows what is the correct grammar for SOS with LP files in
coin-OR? Where is the c++ **source** file where an LP file is processed? (I
have searched it but unsuccessfully)
I will appreciate if anybody can give me a hand on this. Thank you in
advance.
Best regards,
Andres Sommerhoff
PS: I have tried with CBC version 2.7.1 and 2.7.5 compiled for windows.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20120518/5a86c7f7/attachment.html>
More information about the Cbc
mailing list