[Bonmin] MINLP C++ application using Bonmin

Pierre Bonami pierre.bonami at gmail.com
Thu Jan 11 10:55:39 EST 2007


Dear Roy,
To solve an .nl using bonmin as a library, you have to include the two
following headers:
#include "BonminAmplInterface.hpp"
#include "CbcBonmin.hpp"

You should then use the five following lines of code:

    nlpSolver = new BonminAmplInterface(argv);//this reads the nl file and
                                                                     //fill
the data structures necessary to solve the problem.
    BonminCbcParam par; //this initialize a strucutre which reads the
parameter in the
                                     // bonmin.opt file
    BonminBB bb; // This initialize the structure for the branch-and-bound
(the b&b is
                          // driven by cbc.
    par(*nlpSolver);// Read the parameters
    bb(*nlpSolver, par);//do branch and bound

You can then access the results of the branch-and-bound through the BonminBB
class (you can see the .hpp file in Bonmin/src/CbcBonmin/ or the doxygen
documentation for it).

This is if you use the latest stable version of Bonmin (0.1).

For the integral I am not sure how it works with ampl. My guess is that if
you code  the function it would be in a dll file which has to be in the
directory where you run the model. What I am sure is that you don't have to
modify bonmin code to get it to work.

Best regards,
Pierre

On 1/10/07, Roy Chen <ytboy0208 at gmail.com> wrote:
>
> Hi, Pierre
>
> Thanks a lot for you helpful response. My question now is how to read an
> .nl file and solve it with Bonmin in a custom C++ application? Can integral
> be part of the .nl file after I import directly the integral function into
> AMPL?
>
> Regards,
>
> Roy
>
>
> On 1/10/07, Pierre Bonami <pierre.bonami at gmail.com> wrote:
> >
> > Dear Roy,
> > Sorry I could not answer to your questions before.
> > The CppExample is just a small example of modeling an MINLP through the
> > C++ interface to Bonmin but bonmin understands AMPL files an it is the
> > simplest way to use it. When you build and install the program with make
> > install, you will find an executable bonmin in the bin subdirectory which
> > reads .nl files.
> >
> > If what you want to do is read an .nl file and solve it with Bonmin in a
> > custom C++ application it is also possible.
> >
> > For your problem of integration. In theory Bonmin should be able to do
> > something with your problem if you provide functions for computing first and
> > second order derivatives for your integral. I think that the most simple way
> > is to import directly the function into ampl (see for example funclink
> > subdirectory in the ASL library and the readme file here
> > http://www.netlib.org/ampl/solvers/funclink/README).
> >
> > I hope that this somewhat answer your question. If you want more
> > details, please tell me.
> >
> > Best regards,
> > Pierre
> >  On 1/10/07, Roy Chen < ytboy0208 at gmail.com> wrote:
> >
> > >  Hello everyone
> > >
> > >  I reviewed the C++ application named CppExample in Bonmin package.
> > > It's an application of a very small problem, and I noticed that detailed
> > > description and definition of this problem was used in C++ code. Since it
> > > will be so time consuming if you need to define every problem using that
> > > detailed way, therefore, can Bonmin accept kind of standard input file
> > > format such as .nl in C++ code application?
> > >
> > > Like what I asked you last time, for MINLP problem with integration in
> > > the objective function, can Bonmin handle it if I code those integration
> > > part by myself? Does Bonmin provide this kind of interface?
> > >
> > > Best
> > >
> > > Roy
> > >
> > >
> > > _______________________________________________
> > > Bonmin mailing list
> > > Bonmin at list.coin-or.org
> > > http://list.coin-or.org/mailman/listinfo/bonmin
> > >
> > >
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/bonmin/attachments/20070111/129582d4/attachment.html


More information about the Bonmin mailing list