[Cbc] [Clp] GNUMath Prog

John Forrest john.forrest at fastercoin.com
Wed Feb 9 12:07:28 EST 2011


I have modified Cbc trunk to do more with gmpl.

There is a new command

gsolution file which puts out a file which could be read into glpsol,
from where you could do reports - e.g. glpsol --model sudoku.mod --read
tmp.file.  If you include glpk in ThirdParty then you can do the reports
from Cbc.

Cbc will always write out the file, but if you had generated the model
by using gmpl then it will also do the report.  So

cbc sudoku.mod% -solve -gsolution tmp.file

gives

Reading MIP solution from `./tmp.file'...
1325 lines were read
 +-------+-------+-------+
 | 5 3 4 | 6 7 8 | 9 1 2 |
 | 6 7 2 | 1 9 5 | 3 4 8 |
 | 1 9 8 | 3 4 2 | 5 6 7 |
 +-------+-------+-------+
 | 8 5 9 | 7 6 1 | 4 2 3 |
 | 4 2 6 | 8 5 3 | 7 9 1 |
 | 7 1 3 | 9 2 4 | 8 5 6 |
 +-------+-------+-------+
 | 9 6 1 | 5 3 7 | 2 8 4 |
 | 2 8 7 | 4 1 9 | 6 3 5 |
 | 3 4 5 | 2 8 6 | 1 7 9 |
 +-------+-------+-------+
Model has been successfully processed

It is still a bit preliminary and some basic statuses may not be correct
and I may have got duals wrong on maximization etc.  But if people think
it useful then this can be fixed.

John Forrest

On Tue, 2011-02-08 at 19:04 -0200, Haroldo Santos wrote:
> Hi Forrest/Ted,
>  
> To write LPs in MathProg is much easier and practical than write a C++
> program to generate the model. It is a great language to quickly test
> different formulations.
> 
> Easy access to this feature would clearly allow many newcomers to use
> CBC.
> 
> If this could be included in the default CBC distribution, it would be
> a nice addition.
> 
> []'s
> 
> On Tue, Feb 8, 2011 at 3:26 PM, John Forrest
> <john.forrest at fastercoin.com> wrote:
>         Is there interest in having better gmpl-cbc connectivity?
>         
>         I can get cbc to model sudoku.mod and print the report in
>         glpk/example/sudoku.mod - but it aborts on a memory leak after
>         report.
>         This is because memory was not free when problem was read in
>         in
>         CoinMpsIO.cpp - I can fix but it needs a few more hours.
>         
>         John Forrest
>         
>         
>         
>         
>         
>         On Tue, 2011-02-08 at 09:14 +0100, Michal Kaut wrote:
>         > Just a question about the level of GMPL support: last time I
>         tried, only
>         > Symphony parsed also the reporting parts of the .mod files
>         (printing of
>         > the results etc) - Cbc simply ignored them.
>         > Has it improved now? And if not, are there any plans to do
>         it? (Solving
>         > a problem does not really help, if one cannot print the
>         results
>         > afterwards..)
>         >
>         > Regards,
>         > Michal
>         >
>         >
>         > On 07/02/11 19:06, Ted Ralphs wrote:
>         > > This is not really the right mailing list for question
>         about CBC, so
>         > > I'm cc'ing the Cbc list. All of the COIN-OR projects can
>         read GMPL in
>         > > principle if the code is built with GLPK present. The
>         ability to read
>         > > GMPL files is provided in the CoinUtils project through a
>         link to
>         > > GLPK. With Cbc, if you specify the model and data files
>         with a "%" in
>         > > between as your input file name, it will read them as
>         GMPL, i.e.,
>         > >
>         > > cbc sample.mod%sample.dat
>         > >
>         > > To build cbc with GMPL support using the autotools, you
>         would go into
>         > > the ThirdParty/Glpk directory and run the command
>         > >
>         > > ./get.Glpk
>         > >
>         > > This will download the source for the proper version of
>         Glpk. Then
>         > > just configure and build as usual. The Glpk source will be
>         > > auto-detected, built, and linked. We cannot distribute
>         binaries that
>         > > include this capability because of restrictions imposed by
>         the GPL.
>         > > Feel free to post further questions to either the Cbc list
>         or the
>         > > CoinUtils list, as appropriate.
>         > >
>         > > Cheers,
>         > >
>         > > Ted
>         > >
>         > > On Mon, Feb 7, 2011 at 12:10 PM, Brian
>         Borchers<borchers at nmt.edu>  wrote:
>         > >>
>         > >>>
>         > >>> Message: 1
>         > >>> Date: Mon, 7 Feb 2011 10:02:58 +0530
>         > >>> From: "ranganaths"<ranganath.s at excelindia.com>
>         > >>> Subject: [Clp] GNUMath Prog
>         > >>> To:<clp at list.coin-or.org>
>         > >>> Message-ID:<001201cbc680$192379e0$4b6a6da0
>         $@s at excelindia.com>
>         > >>> Content-Type: text/plain; charset="us-ascii"
>         > >>>
>         > >>> Hello,
>         > >>>
>         > >>>
>         > >>>
>         > >>>                 Does COIN-OR BC(CBC) accept the input
>         model in the
>         > >>> GNUMathProg format?
>         > >>>
>         > >>>
>         > >>
>         > >> You can use glpk to convert a model from GNU Math Prog
>         format to MPS format
>         > >> and then use the MPS file as input into the COIN-OR
>         tools.
>         > >>
>         > >>
>         > >>
>         > >> --
>         > >> Brian Borchers                          borchers at nmt.edu
>         > >> Department of Mathematics
>          http://www.nmt.edu/~borchers/
>         > >> New Mexico Tech                       Phone: (575)
>         322-2592
>         > >> Socorro, NM 87801                   FAX: (575) 835-5366
>         > >>
>         > >> _______________________________________________
>         > >> Clp mailing list
>         > >> Clp at list.coin-or.org
>         > >> http://list.coin-or.org/mailman/listinfo/clp
>         > >>
>         > >>
>         > >
>         > >
>         > >
>         >
>         > _______________________________________________
>         > 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
>         
> 
> 
> 
> -- 
> =============================================================
> Haroldo Gambini Santos
> Computing Department - Universidade Federal de Ouro Preto - UFOP
> email: haroldo [at ] iceb.ufop.br
> home/research page: http://www.iceb.ufop.br/decom/prof/haroldo/
>  
> "Computer science is no more about computers than astronomy 
> is about telescopes." Edsger Dijkstra
>  




More information about the Cbc mailing list