Originally posted by: SystemAdmin
In the part where I write the constraints, I am having some trouble making a summation.
The problem is the following:
Decision Variables:
Y_ij = 1 if link (i,j) is used by an active path, 0 otherwise
X
p1 = 1 if path 1 is used, 0 otherwise
X
p2 = 1 if path 1 is used, 0 otherwise
X
p3 = 1 if path 1 is used, 0 otherwise
The constraint I am trying to write is that if any of the paths X
p1, X
p2 or X
p3 = 1, then Y_ij = 1. Otherwise (if none of the paths = 1), Y_ij = 0.
I am trying to do this the following way:
sum(p in Paths) X[p] <= Y_ij
But if more than 1 path is used, then it gives me trouble because it makes it as:
X
p1 + X
p2 + X
p3 <= Y_ij
1 + 1 + 0 <= 1
2 <= 1
Error
Is there any way to make a binary sum, boolean sum, or XOR or something to make it so that if I have:
1 + 1 + 1 <= 1
1 <= 1
Thanks very much for your help!
Tomas.
#DecisionOptimization#OPLusingCPLEXOptimizer