[Cbc] CBC AMPL Interface

rpf at gmx.li rpf at gmx.li
Thu Jul 22 09:32:06 EDT 2010


Hello Everyone,

I just compiled CBC on Linux (Ubuntu 9.10) to run it with AMPL. I got
the ASL files using the get.ASL script and compiled successfully.

However, on running AMPL, CBC produces non-sensical output. I put
together a very small test problem to see whats going on. The
following test problem computes the number 100 in binary format:

-------------------------------------- milp-test.mod
-------------------------------------
set bits = 1..8;

var z{bits} binary;

minimize objective:  sum{i in bits} z[i];

number_con : z[1] + z[2]*2 + z[3]*4 + z[4]*8 + z[5]*16 + z[6]*32 +
z[7]*64+z[8]*128 = 100;

-------------------------------------- end milp-test.mod
-------------------------------------
-------------------------------------- milp-test.run
-------------------------------------

model milptest.mod;

option solver cbc;
option cbc_options "cuts=on log=10 feas=on slog=1";

solve;

display z, number_con;

-------------------------------------- end milp-test.run
-------------------------------------

The expected solution is 0 1 1 0 0 1 0 0. However, the CBC output
suggests that the problem was not read correctly:

---------------------------------- cbc 2.5 output (same for trunk)
------------------------------------------------
Cbc 1.04: cuts=on
log=10
feas=on
slog=1
cbc /tmp/at12743 -AMPL
env cuts=on log=10 feas=on slog=1
1 rows, 6 columns and 6 elements
Ampl objective offset is 1
Coin Cbc and Clp Solver version 2.5, build Jul 22 2010
command line - ampl cbc cuts on log 10 feas on slog 1 -solve -quit
(default strategy 1)
logLevel was changed from 1 to 10
slogLevel was changed from 1 to 1
Continuous objective value is 0.25 - 0.00 seconds
Cgl0004I processed model has 0 rows, 0 columns (0 integer) and 0 elements
Cbc0045I Options for feasibility pump -
Cbc0045I Accumulate of 1
Cbc0045I 6 retries
Cbc0045I Feasibility pump options of 40
Cbc0045I Tuning (fixing) 3
Cbc3007W No integer variables - nothing to do
Cuts at root node changed objective from 1 to -1.79769e+308
Probing was tried 0 times and created 0 cuts of which 0 were active
after adding rounds of cuts (0.000 seconds)
Gomory was tried 0 times and created 0 cuts of which 0 were active
after adding rounds of cuts (0.000 seconds)
Knapsack was tried 0 times and created 0 cuts of which 0 were active
after adding rounds of cuts (0.000 seconds)
Clique was tried 0 times and created 0 cuts of which 0 were active
after adding rounds of cuts (0.000 seconds)
MixedIntegerRounding2 was tried 0 times and created 0 cuts of which 0
were active after adding rounds of cuts (0.000 seconds)
FlowCover was tried 0 times and created 0 cuts of which 0 were active
after adding rounds of cuts (0.000 seconds)
TwoMirCuts was tried 0 times and created 0 cuts of which 0 were active
after adding rounds of cuts (0.000 seconds)
Result - Finished objective 1 after 0 nodes and 0 iterations - took
0.00 seconds (total time 0.00)
Total time 0.00
Cbc 1.04
z [*] :=
1  0
2  0
3  0
4  0
5  0
6  0
7  1
8  0
;

number_con = 0


---------------------------------- end cbc 2.5 output
------------------------------------------------
I found this post: http://list.coin-or.org/pipermail/cbc/2009-July/000301.html
on the mailinglist, so I went back and compiled CBC 2.2, which worked
well. The output was

---------------------------- cbc 2.2 output
---------------------------------------
Cbc 1.04: Optimal - objective value 0.25
Cbc 1.04 optimal, objective 1
0 nodes, 0 iterations, 0 seconds
z [*] :=
1  0
2  0
3  1
4  0
5  0
6  1
7  1
8  0
;

number_con = 0
---------------------------- end cbc 2.2 output
---------------------------------------

Does anyone have any idea how to make this work again for the current
cbc 2.5 / trunk?

Thanks

Hans



More information about the Cbc mailing list