<div dir="ltr">Hi Mike - and many thanks for your reply.<div><br></div><div>I had completely missed there was a CMPL2 in the works... I was wondering why activity on the original source repo seemed to have slowed down a bit in the recent years. Great to hear there's active work on a new version. Would love to beta test CMPL2 with OverlayPal.</div><div><br></div><div>I did actually get crashes when trying to use CMPL 1.12, which is why I've stuck with the older 1.11 for both Windows and Linux.</div><div>I was actually going to report that bug... but with CMPL2 around the corner I guess it's better to raise any bugs for CMPL2 instead?</div><div><br></div><div><div>I tried cloning the CMPL2 repo but could not get it building with Qt creator 4.14 for Windows. I'll see if I can figure the compilation problems out in the week, but if there's going to be a compiled binary that might be a better start for me.</div><div></div></div><div><br></div><div>Unfortunately I think neither Gurobi nor CPLEX are affordable alternatives for my small niche project. I'll have to stick to the free alternatives for now. </div><div>So I think the only other possible alternative for the solver backend is GLPK, but I'm not sure how it compares with CBC for integer problems.</div><div><br></div><div>However I'm pretty sure that CBC must support a no-objective solve somehow, given that PuLP allowed me to just omit the objective when using the CBC backend. But the low-level API of CBC is a bit too much for me to digest at the moment :)</div><div><br></div><div>Kind Regards,</div><div>Michel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 19, 2021 at 12:03 PM Mike Steglich <<a href="mailto:mike.steglich@th-wildau.de">mike.steglich@th-wildau.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="ltr">Hi Michel,</div><div dir="ltr"><br></div><div dir="ltr">Thank you for your interest in CMPL. Your project sounds very interesting!</div><div dir="ltr"><br></div><div dir="ltr">Please see my answers below:</div><div dir="ltr"><br><blockquote type="cite">Am 18.06.2021 um 00:34 schrieb Michel Iwaniec <<a href="mailto:michel.iwaniec@gmail.com" target="_blank">michel.iwaniec@gmail.com</a>>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hi,<br><br>I have a few questions regarding CMPL, which are sort-of-related, as they both relate to trying to stop CMPL / CBC solving sooner using either a time-out value or tweaking the objective.<br><br>First a bit of background: My GPL project that uses CMPL + CBC is an image-to -background+sprites converter for the 8-bit NES / Famicom console: <a href="https://github.com/michel-iwaniec/OverlayPal" target="_blank">https://github.com/michel-iwaniec/OverlayPal</a><br><br>At the moment I've just been invoking CMPL as a sub-process from my own program, although I do plan to build CMPL from source to integrate it more properly at some point in the future.<br><br>I've been really impressed with CMPL's neat mathematical language, and especially the support for variable products.<br>I previously used PuLP in Python where I kept introducing "big-M-logic", and my code got very difficult to maintain as the model grew in complexity. CMPL's variable-product-feature really got things cleaned up again.<br><br>Anyway, on to the questions/issues I'm having:<br><br>*** Question#1 ***<br><br>My program has a need for a variable timeout that can be set from the GUI. However, while the CMPL language file allows setting a fixed timeout using a parameter "%opt cbc seconds 123" I have not found any way to set this from the command-line when executing cmpl(.exe). Nor have I been able to specify it in my data file included using the "%data" directive.<br><br>So my current work-around is to just create another copy of my .cmpl program file that has the "%opt cbc seconds 123" parameter line prepended to it, and run this program instead. It works but is an extra step I'd rather avoid if I could.<br><br>So is setting the timeout using command-line parameters / data files not supported, or have I just missed something obvious here?<br></div></div></blockquote><div><br></div><div>In CMPL1, solver options can only be defined as CMPL headers.  This will change in CMPL2, for which we will soon start a beta phase. (I am working on the manual as last step before the official beta phase starts.)  I can send a link to the current beta versions next week. The source can be found here: <a href="https://github.com/MikeSteglich/Cmpl2" target="_blank">https://github.com/MikeSteglich/Cmpl2</a></div><div><br></div><div> </div><div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><br>*** Question#2 ***<br><br>Secondly, I'd also like to support a mode where *any* valid solution is accepted by CMPL, to avoid spending too much time on refining a valid solution. i.e., this mode should accept the first valid solution and only use the timeout where finding a solution / deciding the problem is unsolvable takes too long to be acceptable.<br><br>When I used PuLP + CBC, this was easy enough to do by just leaving out the objective of the optimization problem entirely.<br><br>But the same trick didn't seem to work with CMPL. If I try to remove the "objective" section I get an error from cmpl(.exe) saying "Error (interfaces): No objective function found.". <br><br>Is there some existing way to achieve this which I haven't thought of?<br></div></div></blockquote><div><br></div><div><div>If you use Gurobi or Cplex, %display solutionPool might help. I have put this problem for Cbc on my ToDo list.</div></div><div><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">*** Question#3 ***<br><br>Kind of a follow-up to Q#2. Another "mode" that might be useful in my case is to combine both of these features, by having the ability to set a timeout that is ignored until at least one valid solution is found. <div>i.e., the intended behavior is that my program should at least keep running until a valid solution has been found, in order to produce a valid result for the user... but it should not spend any more time finding a better solution if the provided time budget has already been exhausted.<br><br>I'm already assuming this sort of configurability is probably a bit too specific to support using either the existing command-line parameters or language directives. But I was wondering if there might be some relatively easy way to do it using CMPL's internal C++ API?<br><br>Thanks again for making such a useful open-source tool! :)<br></div></div></div></blockquote><div><br></div><div>SolutionPool works in this way in combination with e.g. MipGap …</div><br><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div><br>// Michel<br></div></div>
<span>_______________________________________________</span><br><span>Cmpl mailing list</span><br><span><a href="mailto:Cmpl@list.coin-or.org" target="_blank">Cmpl@list.coin-or.org</a></span><br><span><a href="https://list.coin-or.org/mailman/listinfo/cmpl" target="_blank">https://list.coin-or.org/mailman/listinfo/cmpl</a></span></div></blockquote><br></div><div>Mike</div></div></blockquote></div>