Package com.artelys.kalis
Class KCycle
- java.lang.Object
-
- com.artelys.kalis.KConstraint
-
- com.artelys.kalis.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
-
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KConstraint
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KCycle(long cPtr, boolean cMemoryOwn)
KCycle(KCycle toCopy)
Copy constructorKCycle(KIntVarArray succ)
Primary constructor the all different constraint
KCycle(KIntVarArray succ, KIntVarArray preds)
Primary constructor the all different constraint
KCycle(KIntVarArray succ, KIntVarArray preds, KIntVar quantity)
Primary constructor the all different constraint
KCycle(KIntVarArray succ, KIntVarArray preds, KIntVar quantity, KIntMatrix matrix)
Primary constructor the all different constraint
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
protected void
finalize()
protected static long
getCPtr(KCycle obj)
-
Methods inherited from class com.artelys.kalis.KConstraint
askIfEntailed, getArity, getCopyPtr, getCPtr, getInstance, getInstanceCopyPtr, getLinearRelaxation, getLinearRelaxation, getName, getPriority, getProblem, getTag, getTypeInfo, isGetLinearRelaxationImplemented, print, print, setName, setPriority, setTag
-
-
-
-
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 variablespreds
- the list of predecessors variablesquantity
- the accumulated quantity variablematrix
- 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 variablespreds
- the list of predecessors variablesquantity
- the accumulated quantity variable
-
KCycle
public KCycle(KIntVarArray succ, KIntVarArray preds)
Primary constructor the all different constraint
- Parameters:
succ
- the list of successors variablespreds
- 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
-
-
Method Detail
-
getCPtr
protected static long getCPtr(KCycle obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKConstraint
-
delete
public void delete()
- Overrides:
delete
in classKConstraint
-
-