<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Lan,<br>
    <br>
    sorry for taking so long to respond. There are two concepts that I
    would like to mention. The first is the so-called effective root
    depth. During search, it may eventually happen that say, the left
    subtree of the root node has been completely searched. At this
    moment, the right child node effectively becomes the new root node,
    and therefore, the effective root depth of SCIP is increased by 1.<br>
    <br>
    All constraints added to nodes at the effective root depth or even
    higher are considered global. You can check for the effective root
    depth through a call to SCIPgetEffectiveRootDepth() from
    scip_tree.h.<br>
    <br>
    The second concept is the concept of the "validnode" argument of
    SCIPaddConsNode(). If the node where this constraint is valid is
    higher than the effective root depth, the constraint is marked as a
    global constraint.<br>
    <br>
    Either way, this change happens through the method
    SCIPconsSetLocal(), which I suggest you watch within GDB (after
    compiling both your code and SCIP in debug mode) to trace back the
    source of your trouble.<br>
    <br>
    Let me know what you find out,<br>
    Gregor<br>
    <br>
    <div class="moz-cite-prefix">Am 11.10.19 um 19:03 schrieb Ngô Lan:<br>
    </div>
    <blockquote type="cite"
      cite="mid:8fcbf52bc29a41f59c847dbab0e2ed83@aalto.fi">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
        dir="ltr">
        <p>Hi Gregor,</p>
        <p><br>
        </p>
        <p>For my problem, in each child node, I would add 2 constraints
          (1 linear and 1 from my own constraint handler as a marker
          constraint). When printing out in <span style="color: rgb(33,
            33, 33); font-family: wf_segoe-ui_normal, "Segoe
            UI", "Segoe WP", Tahoma, Arial, sans-serif,
            serif, EmojiFont; font-size: 15px;">SCIP_DECL_CONSACTIVE,
            the right marker constraint is activated. For the linear
            constraint, I did create it as local constraint, save it in
            a vector in probdata and check it in my pricer but here when
            I used SCIPconsIsLocal, it returned False. I used also
            SCIPconsIsLocal directly after I created the linear
            constraint but here I got True. Is there something SCIP does
            internally that affects the local attribute?</span></p>
        <p><span style="color: rgb(33, 33, 33); font-family:
            wf_segoe-ui_normal, "Segoe UI", "Segoe
            WP", Tahoma, Arial, sans-serif, serif, EmojiFont;
            font-size: 15px;"><br>
          </span></p>
        <p><span style="color: rgb(33, 33, 33); font-family:
            wf_segoe-ui_normal, "Segoe UI", "Segoe
            WP", Tahoma, Arial, sans-serif, serif, EmojiFont;
            font-size: 15px;">Best,</span></p>
        <p><span style="color: rgb(33, 33, 33); font-family:
            wf_segoe-ui_normal, "Segoe UI", "Segoe
            WP", Tahoma, Arial, sans-serif, serif, EmojiFont;
            font-size: 15px;">Lan</span></p>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>From:</b> Gregor
          Hendel <a class="moz-txt-link-rfc2396E" href="mailto:hendel@zib.de"><hendel@zib.de></a><br>
          <b>Sent:</b> 11 October 2019 15:26:51<br>
          <b>To:</b> Ngô Lan<br>
          <b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:scip@zib.de">scip@zib.de</a><br>
          <b>Subject:</b> Re: [SCIP] Using SCIPdisableCons in problem
          creation stage</font>
        <div> </div>
      </div>
      <div>Hi Lan,<br>
        <br>
        but in the Binpacking example, everything works as expected.
        Both constraints added by ryanfoster-branching are inactive at
        first, because they are added to the child nodes. They are only
        activated when their nodes become active.
        <br>
        <br>
        <ol>
          <li>Did you accidentally create your constraints with the
            "local" flag set to FALSE?
          </li>
          <li>Can you trace back when the constraint gets activated? You
            can do this by printing a nice debug message from within the
            SCIP_DECL_CONSACTIVE-callback of your constraint handler.<br>
          </li>
        </ol>
        <br>
        Best,<br>
        Gregor<br>
        <br>
        <div class="moz-cite-prefix">Am 10.10.19 um 12:21 schrieb Ngô
          Lan:<br>
        </div>
        <blockquote type="cite"
          cite="mid:9693e4f7a1904c3881e79b465493e3ef@aalto.fi">
          <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
          <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
            dir="ltr">
            <p>Hi Gregor,</p>
            <p><br>
            </p>
            <p>Yeah the second question is about the main scip. So I
              saved all the branching constraint to probdata after
              adding to main scip and later in subscip, going through
              the vector of branching constraints, checking which one is
              active using SCIPconsIsActive and getting the dual of
              those that are active. The issue here is that when I
              branch to 2 child nodes and enter the first child node, it
              says the the constraint for the other child node is also
              active in this node. I just followed what you did in
              binpacking example: create cons, <span
                style="font-family: Calibri, Helvetica, sans-serif,
                EmojiFont, "Apple Color Emoji", "Segoe UI
                Emoji", NotoColorEmoji, "Segoe UI
                Symbol", "Android Emoji", EmojiSymbols;
                font-size: 16px;">
                create child, </span>and add cons to child node. I think
              it is pretty clear so that is why I don't really have any
              ideas what can go wrong here. Any help is appreciated.</p>
            <p><br>
            </p>
            <p>Thank you for your time.</p>
            <p><br>
            </p>
            <p>Best,</p>
            <p>Lan </p>
          </div>
          <hr style="display:inline-block;width:98%" tabindex="-1">
          <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
              face="Calibri, sans-serif" color="#000000"><b>From:</b>
              Gregor Hendel
              <a class="moz-txt-link-rfc2396E"
                href="mailto:hendel@zib.de" moz-do-not-send="true"><hendel@zib.de></a><br>
              <b>Sent:</b> 10 October 2019 09:47:38<br>
              <b>To:</b> Ngô Lan; <a class="moz-txt-link-abbreviated"
                href="mailto:Scip@zib.de" moz-do-not-send="true">
                Scip@zib.de</a><br>
              <b>Subject:</b> Re: [SCIP] Using SCIPdisableCons in
              problem creation stage</font>
            <div> </div>
          </div>
          <div>Hello Lan,<br>
            <br>
            find the answers to your two questions inline.<br>
            <br>
            <div class="moz-cite-prefix">Am 10.10.19 um 01:40 schrieb
              Ngô Lan:<br>
            </div>
            <blockquote type="cite"
              cite="mid:fa2f98ba0ff44cf6a513f4b3d6621037@aalto.fi">
              <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
              <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
                dir="ltr">
                <p>Hi Gregor,</p>
                <p><br>
                </p>
                <p>Thank you for your reply. It works now. Would it be
                  possible to add the deleted constraints again to scip?
                  Ideally, when a node is entered again, I would like to
                  enable the constraint instead of creating a new
                  one. My code does not run yet so I haven't had chance
                  to test it.</p>
              </div>
            </blockquote>
            As long as you do not release the constraint pointers (using
            SCIPreleaseCons()), SCIP will not physically delete the
            constraint, but only remove it from the problem, so that you
            can later add them again. An explanation of the
            capture/release mechanism for variables can be found here <a
              class="moz-txt-link-freetext"
              href="https://scip.zib.de/doc/html/OBJ.php"
              moz-do-not-send="true">
              https://scip.zib.de/doc/html/OBJ.php</a>, the explanation
            also applies to constraints.<br>
            <blockquote type="cite"
              cite="mid:fa2f98ba0ff44cf6a513f4b3d6621037@aalto.fi">
              <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
                dir="ltr">
                <p> </p>
                <p><br>
                </p>
                <p>I also have another problem with the child nodes. So
                  for branching, I created a linear branching constraint
                  and a marker constraint from my constraints handler
                  and added them into a child node (sticking at node is
                  true). However, in subscip when I check in which
                  branch I am at using <span>SCIPconsIsActive, I get
                    true even for the constraints that were not created
                    in this node. Do you have any idea where things
                    might go wrong?</span></p>
              </div>
            </blockquote>
            As far as I understand your approach, all constraints of the
            subscip should be active, because at every node (of the main
            solving process), you free the transformed problem of the
            subscip and then you add exactly those constraints that
            reflect your current branching decision. Are you using
            SCIPconsIsActive on the main solving process constraints, or
            on the subscip constraints? For the main SCIP, I expect that
            all branching constraints (there might be several ones along
            the path from the root) are active, and the rest is not
            active.<br>
            <br>
            Kind regards,<br>
            Gregor<br>
             <br>
            <blockquote type="cite"
              cite="mid:fa2f98ba0ff44cf6a513f4b3d6621037@aalto.fi">
              <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
                dir="ltr">
                <p><span><br>
                  </span></p>
                <p><span>Best,</span></p>
                <p><span>Lan</span></p>
              </div>
              <hr style="display:inline-block;width:98%" tabindex="-1">
              <div id="divRplyFwdMsg" dir="ltr"><font
                  style="font-size:11pt" face="Calibri, sans-serif"
                  color="#000000"><b>From:</b> Scip
                  <a class="moz-txt-link-rfc2396E"
                    href="mailto:scip-bounces@zib.de"
                    moz-do-not-send="true">
                    <scip-bounces@zib.de></a> on behalf of Gregor
                  Hendel <a class="moz-txt-link-rfc2396E"
                    href="mailto:hendel@zib.de" moz-do-not-send="true">
                    <hendel@zib.de></a><br>
                  <b>Sent:</b> 09 October 2019 10:32:17<br>
                  <b>To:</b> <a class="moz-txt-link-abbreviated"
                    href="mailto:scip@zib.de" moz-do-not-send="true">
                    scip@zib.de</a><br>
                  <b>Subject:</b> Re: [SCIP] Using SCIPdisableCons in
                  problem creation stage</font>
                <div> </div>
              </div>
              <div>Good morning Lan,<br>
                <br>
                how about using SCIPdelCons() instead of
                SCIPdisableCons()?<br>
                <br>
                Let me know if that works for you,<br>
                Gregor<br>
                <br>
                <div class="moz-cite-prefix">Am 09.10.19 um 01:03
                  schrieb Ngô Lan:<br>
                </div>
                <blockquote type="cite"
                  cite="mid:0976bd261e9e485ca86dc452ba46b70a@aalto.fi">
                  <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
                  <div id="divtagdefaultwrapper" dir="ltr"
                    style="font-size: 12pt; color: rgb(0, 0, 0);
                    font-family: Calibri, Helvetica, sans-serif,
                    EmojiFont, "Apple Color Emoji",
                    "Segoe UI Emoji", NotoColorEmoji,
                    "Segoe UI Symbol", "Android
                    Emoji", EmojiSymbols;">
                    <p>Hi all,</p>
                    <p><br>
                    </p>
                    <p>I am solving a project scheduling problem using
                      branch-price-cut and I am having an issue with <span>SCIPdisableCons
                        function. So after each pricing iteration, I
                        will not release the subscip but only free the
                        transformed problem using SCIPfreetransform and
                        modify the objective function of the subscip in
                        the next iteration. During branching, in
                        CONSACTIVE, I will create an additional
                        constraint for the subproblem depending on the
                        branching decision and in CONSDEACTIVE, I will
                        disable the related constraint using <span>SCIPdisableCons.
                          However, I got the error: <span>cannot call
                            method <SCIPdisableCons> in problem
                            creation stage. Do you know another function
                            that can work? Or what should I do
                            differently?</span></span></span></p>
                    <p><span><span><span><br>
                          </span></span></span></p>
                    <p><span><span><span>Thank you for your time,</span></span></span></p>
                    <p><br>
                    </p>
                    <p>Best,</p>
                    <p>Lan</p>
                  </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" moz-do-not-send="true">Scip@zib.de</a>
<a class="moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip" moz-do-not-send="true">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
                </blockquote>
                <br>
              </div>
            </blockquote>
            <br>
          </div>
        </blockquote>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>