Quadratically constrained MIQP with julia and gurobi

后端 未结 2 598
星月不相逢
星月不相逢 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:15

    A math programming solver like Gurobi Optimizer cannot solve models with quadratic equality constraints. Here are the types of constraints that Gurobi Optimizer can solve. To solve your model using Gurobi Optimizer, you must transform your constraints into one of these forms, such as quadratic inequality constraints.

    0 讨论(0)
  • 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)
    
    0 讨论(0)
提交回复
热议问题