Quadratically constrained MIQP with julia and gurobi

后端 未结 2 596
星月不相逢
星月不相逢 2021-01-21 23:33

This is an attempt to answer the following question: https://matheducators.stackexchange.com/questions/11757/small-data-sets-with-integral-sample-standard-deviations

So

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-22 00:18

    The major problem is that, in general, a quadratic equality is not convex, and most solvers only work for convex problems (plus integer constraints). A product of two binary variables is easy to linearise (it's the equivalent of a logical AND), that of one binary variable and one continuous variable is easy too; the rest is not so easy.

    Since Gurobi 9, you can solve nonconvex bilinear problems, in particular those having quadratic equality constraints. You just have to add the right parameter. With Gurobi.jl, if m is your JuMP model, you can do this:

    set_optimizer_attribute(m, "NonConvex", 2)
    

提交回复
热议问题