<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Dear Feng and list,<br>
<br>
it seems like some additional clarification is needed here. The
callbacks CONS(DE)ACTIVE, CONSDIS/ENABLE **can** be used to update
constraint data when the mentioned constraint state is about to
change. A local constraint gets deactivated or activated no matter
if the callbacks are present. <br>
<br>
Activation/Deactivation and Enabling/Disabling are two different
concepts, one denoting the presence of the constraint in the local
subtree, and one denoting the local or global redundancy of the
constraint.<br>
<br>
The corresponding set covering constraints are global constraints
that the pricer captures in the pricerInitBinpacking callback.
Capturing constraints is the way to tell SCIP that the pricer has
its data hands on these constraints such that they are not
accidentally deleted while the caller of the capture still wants
to work with it. <br>
<br>
During presolving, a set covering might be disabled through a call
to, e.g., SCIPdelCons() (Where SCIP sees that this deletion cannot
be performed because of the capturing mentioned above).<br>
<br>
For exploring things like this on your own, you may simply put an
assert in the binpacking or your own code at this location,
asserting that SCIPconsIsEnabled(cons) is equal to
SCIPconsIsActive(cons) and trying to trace a constraint where the
assertion fails (remember to compile in debug mode by specifying
'make OPT=dbg' to enable/activate assertions ;). <br>
<br>
A last word on this: I wouldn't worry too much about this specific
detail.I just put the mentioned assert while writing this mail and
ran a debug test on the six provided instances. In the example,
this assertion is always fulfilled for both types of constraints,
samediff and set covering.<br>
<br>
Kind regards,<br>
Gregor<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Am 14.12.2015 um 14:51 schrieb John Von:<br>
</div>
<blockquote
cite="mid:CA+GP=BwUG6K4sJrHg6eELAtNyebJKyiDjXfOKyBWApd2t88HVg@mail.gmail.com"
type="cite">
<div dir="ltr">Dear Gregor,
<div><br>
</div>
<div> Thanks for your help! I still have some problems:</div>
<div> </div>
<div> (1) "Enabling is best understood by understanding
disabling, I am citing from SCIPdisableCons() in scip.h:</div>
disables constraint's separation, propagation, and enforcing
capabilities, s.t. the constraint is not propagated,<br>
* separated, and enforced anymore until it is enabled again
with a call to SCIPenableCons();<br>
* in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
the disabling is not associated to a node in the tree and<br>
* does not consume memory; therefore, the constraint is
neither automatically enabled on leaving the node nor<br>
* automatically disabled again on entering the node again;<br>
* note that the constraints enforcing capabilities are
necessary for the solution's feasibility, if the constraint<br>
* is a model constraint; that means, you must be sure that
the constraint cannot be violated in the current subtree,<br>
* and you have to enable it again manually by calling
SCIPenableCons(), if this subtree is left (e.g. by using<br>
* an appropriate event handler that watches the corresponding
variables' domain changes)"
<div><br>
</div>
<div> - The above description means disabled constraints will
skip the enforing, which is necessary for the solution's
feasibility. However, I found the following description in the
"How to add constraint handler" document:</div>
<div><br>
<div>
<p style="margin:0px 0px
10px;font-stretch:normal;font-size:14px;line-height:19px;font-family:Roboto,sans-serif;color:rgb(0,0,0)">
"The CONSENABLE callback method is called each time a
constraint of the constraint handler is enabled.
Constraints might be active without being enabled. In this
case, only the feasibility checks are executed,
but domain propagation and separation is skipped."</p>
<p style="margin:0px 0px
10px;font-stretch:normal;font-size:14px;line-height:19px;font-family:Roboto,sans-serif;color:rgb(0,0,0)">
which said the feasibility checks are executed even for
disabled constraints, How can I understand this?</p>
</div>
<div> </div>
<div> (2) "In the binpacking example, the first loop in the
addBranchingDecisionConss() method loops over
samediff-constraints. Since the constraint handler does not
enable/disable constraints by itself, the loop can simply
skip non-active constraints."</div>
<div><br>
</div>
<div> -In the pricer of binpacking example, in the inner for
loop of the local method addFixedVarsConss(...),
SCIPIsEnabled(cons) is called to check the cons which is a
set-covering constraint, I checked the cons_setppc.c file,
and found the CONSENABLE/DISABLE callbacks are not
implemented (just define as NULL, so the constraint handler
does not enable/disable constraints ?), So why SCIPIsEnabled
is used here while <span style="color:rgb(80,0,80)">SCIPconsIsActive
is used in </span>addBranchingDecisionConss(...) instead ?</div>
<div><br>
</div>
<div> (3) Some constraint handlers use disabling of their
constraints for a more memory-efficient deactivation of
separation, propagation, etc. than by deleting the
constraint locally. An example that is easy to understand is
a logicor-constraint, where one out of a set of binary
variables must be set to one. As soon as one variable from
this set is fixed to one in the current subtree, the
constraint becomes redundant and therefore disabled
(locally). It remains present in order to be checked for
(global) feasibility, if it is a global constraint.</div>
<div><br>
</div>
<div> -Like with (2), the CONSENABLE/DISABLE callbacks are not
implemented (just define as NULL) in the logicor-constraint
handler (cons_logicor.c) either, So how "the constraint
becomes redundant and therefore disabled" without
CONSENABLE/DISABLE callbacks?</div>
<div><br>
</div>
<div> Thanks again,</div>
<div><br>
</div>
<div>Best regards,<br>
</div>
<div>Feng</div>
<div><br>
</div>
<div><br>
</div>
<div> <br>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-12-14 11:09 GMT+01:00 Gregor
Hendel <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:hendel@zib.de" target="_blank">hendel@zib.de</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px
0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear
Feng,<br>
<br>
the best source to start with about such issues is
maybe the How To on Adding Constraint handlers in the
documentation, where the description of the
corresponding callbacks CONSACTIVATE/DEACTIVATE and
CONSENABLE/DISABLE tells you what the flags mean.<br>
<br>
Constraints are active as long as the search explores
the subtree to which they have been added. This is
important for local constraints that are only valid in
a part of the search tree.<br>
<br>
Enabled constraints are active constraints that have
not been marked "disabled" by their own constraint
handler. Enabling is best understood by understanding
disabling, I am citing from SCIPdisableCons() in
scip.h:<br>
<br>
disables constraint's separation, propagation, and
enforcing capabilities, s.t. the constraint is not
propagated,<br>
* separated, and enforced anymore until it is
enabled again with a call to SCIPenableCons();<br>
* in contrast to SCIPdelConsLocal() and
SCIPdelConsNode(), the disabling is not associated to
a node in the tree and<br>
* does not consume memory; therefore, the constraint
is neither automatically enabled on leaving the node
nor<br>
* automatically disabled again on entering the node
again;<br>
* note that the constraints enforcing capabilities
are necessary for the solution's feasibility, if the
constraint<br>
* is a model constraint; that means, you must be
sure that the constraint cannot be violated in the
current subtree,<br>
* and you have to enable it again manually by
calling SCIPenableCons(), if this subtree is left
(e.g. by using<br>
* an appropriate event handler that watches the
corresponding variables' domain changes)<br>
<br>
Some constraint handlers use disabling of their
constraints for a more memory-efficient deactivation
of separation, propagation, etc. than by deleting the
constraint locally. An example that is easy to
understand is a logicor-constraint, where one out of a
set of binary variables must be set to one. As soon as
one variable from this set is fixed to one in the
current subtree, the constraint becomes redundant and
therefore disabled (locally). It remains present in
order to be checked for (global) feasibility, if it is
a global constraint.<br>
<br>
In the binpacking example, the first loop in the
addBranchingDecisionConss() method loops over
samediff-constraints. Since the constraint handler
does not enable/disable constraints by itself, the
loop can simply skip non-active constraints.<br>
<br>
I hope this helps.<br>
<br>
Best regards,<br>
Gregor
<div>
<div class="h5"><br>
<br>
<br>
<br>
On 13.12.2015 01:22, johnvon2012 wrote:<br>
</div>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>
<div class="h5">
Hi,<br>
I encoutered functions
SCIPconsIsActive( cons) and
SCIPconsIsEnabled(cons), but I do not under
the differences between "active" and "enabled"
of constraints? I have checked these two
functions but am still a little confused with
this.<br>
I also noticed that both functions are called
in the pricer of the binpacking example,
SCIPconsIsEnabled is in the
SCIP_DEL_PRICERREDCOST callback and
SCIPconsIsActive is in the
addBranchingDecisionConss local method,
respectively.<br>
Could you please help me with this,
especially in the binpacking example?<br>
<br>
Thanks a lot!<br>
<br>
<br>
best,<br>
<br>
Feng<br>
<br>
</div>
</div>
<span class="">
_______________________________________________<br>
Scip mailing list<br>
<a moz-do-not-send="true"
href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a><br>
<a moz-do-not-send="true"
href="http://listserv.zib.de/mailman/listinfo/scip"
rel="noreferrer" target="_blank">http://listserv.zib.de/mailman/listinfo/scip</a><br>
</span></blockquote>
<div class="">
<div class="h5">
<br>
_______________________________________________<br>
Scip mailing list<br>
<a moz-do-not-send="true"
href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a><br>
<a moz-do-not-send="true"
href="http://listserv.zib.de/mailman/listinfo/scip"
rel="noreferrer" target="_blank">http://listserv.zib.de/mailman/listinfo/scip</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>