[SCIP] Differences between "active" and "enabled" of constraints

Gregor Hendel hendel at zib.de
Mon Dec 14 11:09:20 CET 2015

Dear Feng,

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.

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.

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:

disables constraint's separation, propagation, and enforcing 
capabilities, s.t. the constraint is not propagated,
  *  separated, and enforced anymore until it is enabled again with a 
call to SCIPenableCons();
  *  in contrast to SCIPdelConsLocal() and SCIPdelConsNode(), the 
disabling is not associated to a node in the tree and
  *  does not consume memory; therefore, the constraint is neither 
automatically enabled on leaving the node nor
  *  automatically disabled again on entering the node again;
  *  note that the constraints enforcing capabilities are necessary for 
the solution's feasibility, if the constraint
  *  is a model constraint; that means, you must be sure that the 
constraint cannot be violated in the current subtree,
  *  and you have to enable it again manually by calling 
SCIPenableCons(), if this subtree is left (e.g. by using
  *  an appropriate event handler that watches the corresponding 
variables' domain changes)

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.

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.

I hope this helps.

Best regards,

On 13.12.2015 01:22, johnvon2012 wrote:
> Hi,
>     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.
>    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.
>    Could you please help me with this, especially in the binpacking example?
>     Thanks a lot!
> best,
> Feng
> _______________________________________________
> Scip mailing list
> Scip at zib.de
> http://listserv.zib.de/mailman/listinfo/scip

More information about the Scip mailing list