How to debug performance issues with building constraints?
I welcome general contributions how to approach this.
I welcome also welcome how to build these type of constraints faster.
I provided a slow example.
jj is a symmetric 960×960 BitMatrix:
m = Model(Gurobi.Optimizer)
@variable(m,fact1[1:960],Bin);
@variable(m,fact[1:960,1:3],Bin);
@constraint(m,c[i=1:3], fact[:,i]*fact[:,i]' == jj .* (fact[:,i]*fact[:,i]') ); ##really slow
@constraint(m, 3 .- sum(1 .- fact,dims=2)[:,1] .>= fact1 );
@constraint(m,[i=1:2], sum(fact, dims=1)[:,i] .>= sum(fact, dims=1)[:,i+1]); #Symmetry breaking
@objective(m,Max,sum(fact1))
optimize!(m)
@show solve_time(m)