I got in my problem some binary variable, thats a decision to install or not an equipment in a house. Among a lot of other variables and constraints, my problem is something like this:
N = 5; # number of houses @variable(m, a[i=1:N], Bin) @objective(m, Min, sum(a[i] for i = 1:N))
But for a larger N (around
30+), the problem gets to big to be solved in an acceptable time (using a Branch-and-Bound solver).
So, to reduce the number of binary variables, i was thinking in just choose some
a[i] to be binary. For example, binary for
i = 2:3:
@variable(m, a[i=2:3], Bin)
But i’m getting this error:
ERROR: LoadError: Failed attempt to index JuMPArray along dimension 1: 1 ∉ 2:3
Does anyone knows any trick in how work around this?