<div dir="ltr">Hi --<div><br></div><div>I did find some MILPs where I do get back multiple solutions using the following:</div><div><div>   CbcMain0(cbc);</div><div>   cbc.setMaximumSavedSolutions(100);</div><div>   CbcMain1(argc, argv, cbc);</div></div><div><br></div><div>The original one only returned 1, despite the log saying:</div><div><div>Cbc0012I Integer solution of -264.97 found by rounding after 1 iterations and 0 nodes (0.01 seconds)</div><div>Cbc0016I Integer solution of -282.4 found by strong branching after 11 iterations and 6 nodes (0.02 seconds)</div><div>Cbc0012I Integer solution of -282.4 found by feasibility pump after 0 iterations and 0 nodes (0.03 seconds)</div></div><div><br></div><div>So, I guess it is not storing everything that is mentioned in the log. Which is what had me confused. </div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 10:52 AM, Matthew Galati <span dir="ltr">&lt;<a href="mailto:matthew.galati@gmail.com" target="_blank">matthew.galati@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hmm.<div><br></div><div>That didn&#39;t seem to help.</div><div><br></div><div><span class=""><div>  const char * argv[20];</div><div>   int   argc      = 0;</div><div>   string cbcExe   = &quot;cbc&quot;;</div><div>   string cbcSolve = &quot;-solve&quot;;</div><div>   string cbcQuit  = &quot;-quit&quot;;</div><div>   string cbcLog   = &quot;-log&quot;;</div><div>   string cbcLogSet= UtilIntToStr(debugLevel);</div><div>   string cbcMaxSave= &quot;-maxSaved&quot;;<br></div><div>   string cbcMaxSaveSet= &quot;100&quot;;</div><div><br></div><div>   argv[argc++] = cbcExe.c_str();</div><div>   argv[argc++] = cbcLog.c_str();</div><div>   argv[argc++] = cbcLogSet.c_str();</div><div>   argv[argc++] = cbcMaxSave.c_str();</div><div>   argv[argc++] = cbcMaxSaveSet.c_str();</div><div>   argv[argc++] = cbcSolve.c_str();</div><div>   argv[argc++] = cbcQuit.c_str();</div><div>   CbcModel cbc(*osiClp);</div></span><div>   CbcMain0(cbc);</div><div>   CbcMain1(argc, argv, cbc);</div></div><div><br></div><div>Then, in the log I see:</div><div>Cbc0012I Integer solution of -264.97 found by rounding after 1 iterations and 0 nodes (0.01 seconds)<br></div><div>Cbc0016I Integer solution of -282.4 found by strong branching after 11 iterations and 6 nodes (0.02 seconds)<br></div><div>Cbc0012I Integer solution of -282.4 found by feasibility pump after 0 iterations and 0 nodes (0.03 </div><div>seconds)<br></div><div><br></div><div><br></div><div>But, in the end:</div><div><div> int nSolutions = cbc.numberSavedSolutions();</div><div> printf(&quot;nSolutions=%d\n&quot;, nSolutions);<br></div></div><div><br></div><div>nSolutions=1<br></div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 10:36 AM, Haroldo Gambini Santos <span dir="ltr">&lt;<a href="mailto:haroldo.santos@gmail.com" target="_blank">haroldo.santos@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Matthew,<br>
    <br>
    To call CbcMain I think that the recommended way is:<br>
    <br>
    CbcMain0(cbcModel);<br>
    CbcMain1( nArgs, args, cbcModel);<br>
    <br>
    Using this way I got multiple solutions at the end using<br>
    <br>
    cbcModel.numberSavedSolutions()  and contents  
    cbcModel.savedSolution(i);<div><div><br>
    <br>
    <br>
    <br>
    <div>On 13-02-2015 11:53, Matthew Galati
      wrote:<br>
    </div>
    </div></div><blockquote type="cite"><div><div>
      <div dir="ltr">I switched to CbcMain from
        CbcModel.branchAndBound() based on comments about performance.
        <div><br>
        </div>
        <div>I want to get multiple solutions from Cbc.</div>
        <div><br>
        </div>
        <div>I am doing this:</div>
        <div><br>
        </div>
        <div>
          <div>   const char * argv[20];</div>
          <div>   int   argc      = 0;</div>
          <div>   string cbcExe   = &quot;cbc&quot;;</div>
          <div>   string cbcSolve = &quot;-solve&quot;;</div>
          <div>   string cbcQuit  = &quot;-quit&quot;;</div>
          <div>   string cbcLog   = &quot;-log&quot;;</div>
          <div>   string cbcLogSet= UtilIntToStr(debugLevel);</div>
          <div>   string cbcMaxSave= &quot;-maxSaved&quot;;<br>
          </div>
          <div>   string cbcMaxSaveSet= &quot;100&quot;;</div>
          <div><br>
          </div>
          <div>   argv[argc++] = cbcExe.c_str();</div>
          <div>   argv[argc++] = cbcLog.c_str();</div>
          <div>   argv[argc++] = cbcLogSet.c_str();</div>
          <div>   argv[argc++] = cbcMaxSave.c_str();</div>
          <div>   argv[argc++] = cbcMaxSaveSet.c_str();</div>
          <div>   argv[argc++] = cbcSolve.c_str();</div>
          <div>   argv[argc++] = cbcQuit.c_str();</div>
          <div>   CbcModel cbc(*osiClp);</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>   CbcMain(argc, argv, cbc);</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>And from the log, I can tell there are multiple solutions.</div>
        <div><br>
        </div>
        <div>Then, I tried to get them with:</div>
        <div>int nSolutions = cbc.numberSavedSolutions();<br>
        </div>
        <div><br>
        </div>
        <div>But, it says there is only 1.</div>
        <div><br>
        </div>
        <div>When I was using cbc.branchAndBound(), this access method
          worked fine.</div>
        <div><br>
        </div>
        <div>How do I get the multiple solutions back when using
          CbcMain?</div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      </div></div></blockquote><span><font color="#888888"><pre cols="72"><br></pre>
  </font></span></div>

</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div>