<div dir="ltr"><div>Hi Jakob,</div><div><br></div><div>I got the patch applied by doing:</div><div><br></div>git apply --check --ignore-space-change --ignore-whitespace 0001-fix-bug-while-separating-previous-optimal-solution-i.patch<br><div><br></div><div>And the reoptimization/sepabestsol parameter is now working.</div><div><br></div><div>Thanks again for the patch!</div><div><br></div><div>James</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 September 2016 at 12:00, Jakob Witzig <span dir="ltr"><<a href="mailto:witzig@zib.de" target="_blank">witzig@zib.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi James!<br>
<br>
Please use the attached patch to fix the issue in your SCIP installation.<br>
<br>
Please check whether the patch is applicable first:<br>
<br>
  git apply --check 0001-fix-bug-while-separating-<wbr><a href="http://previous-optimal-solution-i.pa">previous-optimal-solution-i.pa</a><wbr>tch<br>
<br>
If everything works, execute the command again without '--check' and compile your SCIP installation subsequently.<br>
<br>
Cheers,<br>
Jakob<br>
<br>
<br>
Am 15.09.2016 um 17:19 schrieb Jakob Witzig:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi James,<br>
<br>
this sounds strange. Which SCIP version do you use? Could you send me<br>
the original problem file? Otherwise it is hard to see what goes wrong.<br>
<br>
Cheers,<br>
Jakob<br>
<br>
<br>
Am 15.09.2016 um 16:47 schrieb James Cussens:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Jakob,<br>
<br>
<br>
On 15 September 2016 at 14:14, Jakob Witzig <<a href="mailto:witzig@zib.de" target="_blank">witzig@zib.de</a><br>
<mailto:<a href="mailto:witzig@zib.de" target="_blank">witzig@zib.de</a>>> wrote:<br>
<br>
    Hi James,<br>
<br>
    what do you mean exactly with you suspect you doing it wrong? Do you<br>
    got wrong results?<br>
<br>
    Yes, the parameter mentioned below should exactly do the same as you<br>
    are doing by hand. Do you observe any differences between using the<br>
    parameter and separating OPTSOL by hand?<br>
<br>
<br>
<br>
I do observe a difference. When I set reoptimization/sepabestsol = TRUE<br>
and just do:<br>
Do k times:<br>
---Solve problem    SCIP_CALL( SCIPsolve(scip) );<br>
---Inspect best solution: SCIP_CALL( SCIPprintSol(scip,<br>
SCIPgetBestSol(scip), NULL, FALSE) );<br>
---Inspect best solution another way: SCIP_CALL( SCIPprintSol(scip,<br>
SCIPgetReoptLastOptSol(scip), NULL, FALSE) );<br>
---SCIP_CALL( SCIPfreeTransform(scip) );<br>
<br>
With one exception, I just get the same optimal solution on each<br>
iteration. It is as if the parameter is having no effect.<br>
The exception is that the first call to SCIP_CALL( SCIPprintSol(scip,<br>
SCIPgetReoptLastOptSol(scip), NULL, FALSE) );  prints out an infeasible<br>
solution.<br>
<br>
Perhaps I am looking in the wrong place for optimal solutions for k>1 or<br>
somehow preventing the best solutions from each iteration being<br>
separated.<br>
<br>
James<br>
<br>
<br>
<br>
<br>
    Cheers,<br>
    Jakob<br>
<br>
<br>
    Am 15.09.2016 um 14:03 schrieb James Cussens:<br>
<br>
        Dear SCIPers,<br>
<br>
        I am using reoptimization to solve a series of binary IPs, and I<br>
        suspect<br>
        I am doing it wrong.<br>
<br>
        My problem is analogous, I think, to the k-Constrained<br>
Shortest Path<br>
        Problem mentioned in Section 4.2 of Jakob Witzig's master<br>
        thesis. For my<br>
        original IP I want to get the optimal solution, then the 2nd<br>
        best, then<br>
        3rd best and so on. The objective function never changes.<br>
<br>
        I have set reoptimization/enable to TRUE and then do the<br>
following:<br>
<br>
        Do k times:<br>
        ---Solve problem    SCIP_CALL( SCIPsolve(scip) );<br>
        ---store information sufficient to identify optimal solution<br>
OPTSOL<br>
        ---SCIP_CALL( SCIPfreeTransform(scip) );<br>
        ---add in constraint ruling out just OPTSOL<br>
<br>
        I notice that there is a parameter<br>
        # separate the optimal solution, i.e., for constrained<br>
shortest path<br>
        # [type: bool, range: {TRUE,FALSE}, default: FALSE]<br>
        reoptimization/sepabestsol = FALSE<br>
<br>
        which, I suspect, can be used to do what I am doing 'by hand'.<br>
        Is this<br>
        the case?<br>
<br>
        More generally, I would appreciate knowing the correct recipe<br>
        for doing<br>
        this sort of thing (when using the SCIP callable library).<br>
<br>
        James<br>
<br>
        --<br>
        James Cussens<br>
        Dept of Computer Science &<br>
        York Centre for Complex Systems Analysis<br>
        Room 326, The Hub, Deramore Lane            Tel    +44 (0)1904<br>
        325371 <tel:%2B44%20%280%291904%20325<wbr>371><br>
        University of York                                        Fax<br>
+44<br>
        (0)1904 500159<br>
        York YO10 5GE, UK<br>
         <a href="http://www.cs.york.ac.uk/~jc" rel="noreferrer" target="_blank">http://www.cs.york.ac.uk/~jc</a><br>
        <a href="http://www.york.ac.uk/docs/disclaimer/email.htm" rel="noreferrer" target="_blank">http://www.york.ac.uk/docs/dis<wbr>claimer/email.htm</a><br>
        <<a href="http://www.york.ac.uk/docs/disclaimer/email.htm" rel="noreferrer" target="_blank">http://www.york.ac.uk/docs/di<wbr>sclaimer/email.htm</a>><br>
<br>
<br>
        ______________________________<wbr>_________________<br>
        Scip mailing list<br>
        <a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a> <mailto:<a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a>><br>
        <a href="http://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">http://listserv.zib.de/mailman<wbr>/listinfo/scip</a><br>
        <<a href="http://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">http://listserv.zib.de/mailma<wbr>n/listinfo/scip</a>><br>
<br>
<br>
<br>
    --<br>
    Jakob Witzig<br>
<br>
    Zuse Institute Berlin (ZIB)<br>
<br>
    Division Mathematical Optimization and Scientific Information<br>
    Research Group Mathematical Optimization Methods<br>
<br>
    Takustrasse 7<br>
    14195 Berlin<br>
<br>
    Tel. : <a href="tel:%2B49%20%280%2930%2084185-416" value="+493084185416" target="_blank">+49 (0)30 84185-416</a> <tel:%2B49%20%280%2930%2084185<wbr>-416><br>
    Fax  : <a href="tel:%2B49%20%280%2930%2084185-269" value="+493084185269" target="_blank">+49 (0)30 84185-269</a> <tel:%2B49%20%280%2930%2084185<wbr>-269><br>
    email: <a href="mailto:witzig@zib.de" target="_blank">witzig@zib.de</a> <mailto:<a href="mailto:witzig@zib.de" target="_blank">witzig@zib.de</a>><br>
<br>
<br>
<br>
<br>
--<br>
James Cussens<br>
Dept of Computer Science &<br>
York Centre for Complex Systems Analysis<br>
Room 326, The Hub, Deramore Lane            Tel    <a href="tel:%2B44%20%280%291904%20325371" value="+441904325371" target="_blank">+44 (0)1904 325371</a><br>
University of York                                        Fax  +44<br>
(0)1904 500159<br>
York YO10 5GE, UK<br>
<a href="http://www.cs.york.ac.uk/~jc" rel="noreferrer" target="_blank">http://www.cs.york.ac.uk/~jc</a><br>
<a href="http://www.york.ac.uk/docs/disclaimer/email.htm" rel="noreferrer" target="_blank">http://www.york.ac.uk/docs/dis<wbr>claimer/email.htm</a><br>
</blockquote>
<br>
<br>
</blockquote>
<br>
<br>
-- <br>
Jakob Witzig<br>
<br>
Zuse Institute Berlin (ZIB)<br>
<br>
Division Mathematical Optimization and Scientific Information<br>
Research Group Mathematical Optimization Methods<br>
<br>
Takustrasse 7<br>
14195 Berlin<br>
<br>
Tel. : <a href="tel:%2B49%20%280%2930%2084185-416" value="+493084185416" target="_blank">+49 (0)30 84185-416</a><br>
Fax  : <a href="tel:%2B49%20%280%2930%2084185-269" value="+493084185269" target="_blank">+49 (0)30 84185-269</a><br>
email: <a href="mailto:witzig@zib.de" target="_blank">witzig@zib.de</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">James Cussens<br>Dept of Computer Science &<br>York Centre for Complex Systems Analysis<br>Room 326, The Hub, Deramore Lane            Tel    +44 (0)1904 325371<br>University of York                                        Fax  +44 (0)1904 500159<br>York YO10 5GE, UK                               <a href="http://www.cs.york.ac.uk/~jc" target="_blank">http://www.cs.york.ac.uk/~jc</a><br><a href="http://www.york.ac.uk/docs/disclaimer/email.htm" target="_blank">http://www.york.ac.uk/docs/disclaimer/email.htm</a></div>
</div>