<div dir="ltr">Hi Ambros,<div><br></div><div>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">What does SCIP_DECL_CONSENFOPS do in the case that the solution is infeasible?  If you only return SCIP_INFEASIBLE and no other constraint handler takes some action, then the branching rules must be called to resolve the infeasibility.  In your case inference branching is called twice.</span>

</blockquote><div><br></div><div>When the solution is infeasible, the 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">SCIP_DECL_CONSENFOPS</span> just set result as 

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">SCIP_INFEASIBLE</span> and take no other action. After this, instead of calling the "inference branching", I would like SCIP to call the "<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">CVRPBranchingRule" that I wrote.</span></div></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Arriving at the enfops callback probably means that the LP could not be solved, typically due to numerical problems.  If you only have integer variables then in the worst case the subtree below is solved by complete enumeration.  But you seem to be lucky: inference branching is only called twice on the pseudo solution, so either the subtree can be pruned early or the numerical troubles disapppear after branching.</span></span></blockquote><div><br></div><div>

<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">But this is strange, because if the solution is integer and infeasible, then, since Im implementing a branch-and-cut, the constraint handler should be able to find a cut that separates this solution from the feasible set.<span> </span></span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px;background-color:rgb(255,255,255);float:none;display:inline"><span> Checking the solutions that arrive at </span>SCIP_DECL_CONSENFOPS, then indeed, they are not integer solutions. So, instead of calling the <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial;font-size:12.8px;background-color:rgb(255,255,255);float:none;display:inline">CVRPBranchingRule" to solve the integrality, it is calling the <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"inference branching".</span></span></span></div><div><br></div><div>Thanks,</div><div>Matheus </div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-05-22 2:51 GMT-03:00 Ambros Gleixner <span dir="ltr"><<a href="mailto:gleixner@zib.de" target="_blank">gleixner@zib.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matheus,<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the SCIP_DECL_CONSENFOLP, SCIP_DECL_CONSENFOPS and SCIP_DECL_CONSCHECK check if the current solution is a feasible solution<br>
</blockquote>
<br></span>
What does SCIP_DECL_CONSENFOPS do in the case that the solution is infeasible?  If you only return SCIP_INFEASIBLE and no other constraint handler takes some action, then the branching rules must be called to resolve the infeasibility.  In your case inference branching is called twice.<br>
<br>
Arriving at the enfops callback probably means that the LP could not be solved, typically due to numerical problems.  If you only have integer variables then in the worst case the subtree below is solved by complete enumeration.  But you seem to be lucky: inference branching is only called twice on the pseudo solution, so either the subtree can be pruned early or the numerical troubles disapppear after branching.<br>
<br>
Maybe you can investigate from the log (increase display/verblevel) if some of the LPs are unsolved.<br>
<br>
Best,<br>
Ambros<div><div class="h5"><br>
<br>
Am 22.05.2018 um 02:14 schrieb Matheus Ota:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Ambros,<br>
<br>
Thank you for replying! Yes, I have read the Constraint Handler and the Branching Rule tutorials. Let me give more details:<br>
<br>
- These are the parameters I chose for the Constraint Handler:<br>
sepapriority: 1000000<br>
enfopriority: 1000000<br>
checkpriority: 1000000<br>
sepafreq: 1<br>
propfreq: -1<br>
eagerfreq: 1<br>
maxprerounds: 0<br>
<br>
- And these are the parameters for the Branching Rule:<br>
priority: 200000<br>
maxdepth: -1<br>
maxbounddist: 1<br>
<br>
- the SCIP_DECL_CONSENFOLP, SCIP_DECL_CONSENFOPS and SCIP_DECL_CONSCHECK check if the current solution is a feasible solution (obeys the constraints and is integer).<br>
I tried to check here only if the solution obeys the constraints, ignoring the integrality constraint. But my problem remained: in the SCIP_DECL_BRANCHEXECPS method of the branching rule, the solution that gets there is made only of integers. So no branching is performed.<br>
<br>
- Still, I'm able to solve correctly the problem because other branching is performed. As shown by the output of SCIPprintStatistics():<br>
Branching Rules    :   ExecTime  SetupTime   BranchLP  BranchExt   BranchPS    Cutoffs    DomReds       Cuts      Conss   Children<br>
   CVRPBranchingRule:       0.00       0.00          0          0          0          0          0          0          0          0<br>
   allfullstrong    :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   cloud            :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   distribution     :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   fullstrong       :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   inference        :       0.00       0.00          0          0          2          0          0          0          0          4<br>
   leastinf         :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   mostinf          :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   multaggr         :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   nodereopt        :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   pscost           :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   random           :       0.00       0.00          0          0          0          0          0          0          0          0<br>
   relpscost        :       3.06       0.00         71          0          0          0        100          0          0         86<br>
<br>
I'm kinda lost here. Could you share your thoughts?<br>
<br>
Thanks,<br>
Matheus<br>
<br>
<br>
<br>
<br></div></div>
2018-05-21 16:44 GMT-03:00 Ambros Gleixner <<a href="mailto:gleixner@zib.de" target="_blank">gleixner@zib.de</a> <mailto:<a href="mailto:gleixner@zib.de" target="_blank">gleixner@zib.de</a>>>:<span class=""><br>
<br>
    Hi Matheus,<br>
<br>
    Have you read the priority section of the "How to add constraint<br>
    handlers?" at<br>
<br>
    <a href="http://scip.zib.de/doc-5.0.1/html/CONS.php" rel="noreferrer" target="_blank">http://scip.zib.de/doc-5.0.1/h<wbr>tml/CONS.php</a><br>
    <<a href="http://scip.zib.de/doc-5.0.1/html/CONS.php" rel="noreferrer" target="_blank">http://scip.zib.de/doc-5.0.1/<wbr>html/CONS.php</a>><br>
<br>
    Chances are your CONSHDLR_ENFOPRIORITY is set to "after<br>
    integrality". Does that help?<br>
<br>
    Best,<br>
    Ambros<br>
<br>
<br>
<br>
<br>
<br>
<br>
    Am 19.05.2018 um 21:10 schrieb Matheus Ota:<br>
<br>
        Hi Again,<br>
<br>
        My bad, I made a mistake in my calculations. Actually it is<br>
        being called in a integer but infeasible solution (that breaks<br>
        the capacity constraint). But still, from my understanding,<br>
        branching should be done to fix the integrality constraints, the<br>
        other restrictions should be fixed by the constraint handler.<br>
<br>
        Thanks,<br>
        Matheus<br>
<br>
        2018-05-19 15:17 GMT-03:00 Matheus Ota <<a href="mailto:matheusota@gmail.com" target="_blank">matheusota@gmail.com</a><br></span>
        <mailto:<a href="mailto:matheusota@gmail.com" target="_blank">matheusota@gmail.com</a>> <mailto:<a href="mailto:matheusota@gmail.com" target="_blank">matheusota@gmail.com</a><span class=""><br>
        <mailto:<a href="mailto:matheusota@gmail.com" target="_blank">matheusota@gmail.com</a>>><wbr>>:<br>
<br>
             Hello all,<br>
<br>
             I'm with a problem in my Branch-and-Cut for the CVRP. I'm<br>
        currently<br>
             having a problem because the Branching Rule that I<br>
        implemented is<br>
             calling the SCIP_DECL_BRANCHEXECPS method, even though the<br>
        currently<br>
             solution is already the optimal one.<br>
<br>
             I also implemented the SCIP_DECL_CONSENFOLP,<br>
        SCIP_DECL_CONSENFOPS<br>
             and SCIP_DECL_CONSCHECK methods of the Constraint Handler,<br>
        so that<br>
             they check if the current solution is feasible and set<br>
        result as<br>
             SCIP_FEASIBLE or SCIP_INFEASIBLE. Could, someone provide me<br>
        some<br>
             help in this matter?<br>
<br>
             Thanks,<br>
             Matheus<br>
<br>
<br>
<br>
<br>
        ______________________________<wbr>_________________<br>
        Scip mailing list<br></span>
        <a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a> <mailto:<a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a>><br>
        <a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailma<wbr>n/listinfo/scip</a><span class=""><br>
        <<a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailm<wbr>an/listinfo/scip</a>><br>
<br>
<br>
    --     Ambros Gleixner, Research Group Mathematical Optimization Methods at<br>
    Zuse Institute Berlin, <a href="http://www.zib.de/gleixner" rel="noreferrer" target="_blank">http://www.zib.de/gleixner</a><br>
    ______________________________<wbr>_________________<br>
    Scip mailing list<br></span>
    <a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a> <mailto:<a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a>><br>
    <a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailma<wbr>n/listinfo/scip</a><br>
    <<a href="https://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">https://listserv.zib.de/mailm<wbr>an/listinfo/scip</a>><br>
<br>
<br>
</blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
Ambros Gleixner, Research Group Mathematical Optimization Methods at Zuse Institute Berlin, <a href="http://www.zib.de/gleixner" rel="noreferrer" target="_blank">http://www.zib.de/gleixner</a><br>
</div></div></blockquote></div><br></div>