Search code examples
juliagurobijulia-jump

Inequality in constraints. I am trying to write the following mathematical equation in julia , not sure how to deal with the inequality conditions


enter image description here

I have the following code as of now. Please can someone help with how to implement the inequality conditions in the loop? Thanks

for i=1:c
    for j=1:c
        for k=1:N_+
@constraint(m,2*y[i,j,k]- sum{x[h,i],h=0:N_0}- sum{x[l,k],l=1:c} <=0)   
        end
    end
end

Solution

  • for i=1:c
        for j=1:c
           if j!=i
            for k=1:N_+
    @constraint(m,2*y[i,j,k]- sum{x[h,i] for h=0:N_0 if h!=i}- sum{x[l,k] for l=1:c if l !=k} <=0)   
            end
          end
        end
    end