[Cbc] CBC MIP wrapper for glpsol (i.e. GLPK Solver)

Ted Ralphs ted at lehigh.edu
Sat Mar 21 15:27:07 EDT 2015


Miles is correct. Although it is commonly done, you technically cannot
create works that combine code under the GPL and the EPL. It is a violation
of the GPL. Even the author of the GPL'd code cannot technically distribute
combinations, but the author is obviously free to create an exception in
the license for certain kinds of combinations. I requested such an
exception be made to allow GMPL to be combined with other solvers, but I
never got a response. I think it is clear that this is informally
permissible, but the license of GMPL still technically disallows it.

>From the standpoint of making the combination work programatically, you
have the choice of either wrapping GMPL around Cbc (as is done with CPLEX
and Gurobi) or Cbc around GMPL (as is already half implemented in Cbc). I'm
not sure which is easier, but it might be that mimicking what is done with
CPLEX/Gurobi would be the path of least resistance. I hadn't thought of
that before.

An even nicer solution would be to create a wrapper that uses the Open
Solver Interface, which would provide links to all solvers with Osi
implementations (https://projects.coin-or.org/Osi/). Of course, OsiCbc is
not very well maintained at the moment (though I plan to change this in the
long run), so that might not be a good solution for Cbc right now, but it
would be very useful in general.

To link to Cbc in the same way as Gurobi and CPLEX, you could look at the
recently developed C interface:

https://projects.coin-or.org/Cbc/browser/releases/2.9.3/Cbc/src/Cbc_C_Interface.h

This should allow everything to be done in almost exactly the same way as
with Gurobi and CPLEX. In that case, the combined code would be a
contribution to Glpk, though, I suppose, not Cbc. It would be nice if we
could got the license issues worked out somehow to make this all
technically legal.

Cheers,

Ted



On Wed, Mar 18, 2015 at 8:32 PM, Noli Sicad <nsicad at gmail.com> wrote:

> No. I don' t thing so.
>
> Please visit: GLPK Wikibook
>
> http://en.wikibooks.org/wiki/GLPK/Mixing_GLPK_with_other_solver_packages
>
>  3party_cplex_wrapper.c or 3party.c is from Andrew Makhorin.
>
> ~~~~
>
> /* Filename : 3party.c
>  * Date     : July 2011
>  * Author   : Andrew Makhorin <mao at gnu.org>
>  * Tested   : GLPK v4.45
>  *
>  * Waiver: To the extent possible under law, Andrew Makhorin
>  * <mao at gnu.org> has waived all copyright and related or
>  * neighboring rights to this program code.
>  * http://creativecommons.org/publicdomain/zero/1.0/
>  *
>  * Caution: This code uses internal (non-public) data structures
>  * and should be rewritten to make use of published APIs instead.
>  */
>
> If you download the CBC solver src, you can see that the cbc has 3
> party software including glpk - (MathProg ->CBC ) but there is no
> there is no CBC -> MathProg for post processing (solution back to
> MathProg) . It is hard to implement, I guess.
>
> > There's nothing preventing you from writing this wrapper for your own
> > purposes and sharing it with others
>
> I am not C/C++ programmer. I need the help of the CBC community to help me.
>
> Yes, I was studying all the examples in cbc example folder and
> searching the net if I could get a cbc_interface that look like the
> cplex.h and gurobi.h.
>
> Anybody like to help?
>
> Thanks.
>
> Regards, Noli
>
>
> On 3/19/15, Miles Lubin <miles.lubin at gmail.com> wrote:
> > Aren't there are serious legal issues with this? Cbc is licensed under
> EPL,
> > while GLPK is GPL, and according to wikipedia (
> > http://en.wikipedia.org/wiki/Eclipse_Public_License):
> >
> > The EPL 1.0 is not compatible with the GPL, and a work created by
> combining
> > a work licensed under the GPL with a work licensed under the EPL cannot
> be
> > lawfully distributed.
> >
> > There's nothing preventing you from writing this wrapper for your own
> > purposes and sharing it with others, but at least from my limited
> > understanding of the licences, this wrapper could not be officially
> > distributed with cbc.
> >
> > On Wed, Mar 18, 2015 at 5:14 PM, Noli Sicad <nsicad at gmail.com> wrote:
> >
> >> Hi,
> >>
> >> CBC MIP solver is quicker and can solve difficult MIP problem compare
> >> to current GLPK MIP solver.
> >>
> >> GLPK/MathProg has very good data management, pre and post processing
> >> (i.e. input and output to various formats (database, CVS, etc.), far
> >> better than AMPL.
> >>
> >> CBC solver has "half" support for MathProg, only input at the moment.
> >>
> >> I think it would be better if we would adapt this approach:
> >>
> >> GLPK -> CBC MIP-> GLPK  wrapper which uses GLPK to parse a MathProg
> >> model with data files, generates mps file, solve it with CBC, and uses
> >> the post solve features of GLPK/MathProg.
> >>
> >> With CBC solver can be user's friendly and popular :-).
> >>
> >> Gurobi and Cplex have these wrappers for glpsol. I am attaching these
> >> 2 files (i.e. wrapper_gurobi.c and 3party_cplex_wrapper.c.
> >>
> >> John and Ted,
> >>
> >> What do you think about this approach of having support for CBC in
> >> glpsol? Is the doable.
> >>
> >> Thanks in advance.
> >>
> >> Regards, Noli
> >>
> >> _______________________________________________
> >> Cbc mailing list
> >> Cbc at list.coin-or.org
> >> http://list.coin-or.org/mailman/listinfo/cbc
> >>
> >>
> >
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc
>



-- 
Dr. Ted Ralphs
Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20150321/11423322/attachment.html>


More information about the Cbc mailing list