Class KCycle


  • public class KCycle
    extends KConstraint
    The cycle constraint ensures that the graph implicitly represented by a set of variables and their domain contains no sub-tours (tour visiting a partial number of nodes). The constraint can take a second set of variables Preds, representing the inverse relation of the Succ function and ensure the following equivalences : succ(i) = j <==> pred(j) = i for all i and j. The third parameter of the cycle constraint allow to take into account an accumulated quantity along the tour such as distance, time or weight. More formally it ensure the following constraint : quantity = sum(i,j) M(i,j) for all edges i->j belonging to the tour.

    Since:
    2016.1
    • Constructor Detail

      • KCycle

        protected KCycle​(long cPtr,
                         boolean cMemoryOwn)
      • KCycle

        public KCycle​(KIntVarArray succ,
                      KIntVarArray preds,
                      KIntVar quantity,
                      KIntMatrix matrix)
        Primary constructor the all different constraint

        Parameters:
        succ - the list of successors variables
        preds - the list of predecessors variables
        quantity - the accumulated quantity variable
        matrix - a (node x node) matrix of integers representing the quantity to add to the accumulated quantity variable when an edge (i,j) belongs to the tour.
      • KCycle

        public KCycle​(KIntVarArray succ,
                      KIntVarArray preds,
                      KIntVar quantity)
        Primary constructor the all different constraint

        Parameters:
        succ - the list of successors variables
        preds - the list of predecessors variables
        quantity - the accumulated quantity variable
      • KCycle

        public KCycle​(KIntVarArray succ,
                      KIntVarArray preds)
        Primary constructor the all different constraint

        Parameters:
        succ - the list of successors variables
        preds - the list of predecessors variables

      • KCycle

        public KCycle​(KIntVarArray succ)
        Primary constructor the all different constraint

        Parameters:
        succ - the list of successors variables


      • KCycle

        public KCycle​(KCycle toCopy)
        Copy constructor