Product of integer and binary linearization
AnsweredHi,
consider the product of a binary variable x, with an integer variable y.
How to efficiently linearize this term? Also is it is better to linearize this term, or
gurobi solver can handle it?
Thanks in advance.
-
Hi Nick,
How to efficiently linearize this term?
An efficient method is discussed in Multiplication of a continuous and a binary variable. The idea is the same if \(x\) is an integer variable. Please note that \(x\) requires finite lower and upper bound for the linearization to work.
Also is it is better to linearize this term, or gurobi solver can handle it?
It is usually better to let Gurobi handle the linearization. Gurobi automatically decides which kind of linearization or reformulation is best for a given model. You can control the linearization of quadratic terms with binary variables via the PreQLinearize parameter.
If you are interested in more details about how Gurobi handles products of variables with at least one binary, then you might want to have a look at our webinar about Models with Products of Binary Variables.
Best regards,
Jaromił0
Please sign in to leave a comment.
Comments
1 comment