<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML DIR=ltr><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"></HEAD><BODY>
<DIV id=idOWAReplyText10929 dir=ltr>
<DIV dir=ltr><FONT size=2>Hello,</FONT></DIV>
<DIV dir=ltr><FONT size=2>what can go wrong if I get a non-integer solution 
to&nbsp;the following&nbsp;integer linear program&nbsp;:</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT color=#008000 size=2>
<P>// initialize model for MPS</P></FONT><FONT size=2>
<P>modelForILP = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> 
ClpSimplex;</P>
<P></FONT><FONT color=#008000 size=2>//set columns</P></FONT><FONT size=2>
<P>modelForILP-&gt;resize(0,nrCol);</P>
<P></FONT><FONT color=#008000 size=2>// x-variables are binary and 
</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// have coefficient weight[i][j] in the 
objective </FONT><FONT size=2></P>
<P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2> (</FONT><FONT 
color=#0000ff size=2>int</FONT><FONT size=2> i=0;i&lt;nrJournals-1;i++)</P>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2>&nbsp;&nbsp; for</FONT><FONT size=2> 
(</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> 
j=i+1;j&lt;nrJournals;j++)</P>
<P>&nbsp;&nbsp; {</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counter[i][j] = counterNrCol;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; counterNrCol++;</P>
<P></FONT><FONT color=#008000 size=2><FONT 
color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>//putting 
(c[i][j]-c[j][i])*x[i][j]+ c[j][i] in the objective</P></FONT><FONT size=2>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
modelForILP-&gt;setObjCoeff(counter[i][j],c[i][j]-c[j][i]);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
modelForILP-&gt;setColLower(counter[i][j],0.0);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
modelForILP-&gt;setColumnUpper(counter[i][j],1.0);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
modelForILP-&gt;setInteger(counter[i][j]);</FONT><FONT color=#008000 
size=2></P></FONT><FONT size=2>
<P>&nbsp;&nbsp; }</P>
<P>}</P>
<P>modelForILP-&gt;setOptimizationDirection(1.0); </FONT><FONT color=#008000 
size=2>//1.0 minimizing, -1.0 maximizing</P></FONT>
<P><FONT color=#008000 size=2>//add constraints</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// 0 &lt;= x[i][j] + x[j][k] - x[i][k] 
&lt;= 1</P></FONT><FONT size=2>
<P>rowIndex = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> 
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>[3];</P>
<P>rowValue = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> 
</FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2>[3];</P>
<P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>(</FONT><FONT 
color=#0000ff size=2>int</FONT><FONT size=2> 
i=0;i&lt;nrJournals-2;i++)</FONT><FONT color=#008000 size=2>//nrJournals-2 oder 
nrJournals</P></FONT><FONT size=2>
<P>{</P>
<P></FONT><FONT color=#0000ff size=2>&nbsp;&nbsp; for</FONT><FONT 
size=2>(</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> 
j=i+1;j&lt;nrJournals;j++)</FONT><FONT color=#008000 size=2>//j=i+1 and 
nrJournals-1 oder 0 and nrJournals</P></FONT><FONT size=2>
<P>&nbsp;&nbsp; {</P>
<P></FONT><FONT color=#0000ff size=2><FONT 
color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT>for</FONT><FONT 
size=2>(</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> 
k=j+1;k&lt;nrJournals;k++)</FONT><FONT color=#008000 size=2>//k=j+1 oder 
k=0</P></FONT><FONT size=2>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</P>
<P></P>
<P></FONT><FONT color=#0000ff size=2><FONT 
color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</FONT>if</FONT><FONT size=2>(i!=j &amp;&amp; j&lt;k &amp;&amp; k!=i)</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rowIndex[0] = counter[i][j];</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rowIndex[1] = counter[j][k];</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rowIndex[2] = counter[i][k];</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rowValue[0] = 1;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rowValue[1] = 1;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
rowValue[2] = -1;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
modelForILP-&gt;addRow(3,rowIndex,rowValue,0.0,1.0);</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P>
<P>&nbsp;&nbsp; }</P>
<P>}</P>
<P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> []rowIndex;</P>
<P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> 
[]rowValue;</P></FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2>and then depending on the situation, add the following 
type of contraints, where temp4 = 0 or 1</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2><FONT size=2>
<P>rowIndex = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> 
</FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2>[1];</P>
<P>rowValue = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> 
</FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2>[1];</P>
<P>rowIndex[0] = variable; </FONT><FONT color=#008000 size=2>//column-number, 
i.e. the variable that has to be fixed</P></FONT><FONT size=2>
<P>rowValue[0] = 1;</P>
<P>modelForILP-&gt;addRow(1,rowIndex,rowValue,temp4,temp4);</P></FONT><FONT 
size=2>
<P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> []rowIndex;</P>
<P></FONT><FONT color=#0000ff size=2>delete</FONT><FONT size=2> 
[]rowValue;</P></FONT></FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT size=2>I'd be very happy if anyone of you has an 
idea!!!</FONT></DIV>
<DIV dir=ltr><FONT size=2>kind regards</FONT></DIV>
<DIV dir=ltr><FONT size=2>Kirsten</FONT></DIV></DIV></BODY></HTML>