[Cbc] Newbie question about use of CBC and how to specify integraly constraints?

Haroldo Gambini Santos haroldo.santos at gmail.com
Thu Mar 17 15:17:40 EDT 2016


Hi Jonatan,

Tested with the last lp of the page, everything worked well.
Which CBC version are you using ?

This was the solution I obtained:
Optimal - objective value -122.50000000
       0 x1                    40                      -4
       1 x2                  10.5                       0
       2 x3                  19.5                       0
       3 x4                     3                    32.5



On 17-03-2016 12:34, Jonatan Knud Lauritsen wrote:
>
>
>
> I did copy/paste of the last problem from the link CPLEX LP file 
> format <http://lpsolve.sourceforge.net/5.0/CPLEX-format.htm> to the 
> file and I tried to run cbc against this file but the cbc crashed. I 
> also tried to run cbc against valid *.lp file (which is made by 
> lpsolve and is recognized by lpsolve) but cbc crashed again. From my 
> experience cbc accepts mps files only. Is there some test cplex lp 
> file available?
> 	
> 	
> 	
> 	
> CPLEX LP file format 
> <http://lpsolve.sourceforge.net/5.0/CPLEX-format.htm>
> The CPLEX LP file format provides a facility for entering a problem in 
> a natural, algebraic LP formulation from the keyboard. The problem can 
> be modified and saved from within lpsolve. This procedure is one way 
> to create a file in a format that lpsolve can read. An alternative tec...
>
> Se på lpsolve.sourceforge.net 
> <http://lpsolve.sourceforge.net/5.0/CPLEX-format.htm>
> 	
> Forhåndsvis efter Yahoo
>
>
>
> Den 17:17 torsdag den 17. marts 2016 skrev Haroldo Gambini Santos 
> <haroldo.santos at gmail.com>:
>
>
> Hi Jonatan,
>
> CBC also loads problems in the CPLEX LP file format, which is much 
> simpler in my opinion.  
> (http://lpsolve.sourceforge.net/5.0/CPLEX-format.htm)
>
> To load a problem in LP format and save a solution in a TXT file just 
> call:
>
> cbc  problem.lp  solve  solu solution.txt
>
> Cheers,
>
> Haroldo
>
> On 17-03-2016 10:31, Jonatan Knud Lauritsen wrote:
>> Regarding use of cbc. I understand that problem can be loaded and 
>> saved from and to MPS file using commands import and export. But what 
>> are commands for displaying and exporting to file the results of 
>> optimization, specifically - the values of variables?
>>
>>
>> Den 15:25 torsdag den 17. marts 2016 skrev Jonatan Knud Lauritsen 
>> <jonatan.lauritsen at yahoo.dk> <mailto:jonatan.lauritsen at yahoo.dk>:
>>
>>
>>
>>
>>
>> Hi!
>>
>> I am starting to use CBC. I need integer linear programming solver 
>> and apparently CBC is the right software from the COIN-OR projects (I 
>> am not sure about Symphony project, maybe it can solve integer linear 
>> programs as well). I am confused how to use CBC. I expected cbc.dll, 
>> but there is only cbc.exe available. I am trying to use cbc.exe, I 
>> managed to import and solve problem but I don't understand how to get 
>> results back - e.g. how to see (and save to file) values of the 
>> variables? That is the first question.
>>
>> The second question is - is there cbc.dll available? I found 
>> CoinMP.dll and tried to use it, but it seems to me an completely 
>> incomplete project. E.g. after importing and preparing problems, the 
>> getColCount and getRowCount returns zero values. One can see in the 
>> source code that lot of methodes simply return dummy value and does 
>> nothing. So - how CBC is intended to use? My impression is that CBC 
>> is simple collection of source files and one should combine, 
>> integrate them and build them as one needes, there is no ready dll 
>> (apart from cbc.exe, which is not quite suitable to be embedded in 
>> other software as it works as interactive session and not as 
>> input-output program).
>>
>> The third question is about mps file format which I am using. How to 
>> specify integrality constraints on variables in this file format? 
>> Maybe cbc automatically assumes that all the unkown variables will be 
>> integers? wikipedia mentions that MPS extensions are suitable for 
>> specifying integrality constraints but do CBC supports such 
>> extensions and where they ar documented?
>>
>> Thanks in advance!
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Cbc mailing list
>> Cbc at list.coin-or.org <mailto:Cbc at list.coin-or.org>
>> http://list.coin-or.org/mailman/listinfo/cbc
>
> -- 
> ==================================================
> Haroldo Gambini Santos
> D.Sc, Computer Science
> Universidade Federal de Ouro Preto
> http://www.decom.ufop.br/haroldo/
>
>
>
>
>
>
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc

-- 
==================================================
Haroldo Gambini Santos
D.Sc, Computer Science
Universidade Federal de Ouro Preto
http://www.decom.ufop.br/haroldo/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20160317/6b00d945/attachment-0001.html>


More information about the Cbc mailing list