Hi, I’m trying to declare two exceptions in the following equation but it doesn’t work like this:

e52[i=1:29,k=1:29;i != L,k != L], -lambdaVI[i] <= M*BCC[i,k]

Hi, I’m trying to declare two exceptions in the following equation but it doesn’t work like this:

e52[i=1:29,k=1:29;i != L,k != L], -lambdaVI[i] <= M*BCC[i,k]

Hi!

Could you provide more details, ideally a minimal working example?

See also

1 Like

Thanks for answer. For example the model could be likes this

using JuMP

using CPLEXICC = Model(CPLEX.Optimizer)

M = 6e5

L = 1@variables(ICC,begin

lambdaVI[1:29]

BCC[1:29,1:29], Bin

end)@constraints(ICC,begin

e51[i=1:29;i != L], lambdaVI[i] >= 0

e52[i=1:29,k=1:29;i != L,k != L], -lambdaVI[i] <= M*(BCC[i,k])

end)

e51 will generate equations for i=2:29 and I want it to do the same in e52 for i=2:29 and k=2:29. I know I can declare them like that, but what I want to do next is a loop changing L = 1:29.

Use binary logic:

```
[i=1:29, k=1:29; (i != L) && (k != L)]
```

2 Likes

Thanks, it worked.