Skip to content

[FileFormats.NL] add support for Complements set #2879

@eminyouskn

Description

@eminyouskn

I am trying to export a JuMP model containing complementarity constraints to an .nl file, but I encounter an unsupported constraint error.

Here is a minimum example:

using JuMP
import MathOptInterface as MOI
import AmplNLWriter
import Bonmin_jll

model = JuMP.Model(() -> AmplNLWriter.Optimizer(Bonmin_jll.amplexe))
@variable(model, x)
@variable(model, y)
@constraint(model, [x, y] in MOI.Complements(2))
JuMP.write_to_file(model, "test.nl")

And the resulting output:

ERROR: Constraints of type MathOptInterface.VectorOfVariables-in-MathOptInterface.Complements are not supported by the solver.

If you expected the solver to support your problem, you may have an error in your formulation. Otherwise, consider using a different solver.

The list of available solvers, along with the problem types they support, is available at https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers.

I also tried other AMPL executables (e.g., Ipopt, Knitro), but the same issue occurs.
It seems that AmplNLWriter currently does not support complementarity constraints or I am not doing something properly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions