Does gurobi support a different precision other than float64

I’m curious about the difference between two versions

The Model uses caching, which can batch various operations, etc, but it has the downside of requiring a copy of the model.

direct_mode stores only a single copy of the model and performs exactly what you type. In your case, delete.(m, m[:c3]) is equivalent to calling

for c in m[:c3]
    delete(m, c)
end

so you are iteratively deleting a large number of constraints, and Gurobi is not efficient at deleting constraints.

For the error, JuMP knows how to delete a vector of constraints but not a matrix. Do delete(m, vec(m[:c3]))

I constructed a general model for energy system optimization and modify some constraints according to my specific scenarios.

Read Design patterns for larger models · JuMP

I strongly suggest that, instead of building everything and then deleting some constraints, you add only the constraints and variables that are necessary in the first place.

@odow Thanks for the suggestions on model design. I considered this workflow more from a point view of users and decided to use this to make coding complete in both generic and specific scenarios. I’d like to have more discussions with you on model improvement after publishment. For research’s purposes, I keep the repo private now.
BTW, combining direct_model and adjustment on solver options (using dual instead of barrier), I managed to reduce memory consumption within machine’s limits.

2 Likes