# Mixed integer problem

**URL:** <https://discourse.julialang.org/t/mixed-integer-problem/133624>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [November 3, 2025, 2:52pm UTC](https://discourse.julialang.org/t/mixed-integer-problem/133624 "2025-11-03T14:52:47Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Post date:** [November 4, 2025, 6:44am UTC](https://discourse.julialang.org/t/mixed-integer-problem/133624/18 "2025-11-04T06:44:19Z")

</div>

MIP by its nature is NP-hard.

Solving an MIP typically has a convex phase (root LP relaxation, adding cutting planes), followed by a branch-and-bound phase. The former is efficient, whereas the latter is not. Its difficulty is inherent, regardless of which solver you go with.

In practice it’s highly problem-dependent. Some problems, despite might look large, may be efficiently solved, whereas some are not.

It is easy to create an MIP instance that let Gurobi struggle in its branch-and-bound phase. e.g.

> [@How can I stop a Gurobi solve in JuMP in real time (like Ctrl+C) and still keep the solution?](https://discourse.julialang.org/t/how-can-i-stop-a-gurobi-solve-in-jump-in-real-time-like-ctrl-c-and-still-keep-the-solution/132841/2):
>
> Please press once. e.g. import JuMP, Gurobi, SparseArrays N = 50 # 754 seconds Q = 1. \* SparseArrays.dropzeros( SparseArrays.spdiagm( [i =\> rand(-9:9, N - i) for i in 0:div(N, 2)]... ) ) m = JuMP.Model(); JuMP.@variable(m, rand(-7:-3) \<= y[1:N] \<= rand(3:7)); JuMP.@variable(m, rand(-9:-5) \<= x[1:N] \<= rand(5:9)); JuMP.@objective(m, Min, (x'Q)y); JuMP.set\_optimizer(m, Gurobi.Optimizer) JuMP.optimize!(m); JuMP.solution\_summary(m) test: julia\> JuMP.optimize!(m); JuMP.solution\_s…

> [@RomeoV](#):
>
> Perhaps you’re saying by allowing any discrete variables at all we’re losing a lot of optimization performance? That may be true, but many things are fundamentally “integer valued”.

Integer variables should be added only when they are necessary.

* * *

By the way, @ufechner7 your title is too big, that attracts everyone to take a look.

---

_[View the full topic](https://discourse.julialang.org/t/mixed-integer-problem/133624)._
