Originally posted by: malithwd
Hi folks,
I am trying to model the following constrain in OPL. Here π G is string set.
Np-1
r >= ∑ y(k,k+1) ∀p∈ π G
k=1
Here is how I tried it,
tuple Path {{string} nodes;}
{Path} paths = ...;
subject to{
forall(p in paths)
sum (node in p.nodes) Y[node][next(p.nodes,node)] <= r;
}
since i want to iterate till N-1 th element of set and apply function Y for k+1 th element i used "next" function. But here it iterates till N th element. How could it be done using OPL notation to iterate till N-1 th element and get the k+1 th element in function?
Thank you,
Malith
#DecisionOptimization#OPLusingCPLEXOptimizer