# MOI.SingleVariable-in-MOI.Integer constraints are not supported by Ipopt

**URL:** <https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump\
**Created:** [January 24, 2022, 3:26am UTC](https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101 "2022-01-24T03:26:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxox](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oxox](https://discourse.julialang.org/u/oxox)\
**Post date:** [January 24, 2022, 3:26am UTC](https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101/1 "2022-01-24T03:26:08Z")

</div>

Hi,I’m a beginner with JuMP and have some problems using the IPOPT solver.  
When using the IPOPT solver, there is no way to create an integer variable, an error occurs.  
Can someone help me？？？Thanks a lot.

using JuMP  
using Ipopt  
model = Model(Ipopt.Optimizer)

@variable(model, z , Int)

LoadError: `MOI.SingleVariable`-in-`MOI.Integer` constraints are not supported and cannot be bridged into supported constrained variables and constraints. See details below:  
[1] constrained variables in `MOI.Integer` are not supported because no added bridge supports bridging it.  
Cannot add free variables and then constrain them because:  
(1) `MOI.SingleVariable`-in-`MOI.Integer` constraints are not supported  
(1) `MOI.SingleVariable`-in-`MOI.Integer` constraints are not supported because:  
Cannot use `MOIB.Constraint.ScalarFunctionizeBridge{Float64,MOI.Integer}` because:  
(2) `MOI.ScalarAffineFunction{Float64}`-in-`MOI.Integer` constraints are not supported  
(2) `MOI.ScalarAffineFunction{Float64}`-in-`MOI.Integer` constraints are not supported because:  
Cannot use `MOIB.Constraint.ScalarSlackBridge{Float64,MOI.ScalarAffineFunction{Float64},MOI.Integer}` because:  
[1] constrained variables in `MOI.Integer` are not supported

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [January 24, 2022, 3:57am UTC](https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101/2 "2022-01-24T03:57:34Z")

</div>

Ipopt does not support integer variables.

You should choose an appropriate solver from the list of supported solvers:

[https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers](https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers)

---

<div class="post-metadata">

**Author:** ![oxox](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oxox](https://discourse.julialang.org/u/oxox)\
**Post date:** [January 24, 2022, 4:02am UTC](https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101/3 "2022-01-24T04:02:37Z")

</div>

Thanks a lot, I will give it a try.

---

<div class="post-metadata">

**Author:** ![oxox](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oxox](https://discourse.julialang.org/u/oxox)\
**Post date:** [January 24, 2022, 8:00am UTC](https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101/4 "2022-01-24T08:00:18Z")

</div>

Sorry to bother, I got stuck while solving a problem with Ipopt, showing EXIT: Maximum Number of Iterations Exceeded.  
Its maximum number of iterations is 3000, how can I increase the maximum number of iterations？？？

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [January 24, 2022, 6:28pm UTC](https://discourse.julialang.org/t/moi-singlevariable-in-moi-integer-constraints-are-not-supported-by-ipopt/75101/5 "2022-01-24T18:28:21Z")

</div>

You’re looking for `max_iter`:

```julia
set_optimizer_attribute(model, "max_iter", 5_000)

```

The options are here: [Ipopt: Ipopt Options](https://coin-or.github.io/Ipopt/OPTIONS.html)
