<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Dear Diego,<br>
    <br>
    there is no event for a node being created, so I guess you are
    catching the NODEFOCUSED event, which is called later, when the
    processing of the node starts? The point is that after creating the
    two child nodes, but before processing them, other nodes may be
    processed and variables added during pricing at those nodes. But
    since variables are global in SCIP, they will also be active at the
    previously created child nodes and may violate the branching
    decision taken, so your approach B is incorrect while approach A
    should be valid. Please have a look at the FAQ as well, in
    particular,
    <a class="moz-txt-link-freetext" href="https://scip.zib.de/doc-6.0.1/html/FAQ.php#pricerandnodedata">https://scip.zib.de/doc-6.0.1/html/FAQ.php#pricerandnodedata</a> for how
    branching decisions can be stored and enforced effectively.<br>
    <br>
    Best,<br>
    Gerald<br>
    <br>
    <div class="moz-cite-prefix">On 23.04.19 15:36, Diego Delle Donne
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CALvdEpJE9QXJbd0s_yVM-E2Q-UuXKY-Td=qRUC3nwhg8Jseqjg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">Dear SCIP communit, 
                    <div><br>
                    </div>
                    <div>I'm coding a Branch & Price with a
                      branching rule quite similar to the Ryan-Foster
                      rule. So, when a branching is performed, some
                      variables need to be removed from the created
                      nodes (i.e., fixed to 0).</div>
                    <div><br>
                    </div>
                    <div>As a first approach (approach A), I had an
                      ObjEventhdlr which is called when a node is
                      created. It checks every existing variable and if
                      it needs to be removed the variable is fixed to 0.
                      I do this by calling SCIPchgVarUb(...) within
                      the scip_exec(...) method of my ObjEventhdlr.</div>
                    <div><br>
                    </div>
                    <div>This works fine, but I noted that it shouldn't
                      be necessary to iterate through EVERY existing
                      variable each time I branch, since the number of
                      variables to be fixed is usually just a small
                      portion of the existing ones. Moreover, in my
                      code, when I perform a branching, I already have
                      access to the (small) list of variables which
                      should be fixed. Hence, I tried to fix them at the
                      moment of the node creation (within the
                      scip_execlp(...) method of my ObjBranchrule
                      object) by using SCIPchgVarUbNode(...), and
                      forgetting about my ObjEventhdlr.<br>
                    </div>
                    <div><br>
                    </div>
                    <div>This new approach (approach B) seems to work
                      fine also and it is usually faster than the first
                      one (of course, that was the goal!), but I have
                      found some funny differences in some cases. For
                      instance, sometimes the rounding heuristic in
                      approach A finds better solutions than the one in
                      approach B. This allows approach A to end the
                      solving process faster than approach B, although
                      being "slower" for the first part of the process. </div>
                    <div><br>
                    </div>
                    <div>Any ideas on what's causing this behavior? I
                      would think that the solving process should be the
                      same for both approaches, as I am just omitting to
                      iterate through a bunch of variables which I won't
                      change anyway. Does SCIPchgVarUb(...) behave
                      differently from SCIPchgVarUbNode(...) in some
                      way?</div>
                    <div><br>
                    </div>
                    <div>Thanks in advance!</div>
                    <div>Best regards to all</div>
                    <div>Diego</div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
        <table style="border-top:1px solid #d3d4de">
          <tbody>
            <tr>
              <td style="width:55px;padding-top:18px"><a
href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
                  target="_blank" moz-do-not-send="true"><img
src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-green-avg-v1.png"
                    alt="" style="width: 46px; height: 29px;"
                    moz-do-not-send="true" width="46" height="29"></a></td>
              <td
style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Libre
                de virus. <a
href="http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
                  target="_blank" style="color:#4453ea"
                  moz-do-not-send="true">www.avg.com</a> </td>
            </tr>
          </tbody>
        </table>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Scip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Scip@zib.de">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>