<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Dear Mahdi,<br>
    <br>
    I am very sure now that it is a coding issue. ;-)<br>
    <br>
    I guess "return AddImpPaths(scip, Paths);" should rather be
    "SCIP_CALL( AddImpPaths(scip, Paths) );" in order to not return
    there and to not skip the remainder of the method.<br>
    <br>
    Best,<br>
    Gerald<br>
    <br>
    <div class="moz-cite-prefix">On 30.06.19 08:49, mahdi noorizadegan
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAH4sNwqcCEsUNS5YoDbmfxh3M6+2Vd+EroBakcHzGLy8eiB3ew@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">Dear Gerald,</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">Thanks for
          your reply.</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">The .lp file
          is not created at all for SCIPwriteTransProblem().<br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">I am not sure
          if it is a coding issue. The problem is similar to VRP.<br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">Here is the
          piece of the code.</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">In the below
          code the last line before Return SCIP_OKAY; (highlighted in
          green) in "
          SCIP_RETCODE ObjPricerGTE::AddImpPaths" is printed but the
          line after  "return AddImpPaths(scip, Paths)" (highlighted in
          red)  is not. <br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">When I add "
          SCIP_CALL( SCIPwriteTransProblem(scip, "GTEPricing.lp", "lp",
          FALSE) );
          " to the adding variable procedure i.e. "
          SCIP_RETCODE ObjPricerGTE::AddImpPaths", the .lp file is
          created.</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">As you see
          there is no if  condition that can affect the output. <br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">Regards,</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">Mahdi<br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">  SCIP_Real
          reduced_cost =FindShortestPath(pi, lambda, alpha, Paths);<br>
             if (  reduced_cost>0.001 )  {<br>
                     return AddImpPaths(scip, Paths);<br>
              <span style="background-color:rgb(204,0,0)"> 
             cout<<"\n reduced_cost";</span><br>
             }<br>
             SCIP_CALL( SCIPwriteTransProblem(scip, "GTEPricing.lp",
          "lp", FALSE) );</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><br>
        </div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">.</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">.</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">.</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">SCIP_RETCODE
          ObjPricerGTE::AddImpPaths(<br>
             SCIP*                 scip,               <br>
              vector<list<list<int> > >&    
           ImpPaths                <br>
             ) const{</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d">.....</div>
        <div class="gmail_default"
          style="font-family:georgia,serif;color:#20124d"><span
            style="background-color:rgb(0,255,0)">   cout<<"\n gen
            LP";</span><br>
                      return SCIP_OKAY;<br>
             }</div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Fri, 28 Jun 2019 at 01:26,
          Gerald Gamrath <<a href="mailto:gamrath@zib.de"
            moz-do-not-send="true">gamrath@zib.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 bgcolor="#FFFFFF"> Dear Mahdi,<br>
            <br>
            I am sorry, but I did not really understand what is going
            wrong, you need to give more detail. When do you call
            SCIPwriteTransProblem()? It does not write anything or are
            variables missing in the .lp file?<br>
            <br>
            If I understand you correctly, you have a function that adds
            the priced variables and that should write the problem,
            which does not happen, and also some output that you would
            expect which should be printed at the end of the function is
            not printed. I can only guess that you have some if
            conditions in the function that return earlier and thus, you
            do not reach the end of the function. But I cannot help you
            debug your code. You could compile in debug mode and run it
            with gdb to set break points and go step-by-step to see what
            happens, if you cannot identify it just by looking at the
            code.<br>
            <br>
            Best,<br>
            Gerald<br>
            <br>
            <div class="gmail-m_-8744283202116948061moz-cite-prefix">On
              26.06.19 08:31, mahdi noorizadegan wrote:<br>
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div class="gmail_default"
                  style="font-family:georgia,serif;color:rgb(32,18,77)">
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">Hi
                    Gerald,</div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                  </div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">I
                    have a pricing procedure which finds variables with
                    negative reduced cost.</div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">Once
                    they are found they are added to the master problem.
                    However, the .lp file via SCIPwriteTransProblem is
                    not created after addition. It is set to create .lp
                    file after addition of variables.</div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                  </div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">I
                    do cout "check" at the end of the variable adding
                    function (before return SCIP_OKAY) and also after
                    call for this function. While it leaves the function
                    and starts the pricing procedure, it does not print
                    the check point after the var adding function.
                    Therefore no .lp file is created.</div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">Could
                    you please let me know what I have done wrong?</div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                  </div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">Regards,</div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)">Mahdi<br>
                  </div>
                  <div class="gmail_default"
                    style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                  </div>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">On Sat, 25 May 2019 at
                  12:58, Gerald Gamrath <<a
                    href="mailto:gamrath@zib.de" target="_blank"
                    moz-do-not-send="true">gamrath@zib.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 bgcolor="#FFFFFF"> Dear Mahdi,<br>
                    <br>
                    even if you create a model with only linear
                    constraints, SCIP might upgrade them in presolving
                    to specialized linear constraints like knapsack or
                    set cover constraints. SCIP does not do this if you
                    marked a constraint to be modifiable, which you
                    should have done if priced variables will
                    potentially be added to the constraint. On the other
                    hand, if you will not add any priced variables to
                    the constraint, you don't need to mark it to be
                    modifiable, but you should also not need its dual
                    value.<br>
                    <br>
                    I would suggest you check what type the constraint
                    has via SCIPconshdlrGetName(SCIPconsGetHdlr(cons))
                    either in gdb or in your code.<br>
                    <br>
                    Best,<br>
                    Gerald<br>
                    <br>
                    <div
class="gmail-m_-8744283202116948061gmail-m_2669202180511048168moz-cite-prefix">On
                      22.05.19 14:45, mahdi noorizadegan wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">Hello,</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                        </div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">I
                          am implementing an IP using branch and price
                          method.</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">When
                          I want to get the dual value of constraints
                          which are all linear, I get the following
                          error</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                        </div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">[src/scip/cons_linear.c:17033]
                          ERROR: constraint is not linear</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                        </div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">What
                          can be wrong?</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)"><br>
                        </div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">Looking
                          forward to hearing from you,</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">Regards,</div>
                        <div class="gmail_default"
                          style="font-family:georgia,serif;color:rgb(32,18,77)">Mahdi<br>
                        </div>
                      </div>
                      <br>
                      <fieldset
class="gmail-m_-8744283202116948061gmail-m_2669202180511048168mimeAttachmentHeader"></fieldset>
                      <pre class="gmail-m_-8744283202116948061gmail-m_2669202180511048168moz-quote-pre">_______________________________________________
Scip mailing list
<a class="gmail-m_-8744283202116948061gmail-m_2669202180511048168moz-txt-link-abbreviated" href="mailto:Scip@zib.de" target="_blank" moz-do-not-send="true">Scip@zib.de</a>
<a class="gmail-m_-8744283202116948061gmail-m_2669202180511048168moz-txt-link-freetext" href="https://listserv.zib.de/mailman/listinfo/scip" target="_blank" moz-do-not-send="true">https://listserv.zib.de/mailman/listinfo/scip</a>
</pre>
                    </blockquote>
                    <br>
                  </div>
                </blockquote>
              </div>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>