Integer optimisation with user's multivariate functions: Possible in Julia?

My optimisation problem has convex multivariate constraints with matrix operations: inverse and determinant. The matrices are symmetric PSD from dim 2x2 up to 10x10. I’ve solved the continuous case in JuMP and Ipopt, with user-defined multivariate constraints and analytical derivatives. This worked extremely well.

There’s been less luck with the integer case. What I’ve tried:

  • Define @NLconstraints in JuMP => The det and inv weren’t recognised

  • Use Pavito.jl and Ipopt with CbcSolver or CplexSolver => Requires Hessians, which isn’t possible in JuMP for multivariate user-defined functions, even though Ipopt doesn’t require exact Hessians

  • Juniper, POD, AmplNLWriter => No user-defined multivariate functions (to the best of my knowledge)

  • Convex.jl and SCS + Pajarito => some luck with the det, but slow convergence and inexact solutions, like -0.2039 for an Int x >= 0. Also, inv isn’t really allowed.

I’d very much appreciate any suggestions and recommendations of library tools, ideally open source. Many thanks!


If you have a JuMP model that is working for an NLP problem, I don’t foresee why Juniper would not work for an MINLP variant of that JuMP model. Can you indicate what type of error you are getting in that case?

I get “LoadError: KeyError: key :g not found”. Here, :g is the user-defined constraint registered with JuMP and added through JuMP.addNLconstraint. This constraint is indexed and added in a loop, as in JuMP; Rewriting an @eval @NLexpression with a user defined function in local scope w/ Expr

Can you provide me a small test script that I can work with?

1 Like

I found a workaround by disabling Hessians in Pavito if they aren’t provided by the JuMP model. There’s a PR in

I’ve found a workaround, but maybe there’s a better solution. There’s an example script in my other question, How to avoid re-computing the same matrix in optimisation/JuMP? Many thanks!

@Olegg, glad to hear that you found a work around for Pavito.

Still, it would be a great help to us if you could provide a small JuMP model that exhibits this issue, then we can add it to the unit tests for various solvers to make sure they work for user defined functions.

Sure! I’ve edited and double-checked the code linked in my reply to @Wikunia. Should be working now with the workaround. Hope it helps.

@Olegg: I may have a similar problem here where I want to define constraints in JuMP involving matrix invs. Would you mind sharing how you registered a multivariate function / derivative? Or did you find an alternative approach?