Linearizing a quadratic objective function
AnsweredHello,
I'm fairly new to optimization and Gurobi.
I have the following objective function to be mazimized:

Xi and Xz are both decision variables. How do i linearize this?
Thanks,
Abhishek
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try Gurobot? -
Hi Abhishek,
You don't have to linearize this yourself. Gurobi is able to solve (nonconvex) quadratically constrained programs. You can just set the NonConvex parameter and let Gurobi do the work.
Please note that if your \(X\) variables are continuous or integer, then it is best to provide tight lower and upper bounds for best performance.
If your \(X\) variables are binary, then it might be worth to experiment with the PreQLinearize parameter which controls the linearization strategy for products of binaries.
Best regards,
Jaromił0 -
Thank you Jaromil for your response, really appreciated!
I'm working on a school project where a quadratic objective function is considered out of scope and hence needs to be linearized. Any help with that would be great!
Regards,
Abhishek0 -
Hi Abhishek,
For the general case where both variables of the product are continuous, please have a look at McCormick envelopes.
For binary times continuous variable, you could refer to, e.g., this stackexchange post or this blog. There are similar post on various forums explaining all linearization cases.
Best regards,
Jaromił0
Post is closed for comments.
Comments
4 comments