| Overview | Group | Tree | Graph | Index | Concepts |

An instance of this class is a path constraint in Concert Technology.
In order for the constraint to take effect, you must add it to a model
with the template IloAdd or the member
function IloModel::add and extract the model
for an algorithm with the member function IloAlgorithm::extract.
What IloPathLength Does Not Do
The path-length constraint does not determine whether there is a path
between nodes in a graph; rather, it constrains accumulations (such as flow)
along a path. The filtering algorithm associated with this constraint works
on the accumulation variables in the array lengths.
If you are looking for a Hamiltonian path, for example, (that is, one in
which each node is visited exactly once), consider using instead the
constraint IloAllDiff on the variables in
the array next.
What IloPathLength Does
If we are given
maxNbPaths,maxNbPaths nodes, known as S, for starting nodes,maxNbPaths nodes, known as E, for ending nodes,then a path constraint insures that there exist at most
maxNbPaths paths starting from a node in S, visiting nodes in
N, and ending at a node in E. Furthermore, each node will be
visited only once, has only one predecessor and only one successor,
and each node belongs to a path that starts from a node in S and
ends at a node in E.
In particular, in an instance of IloPath, in the arrays
next and cumul,
[0, n-1] correspond to the nodes of
N,[n, n+maxNbPaths-1] correspond to
the nodes of E,[n+maxNbPaths,
n+2*maxNbPaths-1] correspond to the nodes of S. In
other words, the size of next and cumul is
n+2*maxNbPaths.
next[i] is the node following node i on the
current path. cumul[i] is the accumulated cost from the
beginning of the path to node i. The argument
transit specifies the transition function.
When this constraint is satisfied, it insures that for all indices
i in the range [0, n-1] or in [n+maxNbPaths,
n+2*maxNbPaths-1], if next[i]==j and j is
in [0, n+maxNbPaths-1], then cumul[i] +
transit.transit(i,j) <= cumul[j].
When i is in the range [n, n+maxNbPaths-1],
next[i] has no meaning because the nodes in E do not have
successors, of course. In this case, the constraint deals with them by
setting next[i] to i+maxNbPaths (that is, nodes of
S).
Most member functions in this class contain assert
statements. For an explanation of the macro NDEBUG (a way to
turn on or turn off these assert statements), see the concept
Assert and NDEBUG.
See Also:
IloAllDiff, IloConstraint, IloPathTransitFunction, IloPathTransitI
| Constructor Summary | |
|---|---|
public | IloPathLength() |
public | IloPathLength(IloPathLengthI * impl) |
public | IloPathLength(const IloEnv env, const IloIntVarArray next, const IloNumVarArray cumul, IloPathTransitFunction transit, IloInt nbPaths=1, const char * name=0) |
public | IloPathLength(const IloEnv env, const IloIntVarArray next, const IloIntVarArray cumul, IloPathTransitFunction transit, IloInt nbPaths=1, const char * name=0) |
public | IloPathLength(const IloEnv env, const IloIntVarArray next, const IloNumVarArray cumul, IloPathTransitI * pathTransit, IloInt nbPaths=1, const char * name=0) |
public | IloPathLength(const IloEnv env, const IloIntVarArray next, const IloIntVarArray cumul, IloPathTransitI * pathTransit, IloInt nbPaths=1, const char * name=0) |
| Method Summary | |
|---|---|
public IloPathLengthI * | getImpl() const |
Inherited Methods from IloConstraint |
|---|
getImpl |
Inherited Methods from IloIntExprArg |
|---|
getImpl |
Inherited Methods from IloNumExprArg |
|---|
getImpl |
Inherited Methods from IloExtractable |
|---|
asConstraint, asIntExpr, asModel, asNumExpr, asObjective, asVariable, end, getEnv, getId, getImpl, getName, getObject, isConstraint, isIntExpr, isModel, isNumExpr, isObjective, isVariable, setName, setObject |
| Constructor Detail |
|---|
This constructor creates a path constraint in an environment.
In order for the constraint to take effect, you must add it to a model with the
template IloAdd or the member function
IloModel::add and extract the model for an algorithm
with the member function IloAlgorithm::extract.
If the array next or cumul is not an appropriate length,
then on platforms that support C++ exceptions when exceptions are enabled, this
constructor will throw the exception InvalidArraysException.
This constructor creates a path constraint in an environment.
In order for the constraint to take effect, you must add it to a model with the
template IloAdd or the member function
IloModel::add and extract the model for an algorithm
with the member function IloAlgorithm::extract.
If the array next or cumul is not an appropriate length,
then on platforms that support C++ exceptions when exceptions are enabled, this
constructor will throw the exception InvalidArraysException.
This constructor creates a path constraint in an environment.
In order for the constraint to take effect, you must add it to a model with the
template IloAdd or the member function
IloModel::add and extract the model for an algorithm
with the member function IloAlgorithm::extract.
If the array next or cumul is not an appropriate length,
then on platforms that support C++ exceptions when exceptions are enabled, this
constructor will throw the exception InvalidArraysException.
This constructor creates a path constraint in an environment.
In order for the constraint to take effect, you must add it to a model with the
template IloAdd or the member function
IloModel::add and extract the model for an algorithm
with the member function IloAlgorithm::extract.
If the array next or cumul is not an appropriate length,
then on platforms that support C++ exceptions when exceptions are enabled, this
constructor will throw the exception InvalidArraysException.
| Method Detail |
|---|