Originally posted by: TikiBlue
Hello Guys!
As seen in the attached files i want to implement a mathematical formulation as a constraint. (Note co.c1 = i and co.c2=j in the formulation)
In this case the value of the difference between two sums has to depend on the index of one of the variables.
If the index is the same as the one of the Starter Node "co.c1", the sum must result 1, if it is the same index as "co.c2" the sum must result -1, otherwise 0.
The mathematical formulation is attached as well.
At the moment i have to split the constraint into three and include for every case a statement if the condition is not fullfilled (always >=0), which is not really defined by my original mathematical formulation.
On the other hand it doesnt accept an If clause for the case that the index does not equal both "co.c1" AND "co.c2".
Does someone has a clue how to solve this problem and formulate it as a
{
if (u==co.c1) then
else if (u==co.c2) then
else
}
Regards
for easy copy and paste:
ct11:
forall(co in cc)
forall(u in Intermediate)
(u == co.c1) ? sum(v in Node)z[co][<u,v>] - sum(v in Node)z[co][<v,u>]==1:sum(v in Node)z[co][<u,v>] - sum(v in Node)z[co][<v,u>]>=0;
ct12:
forall(co in cc)
forall(u in Intermediate)
(u == co.c2) ? sum(v in Node)z[co][<u,v>] - sum(v in Node)z[co][<v,u>]==-1:sum(v in Node)z[co][<u,v>] - sum(v in Node)z[co][<v,u>]>=0;
ct13:
forall(co in cc)
forall(u in Intermediate)
(u != co.c1 and co.c2) ? sum(v in Node)z[co][<u,v>] - sum(v in Node)z[co][<v,u>]==0:sum(v in Node)z[co][<u,v>] - sum(v in Node)z[co][<v,u>]>=0;
#DecisionOptimization#OPLusingCPLEXOptimizer