<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Thanks for the tip Ed. That sounds like exactly what I want.</div><div><br></div><div>I changed repeat.cpp to use readLp instead of readMps. Then I was able to run it on my file.</div><div><br></div><div>Any idea why it only gives 3 answers, [2 0 0 2], [0 2 0 2], [1 1 1 1]? Then it gives up with:</div><div><br></div><div><div>Cbc0006I The LP relaxation is infeasible or too expensive</div><div>/coin/Coin-Pkg/bin/terry/ex2.lp took 0.00074 seconds, 0 nodes with objective 1.79769e+308 Finished</div></div><div><br></div><div><br></div><div>I added bounds 0 to 10 for each variable and I tried changing the obj and constraints slightly, but I could not get it to give more than 2 or 3 solutions before failing. I guess there's a lot more I need to understand first.</div><div><br></div><div>Terry</div><div><br></div><div><br></div><div><br><div><div>On Jun 12, 2011, at 7:56 PM, Ed Bulog wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi Terry,<br><br>While I'm far from an expert, I remember that the "repeat.cpp" example (<a href="https://projects.coin-or.org/Cbc/browser/stable/2.7/Cbc/examples/repeat.cpp">https://projects.coin-or.org/Cbc/browser/stable/2.7/Cbc/examples/repeat.cpp</a>) essentially does this. I believe it repeatedly finds the optimal solution and then adds a cut to remove it, so that you end up with the 20 "best" solutions. Hope that helps you.<br>
<br>Cheers,<br><br>Ed<br><br><div class="gmail_quote">On 13 June 2011 11:08, Terry <span dir="ltr">&lt;<a href="mailto:maillst@aol.com">maillst@aol.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
CBC will find an optimal solution to my IP problem. Now I want the "next" optimal solution. That is, I want to make the previous solution infeasible and run CBC again to find another solution.<br>
<br>
Here's an example I'm working with:<br>
<br>
Minimize<br>
&nbsp;x1 + x2 + x3 + x4<br>
Subject To<br>
&nbsp;5 x1 + &nbsp;5 x2 &gt;= 10<br>
&nbsp;7 x3 + 14 x4 &gt;= 21<br>
Integers<br>
&nbsp;x1<br>
&nbsp;x2<br>
&nbsp;x3<br>
&nbsp;x4<br>
End<br>
<br>
<br>
Optimal - objective value 4.00000000<br>
 &nbsp; &nbsp; &nbsp;0 x1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br>
 &nbsp; &nbsp; &nbsp;1 x2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br>
 &nbsp; &nbsp; &nbsp;2 x3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br>
 &nbsp; &nbsp; &nbsp;3 x4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br>
<br>
<br>
Can I add a constraint so that [2 0 1 1] is infeasible, but allows any other answer? I'm afraid this is a stupid question, but I don't see how to do it.<br>
<br>
Thanks.<br>
Terry<br>
<br>
<br>
<br>
_______________________________________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/mailman/listinfo/cbc</a><br>
</blockquote></div><br>
</blockquote></div><br></div></body></html>