Constraint problem

I want to solve a constraint problem.

(I have no experience with solvers or optimization and not sure of terminology, I think it’s mixed-integer, non-linear or black box constraint feasibility problem?)

Here’s what I want to do:

Input Variables:
w is integer vector of length ~20

y = f(w), where f(w::Vector{Int}) -> y::Vector{Float64}
f is somewhat complicated, definitely non-linear
y is same length as w

f(w)[19] == c1
f(w)[20] == c2
dot(f(w), v) == c3, where v is a constant Vector{Int}
These constraints may be satisfied within a certain tolerance

Note this could be simplified by separating into 2 independent problems and making vector v variable:

    1. find w, subject to f(w)[19], f(w)[20] constraints
    2. find v, subject to dot(f(w), v) constraint

Note also that I already have a solution v1, w1, but now want to find v2, w2 subject to:

f(w2)[19] == f(w1)[19]
f(w2)[20] == f(w1)[20] * 2
dot(f(w2), v2) == dot(f(w1), v1)

I think this means I have good initial values for the problem?

I’d appreciate any advice on how I could tackle this?

Check out JuMP.

1 Like

Yeah, looks like a mixed-integer nonlinear program (MINLP). It might be small enough that you can try to solve it to guaranteed global optimality using a dedicated MINLP solver. For example, you could try JuMP with Couenne as the solver. Couenne has Julia bindings: GitHub - rdeits/CouenneNL.jl. Couenne is definitely not the fastest MINLP solver, but it is free.

1 Like

There is also POD.jl.


I haven’t tried POD yet. How is it? Faster than Couenne?

Didn’t try it either. There is also Juniper.jl. More and more Julia solvers are showing up, this is great!

1 Like