<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Matheus,<br>
<br>
let me add some comments:<br>
<br>
the "PS" in CONSENFOPS stands for pseudo solutions. Those are the
solutions to the relaxation of the problem that omits all
constraints. For this reason, each variable will be set to one of
its bounds, depending on the sign of its objective coefficient. The
pseudo solution is the backup-plan in SCIP, if the LP could not be
solved (or provides no branching candidate).<br>
<br>
Therefore, each solution that arrives at SCIP_DECL_CONSENFOPS should
be integer (bounds are integer for integer variables). How do you
access the solution?<br>
<br>
Now suppose that you had numerical problems in the LP and the LP
could not be solved to optimality. Then SCIP falls back enforcing
the pseudo solution, as Ambros said, and potentially branching on
it, if no constraint handler resolved the infeasibility in another
way.<br>
In case of such numerical troubles, adding a cut to the LP is not an
option, because SCIP dismissed the LP at that node anyway, so
branching really needs to be performed on one of the unfixed integer
variables.<br>
If your CVRP branching rule implements the BRANCHEXECPS , it should
be called on such a solution, but if it does not want to branch on
an unfixed variable with integer value, some other branching rule
must step in and perform the branching, so that is inference
branching in this case.<br>
<br>
I see another potential problem in your implementation, though: Even
if the LP is solved to optimality, it may happen that you enter
CONSENFOLP with an integer solution that violates some constraint
that is not (yet) present in the LP. For example, separation may be
limited to a certain number of rounds or stopped due to stalling. In
that case, it might happen that a solution is given to CONSENFOLP
that can be separated by a cut of a constraint handler. Then, the
constraint handler should just do this in CONSENFOLP, and set the
result to SCIP_SEPARATED. In general, a constraint handler should
always try to resolve the infeasibility within the enforcement
callback, it should avoid to just return INFEASIBLE: it already
detected that (and why) the current solution is infeasible, why
should it wait for another plugin to detect the same reason or
possibly do a unrelated branching decision?<br>
Because what happen afterwards is that no branching can be performed
on the LP solution because all variables are integral in the LP
solution. Thus, the only chance for SCIP to continue is to branch on
the pseudo solution.<br>
<br>
Best,<br>
Gerald<br>
<br>
<div class="moz-cite-prefix">On 22.05.2018 14:16, Matheus Ota wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAL0UnZ2b2EBcjuqf3eruXV=MS7SLkaH4yDOUz2SKhamrHb9=tQ@mail.gmail.com">
<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" moz-do-not-send="true">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"
moz-do-not-send="true">gleixner@zib.de</a> <mailto:<a
href="mailto:gleixner@zib.de" target="_blank"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">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"
moz-do-not-send="true">matheusota@gmail.com</a><br>
</span>
<mailto:<a href="mailto:matheusota@gmail.com"
target="_blank" moz-do-not-send="true">matheusota@gmail.com</a>>
<mailto:<a href="mailto:matheusota@gmail.com"
target="_blank" moz-do-not-send="true">matheusota@gmail.com</a><span
class=""><br>
<mailto:<a href="mailto:matheusota@gmail.com"
target="_blank" moz-do-not-send="true">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"
moz-do-not-send="true">Scip@zib.de</a> <mailto:<a
href="mailto:Scip@zib.de" target="_blank"
moz-do-not-send="true">Scip@zib.de</a>><br>
<a
href="https://listserv.zib.de/mailman/listinfo/scip"
rel="noreferrer" target="_blank" moz-do-not-send="true">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"
moz-do-not-send="true">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" moz-do-not-send="true">http://www.zib.de/gleixner</a><br>
______________________________<wbr>_________________<br>
Scip mailing list<br>
</span>
<a href="mailto:Scip@zib.de" target="_blank"
moz-do-not-send="true">Scip@zib.de</a> <mailto:<a
href="mailto:Scip@zib.de" target="_blank"
moz-do-not-send="true">Scip@zib.de</a>><br>
<a
href="https://listserv.zib.de/mailman/listinfo/scip"
rel="noreferrer" target="_blank" moz-do-not-send="true">https://listserv.zib.de/mailma<wbr>n/listinfo/scip</a><br>
<<a
href="https://listserv.zib.de/mailman/listinfo/scip"
rel="noreferrer" target="_blank" moz-do-not-send="true">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" moz-do-not-send="true">http://www.zib.de/gleixner</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Scip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Scip@zib.de">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
</blockquote>
<br>
</body>
</html>