[Cbc] multidimentionnal array in lp file format

binome SIR binome.sir2017 at gmail.com
Sun May 28 10:32:33 EDT 2017


Hello,
I am starting with the cbc solver after using GLPK solver, i need to
transforme the model i had wrote in .mod format to a .lp file format, the
problem is that a can't find how to declare arrays in lp farmat.
my .mod file is the following:
set coh dimen 2;
set noncoh dimen 2;

param M>0;
param N>0;
param ncmax>0;

param traf{1..M,1..M}>=0;

var x{1..M,1..ncmax}binary;

var u{i in 1..M-1,k in i+1..M,j in 1..ncmax}binary;

minimize trafInt:
sum{j in 1..ncmax}sum{i in 1..M-1}sum {k in i+1..M} traf[i,k]* u[i,k,j];



subject to cont2{i in 1..M}:
sum{j in 1..ncmax}x[i,j]=1;

subject to cont3{j in 1..ncmax}:
sum{i in 1..M}x[i,j]<=N;


subject to const5{(i,k) in noncoh,j in 1..ncmax}:
x[i,j]+x[k,j]<=1;

subject to const6{(i,k)in coh,j in 1..ncmax}:
x[i,j]-x[k,j]=0;
subject to const7 {i in 1..M-1,k in i+1..M,j in 1..ncmax}:
x[i,j]+(1-x[k,j])-u[i,k,j]<=1;
end;


as you could see, this model contain lot of arrays declaration, so how can
I transforme it to CBC LP file format.
thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20170528/aa5ae1cc/attachment.html>


More information about the Cbc mailing list