# Optimization computational time

**URL:** https://discourse.julialang.org/t/optimization-computational-time/81558
**Category:** Optimization (Mathematical)
**Tags:** jump, optimization, ijulia, gurobi
**Created:** [May 24, 2022, 8:21am UTC](https://discourse.julialang.org/t/optimization-computational-time/81558 "2022-05-24T08:21:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![O\_olalekan](https://avatars.discourse-cdn.com/v4/letter/o/73ab20/32.png) [@O\_olalekan](https://discourse.julialang.org/u/O_olalekan)
#### Post date: [May 24, 2022, 8:21am UTC](https://discourse.julialang.org/t/optimization-computational-time/81558/1 "2022-05-24T08:21:25Z")

</div>

I read several materials on the computational time of optimization models. The MILP computational time has always been faster than the NLP formulation. I then stumbled on an article which got that the computational time of the NLP was faster than the MILP counterpart. Both MILP and NLP formulations were done with Gurobi optimizer.

What’s the possibility of this?

Thanks

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [May 24, 2022, 10:09am UTC](https://discourse.julialang.org/t/optimization-computational-time/81558/2 "2022-05-24T10:09:44Z")

</div>

The short answer is **it depends… on pretty much everything** :

- the size of your problem (number of variables / constraints)
- the shape of the objective and constraints (linear / quadratic / conic / generic nonlinear)
- the proportion of integer variables
- the sparsity of the matrices involved
- the specific solver you use
- the cleverness of your formulation

So the paper you read was probably about a specific example, in which one of the approaches dominates, but no generic comparison is possible without knowing more about your use case

---

<div class="post-metadata">

### Author: ![O\_olalekan](https://avatars.discourse-cdn.com/v4/letter/o/73ab20/32.png) [@O\_olalekan](https://discourse.julialang.org/u/O_olalekan)
#### Post date: [May 24, 2022, 11:50am UTC](https://discourse.julialang.org/t/optimization-computational-time/81558/3 "2022-05-24T11:50:31Z")

</div>

Thanks for your reply. Just curious.

Yes, the formulation is not general but particular to a problem.
