Cbc
Cbc copied to clipboard
Incorrectly detects unbounded with SOS1 constraint with non-binary variable
In the following problem: max x s.t. [x, y] in SOS1 y == 1 which is encoded in Cbc with:
Cbc_Model *model = Cbc_newModel();
CoinBigIndex start[] = {0, 0, 0};
int rowindex[] = {};
double value[] = {};
double collb[] = {-INFINITY,1.0};
double colub[] = {INFINITY,1.0};
double obj[] = {1.0,0.0};
double rowlb[] = {};
double rowub[] = {};
int sosrowstart[] = {0,2};
int soscolindex[] = {0,1};
double sosobj[] = {2.0,1.0};
Cbc_loadProblem(model, 2, 0, start, rowindex, value, collb, colub, obj, rowlb, rowub);
Cbc_addSOS(model, 1, sosrowstart, soscolindex, sosobj, 1);
Cbc outputs
Problem is unbounded - 0.00 seconds
Total time (CPU seconds): 0.00 (Wallclock seconds): 0.00
While the problem is expected to be bounded with optimal solution (0, 1). Indeed, as y is nonzero, the SOS1 constraint forces x to be zero. I have noticed similar issues with larger problems. The problem seem to occur whenever the variables of the SOS1 constraint are not all binary.
Benoit,
I think I have fixed problem. I can put in master - what version of Cbc are you using?
John Forrest
On 12/02/2021 14:39, Benoît Legat wrote:
In the following problem: max x s.t. [x, y] in SOS1 y >= 1 which is encoded in Cbc with:
|Cbc_Model *model = Cbc_newModel(); CoinBigIndex start[] = {0, 0, 0}; int rowindex[] = {}; double value[] = {}; double collb[] = {-INFINITY,1.0}; double colub[] = {INFINITY,1.0}; double obj[] = {1.0,0.0}; double rowlb[] = {}; double rowub[] = {}; int sosrowstart[] = {0,2}; int soscolindex[] = {0,1}; double sosobj[] = {2.0,1.0}; Cbc_loadProblem(model, 2, 0, start, rowindex, value, collb, colub, obj, rowlb, rowub); Cbc_addSOS(model, 1, sosrowstart, soscolindex, sosobj, 1); |
Cbc outputs
|Problem is unbounded - 0.00 seconds Total time (CPU seconds): 0.00 (Wallclock seconds): 0.00 |
While the problem is expected to be bounded with optimal solution (0, 1). Indeed, as y is nonzero, the SOS1 constraint forces x to be zero. I have noticed similar issues with larger problems. The problem seem to occur whenever the variables of the SOS1 constraint are not all binary.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coin-or/Cbc/issues/363, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHFHMEGVWMG6A4KJ333S6U4RTANCNFSM4XQZLH3Q.
I think I have fixed problem
Glad to read that !
what version of Cbc are you using?
I'm using the Julia wrapper which is using Cbc v2.10.3. Do you think updating to v2.10.5 would fix it ?
Benoît,
v2.10.5 would have same problem. I will update CbcSOS.cpp in master and send a version of CbcSOS.cpp (suitable for v2.10) just to you. Tell me if you get problems on larger models.
When I tried to reproduce the error using an mps file and standalone cbc executable - the error did not occur.
John Forrest
On 12/02/2021 23:14, Benoît Legat wrote:
I'm using the Julia wrapper https://github.com/jump-dev/Cbc.jl which is using Cbc v2.10.3. Do you think updating to v2.10.5 would fix it ?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/coin-or/Cbc/issues/363#issuecomment-778506730, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHG5UACU6NFES2Z4V63S6WY43ANCNFSM4XQZLH3Q.