I want to optimize over a matrix X.
While I specify in my model constraints the indices at which X must be zero (according to the specifications I provide in a binary matrix A):
@variable(model, X[1:n_rows, 1:n_cols])
set_lower_bound.(X, zeros(n_rows, n_cols))
set_upper_bound.(X, ones(n_rows, n_cols))
@constraint(model, X .<= A')
I’m wondering if there’s a better alternative I could use – like constructing X as a sparse matrix variable or reformulating my constraints – to help the JuMP model recognize that it does not need to consider the zero-constrained entries of X as variables over which it should optimize, with the hope that it makes the model more efficient.
I’m new to julia, so any insight is super appreciated : )