<div dir="ltr"><div>Hi,</div><div>Just use GLPK to transform your problem into an .lp file, then analyze it.</div><div>I use to always run a first step with glpk in order to generate either a .mps or a .lp file, that I pass to CBC. Most of the time, it would take you hours to manually write a .lp file, as it extensively describes the problem.</div><div><br></div><div>Hervé</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 28, 2017 at 4:32 PM, binome SIR <span dir="ltr"><<a href="mailto:binome.sir2017@gmail.com" target="_blank">binome.sir2017@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div>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.</div><div>my .mod file is the following:</div><div>set coh dimen 2;</div><div>set noncoh dimen 2;</div><div><br></div><div>param M>0;</div><div>param N>0;</div><div>param ncmax>0;</div><div><br></div><div>param traf{1..M,1..M}>=0;</div><div><br></div><div>var x{1..M,1..ncmax}binary;</div><div><br></div><div>var u{i in 1..M-1,k in i+1..M,j in 1..ncmax}binary;</div><div><br></div><div>minimize trafInt:</div><div>sum{j in 1..ncmax}sum{i in 1..M-1}sum {k in i+1..M} traf[i,k]* u[i,k,j];</div><div><br></div><div><br></div><div><br></div><div>subject to cont2{i in 1..M}:</div><div>sum{j in 1..ncmax}x[i,j]=1;</div><div><br></div><div>subject to cont3{j in 1..ncmax}:</div><div>sum{i in 1..M}x[i,j]<=N;</div><div><br></div><div><br></div><div>subject to const5{(i,k) in noncoh,j in 1..ncmax}:</div><div>x[i,j]+x[k,j]<=1;</div><div><br></div><div>subject to const6{(i,k)in coh,j in 1..ncmax}:</div><div>x[i,j]-x[k,j]=0;</div><div>subject to const7 {i in 1..M-1,k in i+1..M,j in 1..ncmax}:</div><div>x[i,j]+(1-x[k,j])-u[i,k,j]<=1;</div><div>end; </div><div><br></div><div><br></div><div>as you could see, this model contain lot of arrays declaration, so how can I transforme it to CBC LP file format.</div><div>thank you.</div></div>
<br>______________________________<wbr>_________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><br>
<a href="https://list.coin-or.org/mailman/listinfo/cbc" target="_blank" rel="noreferrer">https://list.coin-or.org/<wbr>mailman/listinfo/cbc</a><br>
<br></blockquote></div><br></div>