Usually for easiness one can declare a variable as a list (in python) but some elements of the list will never be associated to any constraints. When the resulting model is exported as LP file for debugging, gurobi keeps those variables in the objective function with 0 coefficients. That is quite annoying to have them there and obscure the whole purpose of debugging using the LP file.
Is there a way to get rid of those variables without having to define clearly on which conditions the variable should be declared when creating them?
Please sign in to leave a comment.