[Cbc] How to add cuts?
不入角蜗牛
1164651620 at qq.com
Sun Mar 13 21:07:53 EDT 2016
Hello.
I try to use the class CbcEventHandler to add cuts to solve my problem, but it doesn't work.
for example :
min: x2
s.t. x0 + x1 >= 1;
x1 + x2 >= 1;
x0,x1,x2 in {0,1}
Add the question normally. I get x0 = 1, x1 = 1 and x2 = 0. But when I try to add a cut x0 = 0 with codes:
<\code
auto refSolver = model->referenceSolver();
CoinPackedVector solution_cut;
solution_cut.setVector(len, &cols[cols.size()-len], &values[values.size()-len]);
refSolver->addRow(solution_cut, rhs_lower.back(), rhs_upper.back());
model->resetToReferenceSolver();
code\>
But failed. I save the model as mps file and it can be read as:
TITLE BLANK;
[ OBJROW] MIN = C0000002;
[ R0000000] C0000000 + C0000001 >= 1;
[ R0000001] C0000001 + C0000002 >= 1;
[ R0000002] C0000000 = 0;
@BND( 0, C0000000, 0); @BND( 0, C0000001, 0);
@BND( 0, C0000002, 0);
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20160314/699f6ff8/attachment.html>
More information about the Cbc
mailing list