Difficulty to understand the JuMP problem setting

Rather than using a generic nonlinear solver like Ipopt, I think your problem is very well suited to reformulation as a mixed-integer linear problem (assuming the problem you actually care about also has only linear constraints). It is very similar to the one in this post:

you should be able to use the same reformulation. If you choose to go this route, you can use e.g. CBC (free) or Gurobi (proprietary, free academic license) as your solver.

If you do choose to use a generic nonlinear solver like Ipopt, please read this section of the JuMP documentation: Nonlinear Modeling — JuMP -- Julia for Mathematical Optimization 0.18 documentation (you need to register the demo_problem function.

1 Like