# Difficulty to understand the JuMP problem setting

**URL:** <https://discourse.julialang.org/t/difficulty-to-understand-the-jump-problem-setting/18112>\
**Category:** Optimization (Mathematical)\
**Tags:** first-steps\
**Created:** [November 28, 2018, 8:02pm UTC](https://discourse.julialang.org/t/difficulty-to-understand-the-jump-problem-setting/18112 "2018-11-28T20:02:41Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [November 28, 2018, 9:35pm UTC](https://discourse.julialang.org/t/difficulty-to-understand-the-jump-problem-setting/18112/4 "2018-11-28T21:35:49Z")

</div>

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:

> [@What JuMP algorithm to use for this optimization problem?](https://discourse.julialang.org/t/what-jump-algorithm-to-use-for-this-optimization-problem/17936):
>
> I have a question about what type of algorithm I should be using for a fairly straightforward optimization problem. I have the [following data](https://gist.github.com/tyleransom/3738fa6cd1b3b5602e0621b08d068380) id,val,score,id1 1,9,0,64 2,4,0,7 3,11,12,53 4,7,0,8 5,4,35,11 6,14,0,31 7,13,29,2 8,10,11,4 9,2,18,18 10,5,6,38 ... I want to choose 3 “good” ids and 3 “bad” ids. Without loss of generality, number these 1,2,3 and 4,5,6 respectively. Choose these 6 ids to maximize: objective = score[1]+score[2]+score[3]-score[4]-score[5]-score[6] subject to constra…

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](http://www.juliaopt.org/JuMP.jl/0.18/nlp.html#user-defined-functions) (you need to register the `demo_problem` function.

---

_[View the full topic](https://discourse.julialang.org/t/difficulty-to-understand-the-jump-problem-setting/18112)._
