[Coin-discuss] problem of solving a model with SOS2 in CBC
John J Forrest
jjforre at us.ibm.com
Sat Sep 9 05:00:46 EDT 2006
The CoinMpsIO reader does not know how to pass SOS info to solvers.
The attached driver gives correct answer.
John Forrest
(See attached file: sos2.cpp)
Hongxia Zhao
<zhongxia at eng.buf
falo.edu> To
Sent by: coin-discuss at list.coin-or.org
coin-discuss-boun cc
ces at list.coin-or.
org Subject
[Coin-discuss] problem of solving a
model with SOS2 in CBC
09/08/06 02:55 PM
Please respond to
Discussions about
open source
software for
Operations
Research
<coin-discuss at lis
t.coin-or.org>
Hello,
I am trying to solve the following simple problem with SOS2 constraint
using CBC,
------------------------------
min -10x1 + 5x2 -10x3
s.t. x1 + x2 + x3 = 2
x1 <= 1
x3 <= 1
x1, x2, x3 >= 0
{ x1, x2, x3 } is SOS2
---------------------------------
I don't want to use binary variables to model the problem. So the MPS file
(sos.mps) of this problem is
*=============================================================
NAME
ROWS
N obj
E c1
L c2
L c3
COLUMNS
x1 obj -10 c1 1
x1 c2 1
x2 obj 5 c1 1
x3 obj -10 c1 1
x3 c3 1
RHS
rhs c1 2 c2 1
rhs c3 1
SOS
S2
x1
x2
x3
ENDATA
*============================================================
I tried to solve this problem on windows by using CbcExamplesSample2.exe
> CbcExamplesSample2.exe sos.mps
The solution I got has objective value -20 which is not correct. If the
SOS2 constraint was considered correctly, the solution should be
x1 = x2 = 1, obj = -5.
My question is:
Can Cbc solve this kind of problem with SOS2 constraint and without using
binary variable correctly? If so, how?
Thanks,
Christy
_______________________________________________
Coin-discuss mailing list
Coin-discuss at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-discuss
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sos2.cpp
Type: application/octet-stream
Size: 3454 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20060909/17d12aba/attachment.obj>
More information about the Coin-discuss
mailing list