On the use of BONMIN via Python interface

1,557 views
Skip to first unread message

Marco Gabiccini

unread,
Mar 3, 2017, 10:34:00 AM3/3/17
to CasADi
Dear All,

I am very new to the topic of mixed-integer programming, therefore I am sorry if the question is very basic and naive. However, I would like to explore the theory through the use of CasADi that, if I understood correctly, provides an interface to the BONMIN solver. 

I come directly to my question: are there any example in the Python interface to understand how to set up and solve a nonlinear mixed-integer program in CasADi? Literally how the define the cost function, constraints, specify which are the integer variables, their ranges, which are the continuous ones etc.
I have read the answer to a previous question about setting the options in BONMIN via the bonmin.opt file. However, Andrian seemed already very much knowledgeable about the topic and the answers provided by Joris was at a higher level than I can grasp. Is this file already provided in casADi? Which part of framing the problem should be 'written' is casadi (and how) and which specs should be given via the bonmin.opt. I have found a bonmin.opt file here: 


however I do not understand if this is the correct templates or if I should give some of the options in a standard way directly in the python file.

Sorry for the basic question, but I am not able to find an entry point to undestand. Thanks for your help.

Best,
Marco

Joel Andersson

unread,
Mar 7, 2017, 5:22:55 PM3/7/17
to CasADi
Hi,
Using bonmin via CasADi works just like using other NLP solvers, like IPOPT. The only thing that changes is that you have to set the "discrete" option, which is a vector of booleans marking which of the decision variables are discrete-valued.

Here is a demo:

Joel

Marco Gabiccini

unread,
Mar 8, 2017, 3:38:24 AM3/8/17
to CasADi
Thanks Joel, I will definitely have a look at the linked example.

Best,
Marco 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages