KAllDifferent¶
-
class KAllDifferent : public KConstraint¶
This class creates a X1 <> X2 <> … <> Xn constraint
Example :
KIntVarArray X(...); // ... // Strong propagation problem.post(KAllDifferent("allDiff(X)",X,KAllDifferent::GENERALIZED_ARC_CONSISTENCY)); // Weak propagation problem.post(KAllDifferent("allDiff(X)",X,KAllDifferent::FORWARD_CHECKING));
- See
- Since
2016.1
Public Types
Public Functions
-
KAllDifferent(const char *name, KIntVarArray &vars, int propagationLevel = FORWARD_CHECKING)¶
Primary constructor for the all different constraint
- Parameters
name – for pretty printing of the constraint
vars – array of variables that must take different values
propagationLevel – FORWARD_CHECKING for forward checking propagation
propagationLevel – BOUND_CONSISTENCY for bound consistency propagation
propagationLevel – GENERALIZED_ARC_CONSISTENCY for generalized arc consistency propagation
propagationLevel – USING_GCC for a similar propagation, internally using a Global Cardinality Constraint
-
KAllDifferent(const KAllDifferent &toCopy)¶
Copy constructor.