Is it possible to set different types of integrality constraints?
Dear MIP Team,
thank you for the package! I am familiarizing myself with it and unfortunately I was not able to find the answer in the documentation. Is it possible to set various integrality constraints modes in MIP? (like e.g. in milp from scipy):
integrality 1D array_like, optional Indicates the type of integrality constraint on each decision variable. 0 : Continuous variable; no integrality constraint. 1 : Integer variable; decision variable must be an integer within bounds. 2 : Semi-continuous variable; decision variable must be within bounds or take value 0. 3 : Semi-integer variable; decision variable must be an integer within bounds or take value 0.
I found only the relax parameter of the optimize function, but this is not enough for my problem (I actually want to implement the case 3 of the listed above)
Many thanks!
I don't think so. In the documentation of Var, the property var_type just gives the options:
(‘B’) BINARY, (‘C’) CONTINUOUS and (‘I’) INTEGER.
It is not possible yet. The official gurobi python api supports the requested variable definition.
At this point, I have to remark, that the requested variable definition is just a "convenience" feature. You can use a pure integer variable and binary variable together with a set of constraints to model such semi-integer variables.