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

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

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

Thanks a lot, I will give it a try.

1 Like

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???

You’re looking for max_iter:

set_optimizer_attribute(model, "max_iter", 5_000)

The options are here: Ipopt: Ipopt Options