# MIQP: How does Pavito treat convex quadratic functions?

**URL:** <https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400>\
**Category:** Optimization (Mathematical)\
**Created:** [December 6, 2018, 10:08pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400 "2018-12-06T22:08:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olegg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olegg/32/51316_2.png) [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Post date:** [December 6, 2018, 10:08pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/1 "2018-12-06T22:08:11Z")

</div>

Some Integer Programming solvers, e.g. CPLEX, provide specialised algorithms for convex quadratic constraints and objectives. Does Pavito enable such algorithms for a quadratic objective, or is it treated as a general nonlinear function?

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [December 7, 2018, 3:24pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/2 "2018-12-07T15:24:03Z")

</div>

Pavito is for Convex-MINLP, Pajarito is specialized to Convex-MIConicP. If your problem has a QP structure, Pajarito might be the better solver.

---

<div class="post-metadata">

**Author:** ![Olegg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olegg/32/51316_2.png) [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Post date:** [December 7, 2018, 4:27pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/3 "2018-12-07T16:27:06Z")

</div>

Thanks! I have integer problems with linear and convex nonlinear constraints and a convex quadratic objective. Perhaps some combination of Pavito and Pajarito could be best?

Having now studied Pavito’s `algorithm.jl` in more detail, I understand that quadratics are treated as any nonlinear functions. This could be forgoing some speed. Indeed, using a linear objective produced 50 - 200x speed-ups for different instances, other things being equal. Probably some of these gains could be possible with a quadratic objective if, say, a native MIQP in CPLEX were used.

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [December 7, 2018, 4:37pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/4 "2018-12-07T16:37:24Z")

</div>

Got it. This sounds like a good feature to add to Pavito. I would recommend opening an issue in that repo.

---

<div class="post-metadata">

**Author:** ![Olegg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olegg/32/51316_2.png) [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Post date:** [December 7, 2018, 6:19pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/5 "2018-12-07T18:19:46Z")

</div>

Good idea. I guess a quad objective shouldn’t be too hard to add.

---

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [December 7, 2018, 11:40pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/6 "2018-12-07T23:40:18Z")

</div>

If you’re interested in performance, consider writing your convex constraints in conic form. Doing so allows the solver to take advantage of extended formulations and is often more reliable ([our paper](http://rdcu.be/vQkv)). I don’t know enough about your use case to say whether it’s a clear win or not, however.

The analogue of your question in Pajarito is addressed by the `soc_in_mip` option that enables passing second-order cone constraints to the MIP solver instead of outer-approximating them.

---

<div class="post-metadata">

**Author:** ![Olegg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olegg/32/51316_2.png) [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Post date:** [December 8, 2018, 1:19pm UTC](https://discourse.julialang.org/t/miqp-how-does-pavito-treat-convex-quadratic-functions/18400/7 "2018-12-08T13:19:43Z")

</div>

I’ve had a look at the paper. It is very interesting, and the approach seems quite promising. I’ll look into applying it. Thank you!
