KGeneralizedArcConsistencyConstraint

class KGeneralizedArcConsistencyConstraint : public KConstraint

This class implements a generic class for propagation of any nary constraint by forward checking/arc consistency or generalized arc consistency

See

KConstraint

Since

2016.1

Public Types

enum acAlgorithms

Possible propagation algorithms.

Values:

enumerator GENERALIZED_ARC_CONSISTENCY
enumerator ARC_CONSISTENCY
enumerator FORWARD_CHECKING

Public Functions

KGeneralizedArcConsistencyConstraint(KIntVarArray &vars, int acAlgorithm = GENERALIZED_ARC_CONSISTENCY, const char *name = 0)

This constructor takes threee arguments

Parameters
  • vars – an array of variables

  • acAlgorithm – GENERALIZED_ARC_CONSISTENCY (default value) for propagation by the generalized arc consistency algorithm, ARC_CONSISTENCY for propagation by the AC algorithm, FORWARD_CHECKING for propagatino by the forward checking algorithm

  • name – label for pretty printing of the constraint

KGeneralizedArcConsistencyConstraint(const KGeneralizedArcConsistencyConstraint &toCopy)

Copy Constructor.

virtual ~KGeneralizedArcConsistencyConstraint()

Destructor.

virtual bool testIfSatisfied(const std::vector<int> &tuple)

Abstract Interface for generic propagation of any binary constraint.

Returns

true if and only if the constraint is satisfied when v1 == val1 & v2 == val2

virtual void print(std::ostream &fout) const

Pretty printing of the constraint.