I am trying to solve an optimization problem with JuMP. Is there any way to include “condition” in the “sum” part of @constraint
macro?
The constraint is: \sum_{c \in C} \sum_{s \in S} \sum_{r \in S, s \ne r} (x_s^c + 2 * y_sr^c) = S
My code: @constraint(m, sum((x[s,c] + 2 * y[s,r,c]) for s=1:length(routes), r=1:length(routes), c=1:length(carrier)) == length(routes))
How can I include “s \ne r” condition in the @constraint
macro?
Thanks!