What class inherited from <span style="font-family: 'lucida Grande', Verdana, 'Microsoft YaHei'; line-height: 23px;">CglCutGenerator </span>should I to use? I can't find one to adjust my question which should add some cuts during function branchAndBound through the <span style="line-height: 1.5;">CbcEventHandler.</span><div><span style="line-height: 1.5;"><br></span></div><div>Best wishes.</div><div>Meng Chen</div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Haroldo Gambini Santos"<haroldo.santos@gmail.com>; </div><div><b>发送时间:</b> 2016年3月14日(星期一) 上午9:17</div><div><b>收件人:</b> "不入角蜗牛"<1164651620@qq.com>; "cbc"<cbc@list.coin-or.org>; </div><div><b>主题:</b> Re: [Cbc] How to add cuts?</div></div><div><br></div>Hi,<br>
<br>
You should specialize a CglCutGenerator class to implement cut
generation.<br>
<br>
Then you need to implement:<br>
generateCuts( const OsiSolverInterface &si, OsiCuts &cs,
const CglTreeInfo info )<br>
<br>
Use <i>si</i> to obtain the fractional solution and add discovered
cuts in <i>cs</i>.<br>
<br>
Cheers,<br>
<br>
Haroldo<br>
<br>
<div class="moz-cite-prefix">Em <span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="13-03-2016">13-03-2016</span> 22:07, 不入角蜗牛 escreveu:<br>
</div>
<blockquote cite="mid:tencent_13D7ECD60D13356E57750B10@qq.com" type="cite">
<div>
<div>Hello.</div>
<div>I try to use the class CbcEventHandler to add cuts to solve
my problem, but it doesn't work.</div>
<div>for example :</div>
<div>min: x2</div>
<div>s.t. x0 + x1 >= 1;</div>
<div> x1 + x2 >= 1;</div>
<div>x0,x1,x2 in {0,1}</div>
<div>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:</div>
<div><\code</div>
<div> auto refSolver = model->referenceSolver(); </div>
<div> CoinPackedVector solution_cut;</div>
<div> solution_cut.setVector(len,
&cols[cols.size()-len], &values[values.size()-len]);</div>
<div> refSolver->addRow(solution_cut,
rhs_lower.back(), rhs_upper.back());</div>
<div> model->resetToReferenceSolver();</div>
<div>code\> </div>
<div>But failed. I save the model as mps file and it can be read
as:</div>
<div> TITLE BLANK;</div>
<div> [ OBJROW] MIN = C<span style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204); z-index: 1; position: static;" t="7" onclick="return false;" data="0000002" isout="1">0000002</span>;</div>
<div> [ R<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000000">0000000</span>] C<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000000">0000000</span> + C<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000001">0000001</span> >= 1;</div>
<div> [ R<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000001">0000001</span>] C<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000001">0000001</span> + C<span style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204); z-index: 1; position: static;" t="7" onclick="return false;" data="0000002" isout="1">0000002</span> >= 1;</div>
<div> [ R<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000002">0000002</span>] C<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000000">0000000</span> = 0;</div>
<div> @BND( 0, C<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000000">0000000</span>, 0); @BND( 0, C<span style="border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: rgb(204, 204, 204); z-index: 1; position: static;" t="7" onclick="return false;" data="0000001" isout="1">0000001</span>, 0);</div>
<div> @BND( 0, C<span style="border-bottom:1px dashed #ccc;z-index:1" t="7" onclick="return false;" data="0000002">0000002</span>, 0);</div>
<div>Thanks.</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Cbc mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a>
<a class="moz-txt-link-freetext" href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/mailman/listinfo/cbc</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
==================================================
Haroldo Gambini Santos
D.Sc, Computer Science
Universidade Federal de Ouro Preto
<a class="moz-txt-link-freetext" href="http://www.decom.ufop.br/haroldo/" target="_blank">http://www.decom.ufop.br/haroldo/</a></pre>
<style type="text/css">.qmbox style, .qmbox script, .qmbox head, .qmbox link, .qmbox meta {display: none !important;}</style>