<div dir="ltr">Dear Gerald,<div><br></div><div>I'm having problems when adding a new variable into the problem just before including it in a cut. The (abbreviated) output below shows my problem. In this example, all original variables get fixed</div><div>in presolving. We then try to separate using my constraint handler's separator. The separator generates a valid cut which includes a new variable <cb1(bob)>. This variable is added (using addVar), it is down-locked and then</div><div>the cut with this new variable included. The cut is printed out below: this is the correct cut (since the other two variables in the cut are fixed at this point).</div><div><br></div><div>However, rather than just fixing cb1(bob) to 1 and returning the optimal solution, SCIP tells me that we have a cutoff, and that the problem is infeasible. If I add the variable  cb1(bob) at the start, all is well and I get the correct optimal solution. (In fact, cb1(bob) gets fixed to 1 in presolving which is fine.)</div><div><br></div><div>Any ideas what the problem is? I suspect this is something to do with the original vs transformed problem</div><div><br></div><div>Best wishes,</div><div><br></div><div>James</div><div><br></div><div><div><font face="monospace, monospace"> time | node  | left  |LP iter|LP it/n| mem |mdpt |frac |vars |cons |cols |rows |cuts |confs|strbr|  dualbound   | primalbound  |  gap   </font></div><div><font face="monospace, monospace">  0.0s|     1 |     0 |     0 |     - | 195k|   0 |   0 |   0 |   1 |   0 |   0 |   0 |   0 |   0 | 0.000000e+00 |      --      |    Inf </font></div><div><span style="font-family:monospace,monospace">[cons_folinear.c:371] debug: separating LP solution for first order linear constraint <fo2>.</span><br></div><div><font face="monospace, monospace">[cons_folinear.c:401] debug: New variable:</font></div><div><font face="monospace, monospace">  [binary] <cb1(bob)>: obj=2, global bounds=[-0,1], local bounds=[-0,1]</font></div><div><font face="monospace, monospace">[cons_folinear.c:403] debug: Down lock = <1>, Up lock = <0></font></div><div><font face="monospace, monospace">[cons_folinear.c:438] debug: Variable in cut:</font></div><div><font face="monospace, monospace">  [binary] <smokes(bob)_neg>: obj=0, original bounds=[0,1], negated: 1 - <smokes(bob)></font></div><div><font face="monospace, monospace">[cons_folinear.c:449] debug: Variable in cut:</font></div><div><font face="monospace, monospace">  [binary] <cb1(bob)>: obj=2, global bounds=[-0,1], local bounds=[-0,1]</font></div><div><font face="monospace, monospace">[cons_folinear.c:449] debug: Variable in cut:</font></div><div><font face="monospace, monospace">  [binary] <cancer(bob)>: obj=0, original bounds=[0,1]</font></div><div><font face="monospace, monospace">cut: 1 <= +1<cb1(bob)> <= 1e+20</font></div><div><font face="monospace, monospace">[cons_folinear.c:479] debug: separated 1 cuts.</font></div><div><font face="monospace, monospace">  0.0s|     1 |     0 |     0 |     - | 197k|   0 |   - |   1 |   1 |   1 |   0 |   1 |   0 |   0 | 0.000000e+00 |      --      |    Inf </font></div><div><font face="monospace, monospace">  0.0s|     1 |     0 |     0 |     - | 197k|   0 |   - |   1 |   1 |   1 |   0 |   1 |   0 |   0 |    cutoff    |      --      |   0.00%</font></div><div><font face="monospace, monospace">  0.0s|     1 |     0 |     0 |     - | 197k|   0 |   - |   1 |   1 |   1 |   0 |   1 |   0 |   0 |    cutoff    |      --      |   0.00%</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">SCIP Status        : problem is solved [infeasible]</font></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 September 2015 at 13:52, Gerald Gamrath <span dir="ltr"><<a href="mailto:gamrath@zib.de" target="_blank">gamrath@zib.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Dear James,<br>
      <br>
      you are only allowed to call SCIPaddPricedVar() during pricing,
      but you could add the variables just via SCIPaddVar(). You could
      even set the initial flag of the variable to FALSE so that SCIP
      will automatically price it into the LP (only) if needed.<br>
      <br>
      Best,<br>
      Gerald<br>
      <br>
      On 18.09.2015 11:28, James Cussens wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>I have an application where I generate cuts which include
          variables which do not exist yet. At present, I follow the
          normal two-stage approach: the cut is generated without the
          missing variables, and later a pricer deduces that they are
          worth adding and my application ensures they are added to the
          previously generated cuts.</div>
        <div><br>
        </div>
        <div>My pricer only ever generates variables which appear in the
          cuts I generate, so I suspect it will be more efficient to
          generate the missing variables *as soon as my cutting plane
          algorithm (CPA) has generated the cut*. That is, the idea is
          to create them just before adding the cut (which would then
          contain all its variables). My CPA generates (a representation
          of) the cut with all its variables, including those not
          already created (so it does a sort of pricing), so we have
          these variables immediately to hand at the point of adding the
          cut. It is true that, since we are generating variables
          unconditionally, we may end up with more variables than if we
          priced them in, but my guess is that we won't get too many
          unnecessary variables created. </div>
        <div><br>
        </div>
        <div>The CPA is implemented as the separator for a certain
          constraint handler. So presumably I could just add suitable
          calls to SCIPaddPricedVar in the separator callback, just
          before creating and adding the row (ie cut).</div>
        <div><br>
        </div>
        <div>Does anyone see a problem with doing this? It just seems an
          odd approach ....</div>
        <div><br>
        </div>
        <div>James</div>
        <div>
          <div><br>
          </div>
          -- <br>
          <div>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  <a href="tel:%2B44%20%280%291904%20500159" value="+441904500159" target="_blank">+44 (0)1904 500159</a><br>
            York YO10 5GE, UK                               <a href="http://www.cs.york.ac.uk/%7Ejc" target="_blank"></a><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>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Scip mailing list
<a href="mailto:Scip@zib.de" target="_blank">Scip@zib.de</a>
<a href="http://listserv.zib.de/mailman/listinfo/scip" target="_blank">http://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
Scip mailing list<br>
<a href="mailto:Scip@zib.de">Scip@zib.de</a><br>
<a href="http://listserv.zib.de/mailman/listinfo/scip" rel="noreferrer" target="_blank">http://listserv.zib.de/mailman/listinfo/scip</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="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>