Changeset 557


Ignore:
Timestamp:
May 10, 2005 11:40:19 AM (14 years ago)
Author:
rlh
Message:

updated the user guide

Location:
html/trunk/Cbc
Files:
9 added
22 edited

Legend:

Unmodified
Added
Removed
  • html/trunk/Cbc/apa.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Appendix A. FAQ</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="ch06.html" title="Chapter 6. 
    2   Messages
    3   "><link rel="next" href="apb.html" title="Appendix B. Doxygen"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. FAQ</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apb.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2912361"></a>Appendix A. FAQ</h2></div></div><div></div></div><div class="qandaset"><table border="0" summary="Q and A Set"><col align="left" width="1%"><tbody><tr class="question"><td align="left" valign="top"><a name="id2911725"></a><a name="id2912384"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix A. FAQ</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch09.html" title="Chapter 9. &#10;  Messages&#10;  "/><link rel="next" href="apb.html" title="Appendix B. Doxygen"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix A. FAQ</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch09.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apb.html">Next</a></td></tr></table><hr/></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id3253852"/>Appendix A. FAQ</h2></div></div><div/></div><div class="qandaset"><table border="0" summary="Q and A Set"><col align="left" width="1%"/><tbody><tr class="question"><td align="left" valign="top"><a id="id3253216"/><a id="id3253875"/><b>Q:. </b></td><td align="left" valign="top"><p>
    43  What is <a href="http://www.coin-or.org/faqs.html#CBC" target="_top">CBC</a>?
    54  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    6   (JF 04/01/05) The <a href="http://www.coin-or.org/" target="_top">COIN-OR</a> Branch and Cut code
     5  The <a href="http://www.coin-or.org/" target="_top">COIN-OR</a> Branch and Cut code
    76  is designed to be a high quality mixed integer code provided under the terms of the
    87  <a href="http://opensource.org/licenses/cpl.php" target="_top">Common Public License</a>.
    98  CBC is written in C++, and is primarily intended to be used as a callable
    109  library (though a rudimentary stand-alone executable exists).
    11   The first documented release was .90.0  The current release is version .90.0.
    12   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2912440"></a><a name="id2912443"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     10  The first documented release was .90.0  The current release is version .90.0. (JF 04/01/05)
     11  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3253930"/><a id="id3253933"/><b>Q:. </b></td><td align="left" valign="top"><p>
    1312  What are some of the features of CBC?
    1413  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    15   (JF 04/01/05) CBC allows the use of any Cgl cuts and the use of heuristics and
    16    specialized branching methods.
    17   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2913353"></a><a name="id2913356"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     14  CBC allows the use of any CGL cuts and the use of heuristics and
     15   specialized branching methods. (JF 04/01/05)
     16  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3254869"/><a id="id3254872"/><b>Q:. </b></td><td align="left" valign="top"><p>
    1817  How do I obtain and install CBC?
    1918  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    20   (JF 04/01/05) Please see the
     19  Please see the
    2120  <a href="http://www.coin-or.org/faqs.html" target="_top">COIN-OR FAQ</a>
    2221  for details on how to
     
    2423  and
    2524  <a href="http://www.coin-or.org/faqs.html#BuildCode" target="_top">install</a>
    26   COIN-OR modules.
    27   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2913402"></a><a name="id2913405"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     25  COIN-OR modules. (JF 04/01/05)
     26  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3254918"/><a id="id3254921"/><b>Q:. </b></td><td align="left" valign="top"><p>
    2827  Is CBC reliable?
    2928  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    30   (JF 04/01/05) CBC has been tested on many problems,
    31   but more testing and improvement is needed before it can get to version 1.0.
    32   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2913428"></a><a name="id2913431"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     29  CBC has been tested on many problems,
     30  but more testing and improvement is needed before it can get to version 1.0. (JF 04/01/05)
     31  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3254944"/><a id="id3254947"/><b>Q:. </b></td><td align="left" valign="top"><p>
    3332  Is there any documentation for CBC? 
    3433  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    35   (JF 04/01/05) If you can see this you have the best there is:-)
     34  If you can see this you have the best there is:-)
    3635  Also available is a list of
    3736  <a href="http://www.coin-or.org/Doxygen/Cbc/" target="_top">CBC class descriptions</a> generated
    38   by <a href="http://www.doxygen.org" target="_top">Doxygen</a>.
    39   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2913469"></a><a name="id2913472"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     37  by <a href="http://www.doxygen.org" target="_top">Doxygen</a>. (JF 04/01/05)
     38  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3254985"/><a id="id3254988"/><b>Q:. </b></td><td align="left" valign="top"><p>
    4039  Is CBC as fast as Cplex or Xpress?
    4140  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    42    (JF 04/01/05) No. However its design is much more flexible so advanced users
    43    will be able to tailor CBC to their needs.
    44   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2913495"></a><a name="id2913498"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     41   No. However its design is much more flexible so advanced users
     42   will be able to tailor CBC to their needs. (JF 04/01/05)
     43  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3255011"/><a id="id3255014"/><b>Q:. </b></td><td align="left" valign="top"><p>
    4544  When will version 1.0 of CBC be available? 
    4645  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    47   (JF 04/01/05) It is expected that version 1.0 will be released in time for the 2005
    48   <a href="http://www.informs.org" target="_top">INFORMS</a>
    49   </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2913529"></a><a name="id2913532"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     46  It is expected that version 1.0 will be released in time for the 2005
     47  <a href="http://www.informs.org" target="_top">INFORMS</a> annual meeting. (JF 04/01/05)
     48  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3255045"/><a id="id3255048"/><b>Q:. </b></td><td align="left" valign="top"><p>
    5049  What can the community do to help?
    5150  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    52   (JF 04/01/05) People from all around the world are already helping.  There are
    53   probably ten people who are do not always post to discussions but are constantly
     51  People from all around the world are already helping.  There are
     52  probably ten people who do not always post to the discussion mail list but are constantly
    5453  "improving" the code by demanding performance or bug fixes or enhancements.  And there
    55   are others posting questions to discussion groups.
    56   </p></td></tr></tbody></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apb.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 6. 
     54  are others posting questions to discussion groups. (JF 04/01/05)
     55  </p><p>
     56  A good start is to join the coin-discuss
     57  <a href="http://www.coin-or.org/mail.html" target="_top">mailing list</a> where CBC is discussed.  Some
     58  other possibilities include:
     59  </p><div class="itemizedlist"><ul type="disc"><li><p>
     60  Comment on the design
     61  </p></li><li><p>
     62  Give feedback on the documentation and FAQs.
     63  </p></li><li><p>
     64  Break the code, or better yet -- mend it.
     65  </p></li><li><p>
     66  Tackle any of the "to-dos" listed in the Doxyen documentation and contribute back to COIN-OR.
     67  </p></li></ul></div></td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch09.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apb.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 9. 
    5768  Messages
    5869   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix B. Doxygen</td></tr></table></div></body></html>
  • html/trunk/Cbc/apb.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Appendix B. Doxygen</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="apa.html" title="Appendix A. FAQ"><link rel="next" href="apc.html" title="Appendix C. Revision History"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. Doxygen</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apa.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apc.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="doxygen"></a>Appendix B. Doxygen</h2></div></div><div></div></div><p>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix B. Doxygen</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="apa.html" title="Appendix A. FAQ"/><link rel="next" href="apc.html" title="Appendix C. Revision History"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix B. Doxygen</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apa.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apc.html">Next</a></td></tr></table><hr/></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="doxygen"/>Appendix B. Doxygen</h2></div></div><div/></div><p>
    23There is Doxygen content for CBC available online at
    34<a href="http://www.coin-or.org/Doxygen/Cbc/index.html" target="_top">
     
    89<tt class="filename">COIN/Cbc/Doc/html</tt>.  The same can be done for
    910the COIN core, from the <tt class="filename">COIN/Coin</tt> directory.
    10 </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apa.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. FAQ </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix C. Revision History</td></tr></table></div></body></html>
     11</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apa.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix A. FAQ </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix C. Revision History</td></tr></table></div></body></html>
  • html/trunk/Cbc/apc.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Appendix C. Revision History</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="apb.html" title="Appendix B. Doxygen"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. Revision History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id2913266"></a>Appendix C. Revision History</h2></div></div><div></div></div><div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.1</td><td align="left">April 1 2005</td><td align="left">JF</td></tr><tr><td align="left" colspan="3">First draft</td></tr></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Doxygen </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Appendix C. Revision History</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="apb.html" title="Appendix B. Doxygen"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix C. Revision History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr/></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id3253602"/>Appendix C. Revision History</h2></div></div><div/></div><div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.21</td><td align="left">May 10, 2005</td><td align="left">RLH</td></tr><tr><td align="left" colspan="3">Fixed typos caught by Cole Smith, editor of the INFORMS Tutorial Book, and added place holders for needs-to-be-written sections, e.g., Using CGL with CBC.</td></tr><tr><td align="left">Revision 0.2</td><td align="left">May 2, 2005</td><td align="left">RLH</td></tr><tr><td align="left" colspan="3">Book chapter for CBC Tutorial at INFORMS 2005 annual meeting. Reorganized the content. Added CBC Messages. Changed the font type to distinguish functions/variables/classnames/code from text.</td></tr><tr><td align="left">Revision 0.1</td><td align="left">April 1, 2005</td><td align="left">JF</td></tr><tr><td align="left" colspan="3">First draft. The CBC documentation uses the DocBook CLP documentation created by David de la Nuez.</td></tr></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apb.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Appendix B. Doxygen </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>
  • html/trunk/Cbc/cbcuserguide.html

    r555 r557  
    2727</div></div></div><div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="#intro">
    2828    Introduction
    29   </a></dt><dd><dl><dt><a href="#id2887266">
     29  </a></dt><dd><dl><dt><a href="#id2968004">
    3030  Welcome to CBC
    31   </a></dt><dt><a href="#id2887095">
     31  </a></dt><dt><a href="#id2967833">
    3232  Prerequisites
    33   </a></dt><dt><a href="#id2886977">
     33  </a></dt><dt><a href="#id2967708">Preliminaries</a></dt><dt><a href="#id3038724">
    3434Branch-and-Cut Overview
    3535</a></dt></dl></dd><dt>2. <a href="#cbcmodelclass">
     
    5353  </a></dt><dd><dl><dt><a href="#heuristics">CbcHeuristic - Heuristic Methods</a></dt></dl></dd><dt>5. <a href="#branchChapter">
    5454  Branching
    55  </a></dt><dd><dl><dt><a href="#branching">Pseudo Cost Branching</a></dt><dt><a href="#followOn">Follow-On Branching</a></dt></dl></dd><dt>6. <a href="#SolverChap">
    56   Advance Solver Uses
    57 </a></dt><dd><dl><dt><a href="#solver">Creating a Solver via Inheritance</a></dt><dt><a href="#quadratic">Quadratic MIP</a></dt></dl></dd><dt>7. <a href="#moreexamples">
     55 </a></dt><dd><dl><dt><a href="#branchingIntro">Branching Overview</a></dt><dt><a href="#branching">Pseudo Cost Branching</a></dt><dt><a href="#followOn">Follow-On Branching</a></dt></dl></dd><dt>6. <a href="#CutsChap">Cutting planes</a></dt><dd><dl><dt><a href="#cuts">Using Cut Generators with CBC</a></dt></dl></dd><dt>7. <a href="#SolverChap">
     56  Advanced Solver Uses
     57</a></dt><dd><dl><dt><a href="#solver">Creating a Solver via Inheritance</a></dt><dt><a href="#quadratic">Quadratic MIP</a></dt></dl></dd><dt>8. <a href="#moreexamples">
    5858More Samples
    59 </a></dt><dd><dl><dt><a href="#id2968762">CBC's Samples Directory</a></dt></dl></dd><dt>8. <a href="#messages">
     59</a></dt><dd><dl><dt><a href="#id3049424">CBC's Samples Directory</a></dt></dl></dd><dt>9. <a href="#messages">
    6060  Messages
    61   </a></dt><dt>A. <a href="#id2974565">FAQ</a></dt><dt>B. <a href="#doxygen">Doxygen</a></dt><dt>C. <a href="#id2974315">Revision History</a></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="#assClasses">Associated Classes</a></dt><dt>2.1. <a href="#id2959780">
     61  </a></dt><dt>A. <a href="#id3055917">FAQ</a></dt><dt>B. <a href="#doxygen">Doxygen</a></dt><dt>C. <a href="#id3055667">Revision History</a></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="#assClasses">Associated Classes</a></dt><dt>2.1. <a href="#id3040696">
    6262  Methods for Getting Solution Information from OSI
    63   </a></dt><dt>2.2. <a href="#setGet">Useful Set and Get Methods in CbcModel</a></dt><dt>2.3. <a href="#id2961253">Classes Used by CbcModel - Most Useful</a></dt><dt>2.4. <a href="#least">Classes Used by CbcModel - Least Useful</a></dt><dt>3.1. <a href="#compareTable">Compare Classes Provided</a></dt><dt>3.2. <a href="#nodeTable">Information Available from CbcNode</a></dt><dt>7.1. <a href="#id2969026">Basic Samples</a></dt><dt>7.2. <a href="#id2969203">Advanced Samples</a></dt><dt>8.1. <a href="#id2970505">
    64   CBC Messages Passed At Logging Level 0
    65   </a></dt><dt>8.2. <a href="#id2970650">
    66   CBC Messages Passed At or Above Logging Level 1
    67   </a></dt><dt>8.3. <a href="#id2972014">
    68   CBC Messages Passed At or Above Logging Level 2
    69   </a></dt><dt>8.4. <a href="#id2972415">
    70   CBC Messages Passed At or Above Logging Level 3
    71   </a></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="#minimum.cpp">minimum.cpp</a></dt><dt>3.1. <a href="#test">CbcCompareUser::test()</a></dt><dt>3.2. <a href="#newSolution">CbcCompareUser::newSolution()</a></dt><dt>3.3. <a href="#everyK">CbcCompareUser::every1000Nodes()</a></dt><dt>4.1. <a href="#id2966006">Data</a></dt><dt>4.2. <a href="#id2966036">Initialize newSolution</a></dt><dt>4.3. <a href="#id2966116">Create Feasible newSolution from Initial newSolution</a></dt><dt>4.4. <a href="#id2966155">Check Solution Quality of newSolution</a></dt><dt>5.1. <a href="#pseudo">CbcSimpleIntegerPseudoCosts</a></dt><dt>5.2. <a href="#id2966435">CbcFollowOn</a></dt><dt>6.1. <a href="#initialSolve">initialSolve()</a></dt><dt>6.2. <a href="#id2966664">First Few Solves</a></dt><dt>6.3. <a href="#id2966692">Create Small Problem</a></dt><dt>6.4. <a href="#id2966737">Check Optimal Solution</a></dt><dt>6.5. <a href="#id2966802">Solving a Quadratic MIP</a></dt></dl></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="intro"></a>Chapter 1. 
     63  </a></dt><dt>2.2. <a href="#setGet">Useful Set and Get Methods in CbcModel</a></dt><dt>2.3. <a href="#id3042180">Classes Used by CbcModel - Most Useful</a></dt><dt>2.4. <a href="#least">Classes Used by CbcModel - Least Useful</a></dt><dt>3.1. <a href="#compareTable">Compare Classes Provided</a></dt><dt>3.2. <a href="#nodeTable">Information Available from CbcNode</a></dt><dt>8.1. <a href="#id3050381">Basic Samples</a></dt><dt>8.2. <a href="#id3050556">Advanced Samples</a></dt><dt>9.1. <a href="#id3051858">
     64  CBC Messages Passed At Log Level 0
     65  </a></dt><dt>9.2. <a href="#id3052003">
     66  CBC Messages Passed At or Above Log Level 1
     67  </a></dt><dt>9.3. <a href="#id3053367">
     68  CBC Messages Passed At or Above Log Level 2
     69  </a></dt><dt>9.4. <a href="#id3053768">
     70  CBC Messages Passed At or Above Log Level 3
     71  </a></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="#minimum.cpp">minimum.cpp</a></dt><dt>3.1. <a href="#test">CbcCompareUser::test()</a></dt><dt>3.2. <a href="#newSolution">CbcCompareUser::newSolution()</a></dt><dt>3.3. <a href="#everyK">CbcCompareUser::every1000Nodes()</a></dt><dt>4.1. <a href="#id3047001">Data</a></dt><dt>4.2. <a href="#id3047030">Initialize newSolution</a></dt><dt>4.3. <a href="#id3047111">Create Feasible newSolution from Initial newSolution</a></dt><dt>4.4. <a href="#id3047155">Check Solution Quality of newSolution</a></dt><dt>5.1. <a href="#pseudo">CbcSimpleIntegerPseudoCosts</a></dt><dt>5.2. <a href="#id3047524">CbcFollowOn</a></dt><dt>7.1. <a href="#initialSolve">initialSolve()</a></dt><dt>7.2. <a href="#id3047792">First Few Solves</a></dt><dt>7.3. <a href="#id3047820">Create Small Sub-Problem</a></dt><dt>7.4. <a href="#id3047866">Check Optimal Solution</a></dt><dt>7.5. <a href="#id3047932">Solving a Quadratic MIP</a></dt></dl></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="intro"></a>Chapter 1. 
    7272    Introduction
    73   </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2887266">
     73  </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2968004">
    7474  Welcome to CBC
    75   </a></dt><dt><a href="#id2887095">
     75  </a></dt><dt><a href="#id2967833">
    7676  Prerequisites
    77   </a></dt><dt><a href="#id2886977">
     77  </a></dt><dt><a href="#id2967708">Preliminaries</a></dt><dt><a href="#id3038724">
    7878Branch-and-Cut Overview
    79 </a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2887266"></a>
     79</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2968004"></a>
    8080  Welcome to CBC
    8181  </h2></div></div><div></div></div><p>
    8282  The COIN
    83     <sup>[<a id="id2887276" href="#ftn.id2887276">1</a>]</sup>
     83    <sup>[<a id="id2968015" href="#ftn.id2968015">1</a>]</sup>
    8484Branch and Cut solver (CBC) is an open-source mixed-integer program (MIP) solver written  in C++. CBC is intended to be used primarily as a callable library to create customized branch-and-cut solvers. A basic, stand-alone  executable version is also available. CBC is an active open-source project led by John Forrest at www.coin-or.org.
    85  </p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2887095"></a>
     85 </p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2967833"></a>
    8686  Prerequisites
    8787  </h2></div></div><div></div></div><p>
     
    9090  object-oriented programming terminology, and familiarity with the fundamental concepts of
    9191  <a href="http://carbon.cudenver.edu/~hgreenbe/courseware/LPshort/intro.html" target="_top">
    92   linear programming</a> and
     92  linear programming</a> (LP) and
    9393  <a href="http://carbon.cudenver.edu/~hgreenbe/courseware/MIP/intro.html" target="_top">
    94   mixed integer programming</a>.
     94  mixed integer programming</a> (MIP).
    9595  </p><p>
    9696
    97 CBC relies other parts of the COIN repository. CBC needs an LP solver and relies the COIN Open Solver Inteface (OSI) to communicate with the user's choice of solver. Any LP solver with an OSI interface can be used with CBC. The LP solver expected to be used most commonly is COIN's native linear program solver, CLP. For cut generators, CBC relies on the COIN Cut Generation Library (CGL). Any cut generator written to CGL standards can be used with CBC. Some of the cut generators in CGL rely on other parts of COIN, e.g., CGL's Gomory cut generator rely on the factorization functionality of <tt class="classname">CoinFactorization</tt>. This document assumes basic familiarity with OSI and CGL.
     97CBC relies on other parts of the COIN repository. CBC needs a LP solver and relies on the COIN Open Solver Inteface (OSI) to communicate with the user's choice of solver. Any LP solver with an OSI interface can be used with CBC. The LP solver expected to be used most commonly is COIN's native linear program solver, CLP. For cut generators, CBC relies on the COIN Cut Generation Library (CGL). Any cut generator written to CGL standards can be used with CBC. Some of the cut generators in CGL rely on other parts of COIN, e.g., CGL's Gomory cut generator rely on the factorization functionality of <tt class="classname">CoinFactorization</tt>. This document assumes basic familiarity with OSI and CGL.
    9898</p><p>
    99 Technically speaking, CBC assesses the solver (and sometime the model and data it contains) through an <tt class="classname">OSISolverInterface</tt>. For the sake of simplicity, we will refer to the <tt class="classname">OsiSolverInterface</tt> as "the solver" in this document, rather than "the standard application programming interface to the solver." We hope any confusion caused by blurring this distinction will be mitigated by the shorter sentences. 
     99Technically speaking, CBC accesses the solver (and sometime the model and data it contains) through an <tt class="classname">OSISolverInterface</tt>. For the sake of simplicity, we will refer to the <tt class="classname">OsiSolverInterface</tt> as "the solver" in this document, rather than "the standard application programming interface to the solver." We hope any confusion caused by blurring this distinction will be mitigated by the shorter sentences. 
    100100 
    101  </p><p>
     101</p><p>
    102102In summary, readers should have the following prerequisites:
    103    </p><div class="itemizedlist"><ul type="disc"><li>
    104     C++ knowledge,
    105     </li><li>
    106     LP and MIP fundamentals, and   
    107     </li><li>
    108     OSI familiarity.
    109     </li></ul></div><p>
    110 </p><p>
    111 Unless otherwise stated, we will assume the problem being optimized is a minimization problem. The terms "model" and "problem" are used synonymously.
    112 </p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2886977"></a>
     103   </p><div class="itemizedlist"><ul type="disc"><li>C++ knowledge,</li><li>LP and MIP fundamentals, and </li><li>OSI familiarity.</li></ul></div><p>
     104</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2967708"></a>Preliminaries</h2></div></div><div></div></div><p>
     105  </p><div class="itemizedlist"><ul type="disc"><li>Unless otherwise stated, the problem being optimized is a minimization problem. </li><li>The terms "model" and "problem" are used synonymously.</li><li>Notation: We use the convention of appending an underscore to
     106              a variable in order to distinguish member data of a class.</li><li>The Cbc Samples directory, <tt class="filename">COIN/Cbc/Samples</tt>
     107              contains the source code for the examples in the Guide.</li><li>The sample code in the Guide is written for illustrative
     108              purposes of the CBC concepts and usage. The sample code is not
     109              necessarily written for performance.</li></ul></div><p>
     110</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3038724"></a>
    113111Branch-and-Cut Overview
    114112</h2></div></div><div></div></div><p>
     
    117115Step 1. (Bound) Given a MIP model to minimize where some variables must take on integer values (e.g., 0, 1, or 2), relax the integrality requirements (e.g., consider each "integer" variable to be continuous with a lower bound of 0.0 and an upper bound of 2.0). Solve the resulting linear model with an LP solver to obtain a lower bound on the MIP's objective function value.  If the optimal LP solution has integer values for the MIP's integer variables, we are finished. Any MIP-feasible solution provides an upper bound on the objective value. The upper bound equals the lower bound; the solution is optimal.   
    118116 </p><p> 
    119 Step 2. (Branch) Otherwise, there exists an "integer" variable with a non-integral value. Choose one non-integral variable (e.g., with value 1.3) (A)(B) and branch. Create two nodes, one with the branching variable having an upper bound of 1.0, and the other with the branching variable having a lower bound of 2.0. Add the two nodes to the search tree.
     117Step 2. (Branch) Otherwise, there exists an "integer" variable with a non-integral value. Choose one non-integral variable (e.g., with value 1.3) (A)(B) and branch. Create two
     118<sup>[<a id="id3038892" href="#ftn.id3038892">2</a>]</sup>
     119nodes, one with the branching variable having an upper bound of 1.0, and the other with the branching variable having a lower bound of 2.0. Add the two nodes to the search tree.
    120120 </p><p>
    121121While (search tree is not empty) {
     
    137137}
    138138 </p><p>     
    139 This is the outline of a "branch-and-bound" algorithm. If in optimizing the linear programs, we use cuts to tighten the LP relaxations (E)(F), then we have a "branch-and-cut" algorithm. (Note, if cuts are only used in Step 1, the method is called a "cut-and-branch" algorithm.)
    140  
     139This is the outline of a "branch-and-bound" algorithm. If in optimizing the linear programs, we use cuts to tighten the LP relaxations (E)(F), then we have a "branch-and-cut" algorithm. (Note, if cuts are only used in Step 1, the method is called a "cut-and-branch" algorithm.)
    141140 
    142141  </p><div class="table"><a id="assClasses"></a><p class="title"><b>Table 1.1. Associated Classes</b></p><table summary="Associated Classes" border="0"><colgroup><col /><col /><col /></colgroup><thead><tr><th>
     
    162161      </td><td align="left" valign="top"><tt class="classname">CbcTree</tt></td><td align="left" valign="top">
    163162      All unsolved models can be thought of as being nodes on a tree where each
    164       node (model) can branch two or more times.  The user should not need to be
    165       concerned with this class.
     163      node (model) can branch two or more times. The interface with this class is helpful to know, but
     164the user can pretty safely ignore the inner workings of this class.
    166165      </td></tr><tr><td align="left" valign="top">
    167166      (D)
     
    190189  behavior of the source code, the comments in the header files, found in
    191190  <tt class="filename">COIN/Cbc/include</tt>, are the ultimate reference.
    192   </p></div><div class="footnotes"><br /><hr width="100" align="left" /><div class="footnote"><p><sup>[<a id="ftn.id2887276" href="#id2887276">1</a>] </sup>
     191  </p></div><div class="footnotes"><br /><hr width="100" align="left" /><div class="footnote"><p><sup>[<a id="ftn.id2968015" href="#id2968015">1</a>] </sup>
    193192        The complete acronym is "COIN-OR" which stands for the Compuational Infrastructure for Operations Research. For simplicity (and in keeping with the directory and function names) we will simply use "COIN".
    194         </p></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="cbcmodelclass"></a>Chapter 2. 
     193        </p></div><div class="footnote"><p><sup>[<a id="ftn.id3038892" href="#id3038892">2</a>] </sup>
     194The current implementation of CBC allow two branches to be created. More general number of branches could be implemented.
     195</p></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="cbcmodelclass"></a>Chapter 2. 
    195196   The CBC Model Class
    196197  </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#hierarchy">
     
    251252  int numberColumns = model.solver()-&gt;getNumCols();
    252253   
    253   const double * solution = model.solver()-&gt;getColSolution();
     254  const double * solution = model.bestSolution();
    254255   
    255256  for (int iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     
    267268</h2></div></div><div></div></div><p>
    268269The program in <a href="#minimum.cpp" title="Example 2.1. minimum.cpp">Example 2.1</a> illustrates the dependency of CBC on 
    269   the <tt class="classname">OsiSolverInterface</tt> class. The constructor of <tt class="classname">CbcModel</tt> takes a pointer to an <tt class="classname">OsiSolverInterface</tt> (i.e., a solver). The <tt class="classname">CbcModel</tt> clones the solver, and uses its own instance of the solver. The <tt class="classname">CbcModel</tt>'s solver and the original solver (e.g., <tt class="varname">solver1</tt>) are not in sync unless the user synchronizes them. The user can always access the <tt class="classname">CbcModel</tt>'s solver through the <tt class="function">model()</tt> method.  To synchronize the two solvers, explicitly refreshing the original, e.g., 
     270  the <tt class="classname">OsiSolverInterface</tt> class. The constructor of <tt class="classname">CbcModel</tt> takes a pointer to an <tt class="classname">OsiSolverInterface</tt> (i.e., a solver). The <tt class="classname">CbcModel</tt> clones the solver, and uses its own instance of the solver. The <tt class="classname">CbcModel</tt>'s solver and the original solver (e.g., <tt class="varname">solver1</tt>) are not in sync unless the user synchronizes them. The user can always access the <tt class="classname">CbcModel</tt>'s solver through the <tt class="function">model()</tt> class.  To synchronize the two solvers, explicitly refreshing the original, e.g., 
    270271 </p><pre class="programlisting">
    271272  solver1 = model.solver();
    272273</pre><p>
    273 <tt class="classname">CbcModel</tt>'s method <tt class="function">solve()</tt> returns a pointer to CBC's cloned solver.
     274<tt class="classname">CbcModel</tt>'s method <tt class="function">solver()</tt> returns a pointer to CBC's cloned solver.
    274275</p><p>
    275 For convenience, many of the OSI methods to access problem data have identical method names in  <tt class="classname">CbcModel</tt>. (It's just more convenient to type <tt class="function">model.getNumCols()</tt> rather than <tt class="function">model.solver()-&gt;getNumCols()</tt>). The <tt class="classname">CbcModel</tt> refreshes its solver at certain logical points during the algorithm. At these points, the information from the <tt class="classname">CbcModel</tt> <tt class="varname">model</tt> will match the information from the <tt class="function">model.solver()</tt>. Elsewhere, the information may vary. For instance, the OSI method <tt class="function">getColSolution()</tt> will contain the best solution so far, while the <tt class="classname">CbcModel</tt> method may not. In this case, it is safer to use <tt class="function">CbcModel::bestSolution()</tt>.
     276For convenience, many of the OSI methods to access problem data have identical method names in  <tt class="classname">CbcModel</tt>. (It's just more convenient to type <tt class="function">model.getNumCols()</tt> rather than <tt class="function">model.solver()-&gt;getNumCols()</tt>). The <tt class="classname">CbcModel</tt> refreshes its solver at certain logical points during the algorithm. At these points, the information from the <tt class="classname">CbcModel</tt> <tt class="varname">model</tt> will match the information from the <tt class="function">model.solver()</tt>. Elsewhere, the information may vary. For instance, the method <tt class="function">CbcModel::bestSolution()</tt> will contain the best solution so far, the OSI method <tt class="function">getColSolution()</tt> may not. In this case, it is safer to use <tt class="function">CbcModel::bestSolution()</tt>.
    276277</p><p>
    277278While all the OSI methods used in <tt class="filename">minimum.cpp</tt> have equivalent methods in <tt class="classname">CbcModel</tt>, there are some OSI methods which do not. For example, if  the program produced a lot of undesired output, one might add the line
     
    292293  </p><p>
    293294  In addition to these <tt class="classname">CbcModel</tt> methods, solution values can be accessed via OSI methods.  The OSI methods pick up the current solution in the <tt class="classname">CBCModel</tt>.  The current solution will match the best solution found so far if called after <tt class="function">branchAndBound()</tt> and a solution was found.
    294   </p><div class="table"><a id="id2959780"></a><p class="title"><b>Table 2.1. 
     295  </p><div class="table"><a id="id3040696"></a><p class="title"><b>Table 2.1. 
    295296  Methods for Getting Solution Information from OSI
    296297  </b></p><table summary="&#10;  Methods for Getting Solution Information from OSI &#10;  " border="0"><colgroup><col /><col /></colgroup><thead><tr><th>
     
    338339      </td></tr><tr><td align="left" valign="top"><tt class="function">bool setAllowableGap(double value)</tt><br /><tt class="function">double getAllowableGap() const</tt><br /><tt class="function">bool setAllowablePercentageGap(double value)</tt><br /><tt class="function">double getAllowablePercentageGap() const</tt><br /><tt class="function">bool setAllowableFractionGap(double value)</tt><br /><tt class="function">double getAllowableFractionGap() const</tt><br /></td><td align="left" valign="top"><tt class="classname">CbcModel</tt> returns if the gap between the best known solution and the best
    339340      possible solution is less than this <i class="parameter"><tt>value</tt></i>, or as a percentage, or a fraction.
    340       </td></tr><tr><td align="left" valign="top"><tt class="function">void setNumberStrong(double value) </tt><br /><tt class="function">int numberStrong() const </tt></td><td align="left" valign="top">
     341      </td></tr><tr><td align="left" valign="top"><tt class="function">void setNumberStrong(double value) </tt><br /><tt class="function">int numberStrong()
     342<sup>[<a id="id3041432" href="#ftn.id3041432">a</a>]</sup> const </tt></td><td align="left" valign="top">
    341343      These methods set or get the maximum number of candidates at a node to
    342344      be evaluated for strong branching.
     
    347349      Returns number of nodes evaluated in the search.
    348350      </td></tr><tr><td align="left" valign="top"><tt class="function">int numberRowsAtContinuous() const</tt></td><td align="left" valign="top">
    349       Returns number of rows at continuous </td></tr><tr><td align="left" valign="top"><tt class="function">int  numberIntegers() const</tt><br /><tt class="function">const int * integerVariable() const</tt></td><td align="left" valign="top">
     351      Returns number of rows in the problem when handed to the solver (i.e., before cuts where added). Commonly used in implementing heuristics.
     352      </td></tr><tr><td align="left" valign="top"><tt class="function">int  numberIntegers() const</tt><br /><tt class="function">const int * integerVariable() const</tt></td><td align="left" valign="top">
    350353      Returns number of integer variables and an array specifying them.
    351354      </td></tr><tr><td align="left" valign="top"><tt class="function">bool isBinary(int colIndex) const</tt><br /><tt class="function">bool isContinuous(int colIndex) const</tt><br /><tt class="function">bool isInteger(int colIndex) const</tt></td><td align="left" valign="top">
     
    360363      </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getRowLower() const</tt><br /><tt class="function">const double * getRowUpper() const</tt><br /><tt class="function">const double * getColLower() const</tt><br /><tt class="function">const double * getColUpper() const</tt><br /></td><td align="left" valign="top">
    361364      These methods return the lower and upper bounds on row and column activities.
    362       </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackMatrix * getMatrixByRow() const</tt></td><td align="left" valign="top">
     365      </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackedMatrix * getMatrixByRow() const</tt></td><td align="left" valign="top">
    363366      This method returns a pointer to a row copy of matrix stored as a
    364367      <tt class="classname">CoinPackedMatrix</tt> which can be further examined.
    365       </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackMatrix * getMatrixByCol() const</tt></td><td align="left" valign="top">
     368      </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackedMatrix * getMatrixByCol() const</tt></td><td align="left" valign="top">
    366369      This method returns a pointer to a column copy of matrix stored as a
    367370      <tt class="classname">CoinPackedMatrix</tt> which can be further examined.
    368       </td></tr><tr><td align="left" valign="top"><tt class="function">CoinBigIndex getNumElements() const</tt><sup>[<a id="id2961056" href="#ftn.id2961056">a</a>]</sup></td><td align="left" valign="top">
     371      </td></tr><tr><td align="left" valign="top"><tt class="function">CoinBigIndex getNumElements() const</tt><sup>[<a id="id3041985" href="#ftn.id3041985">b</a>]</sup></td><td align="left" valign="top">
    369372      Returns the number of nonzero elements in the problem matrix.
    370373      </td></tr><tr><td align="left" valign="top"><tt class="function">void setObjSense(double value)</tt><br /><tt class="function">double getObjSense() const</tt></td><td align="left" valign="top">
    371374      These methods set and get the objective sense.  The parameter
    372375      <i class="parameter"><tt>value</tt></i> should be +1 to minimize and -1 to maximize.
    373       </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a id="ftn.id2961056" href="#id2961056">a</a>] </sup>
     376      </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a id="ftn.id3041432" href="#id3041432">a</a>] </sup>
     377This methods (and some of the other) do not follow the "get" convention. The convention has changed over time and there are still some inconsistencies to be cleaned up.
     378</p></div><div class="footnote"><p><sup>[<a id="ftn.id3041985" href="#id3041985">b</a>] </sup>
    374379        <span class="type">CoinBigIndex</span> is a <tt class="function">typedef</tt> which in
    375380        most cases is the same as <span class="type">int</span>.
     
    392397
    393398To enable this flexibility,  <tt class="classname">CbcModel</tt> uses other classes in CBC (some of which are virtual and may have multiple instances). Not all classes are created equal. The two tables below list in alphabetical order the classes used by <tt class="classname">CbcModel</tt> that are of most interest and of least interest.
    394 </p><div class="table"><a id="id2961253"></a><p class="title"><b>Table 2.3. Classes Used by CbcModel - Most Useful</b></p><table summary="Classes Used by CbcModel - Most Useful" border="0"><colgroup><col /><col /><col /></colgroup><thead><tr><th>
     399</p><div class="table"><a id="id3042180"></a><p class="title"><b>Table 2.3. Classes Used by CbcModel - Most Useful</b></p><table summary="Classes Used by CbcModel - Most Useful" border="0"><colgroup><col /><col /><col /></colgroup><thead><tr><th>
    395400    Class name
    396401    </th><th>
     
    411416      Defines what it means for a variable to be satisfied. Used in branching.
    412417      </td><td align="left" valign="top">
    413       Virtual class. CBC's concept of branching is based on the idea of an "object". An object has (i) a feasible region, (ii) can be evaluated for infeasibility, (iii) can be branched on, e.g., a method of generating a branching object, which defines an up branch and a down branch, and (iv) allows comparsion of the effect of branching. Instances of objects include <tt class="classname">CbcSimpleInteger</tt>, <tt class="classname">CbcSimpleIntegerPseudoCosts</tt>, <tt class="classname">CbcClique</tt>, <tt class="classname">CbcSOS</tt> (type 1 and 2), <tt class="classname">CbcFollowOn</tt>, and <tt class="classname">CbcLotsize</tt>.
     418      Virtual class. CBC's concept of branching is based on the idea of an "object". An object has (i) a feasible region, (ii) can be evaluated for infeasibility, (iii) can be branched on, e.g., a method of generating a branching object, which defines an up branch and a down branch, and (iv) allows comparison of the effect of branching. Instances of objects include <tt class="classname">CbcSimpleInteger</tt>, <tt class="classname">CbcSimpleIntegerPseudoCosts</tt>, <tt class="classname">CbcClique</tt>, <tt class="classname">CbcSOS</tt> (type 1 and 2), <tt class="classname">CbcFollowOn</tt>, and <tt class="classname">CbcLotsize</tt>.
    414419      </td></tr><tr><td align="left" valign="top"><tt class="classname">OsiSolverInterface</tt></td><td align="left" valign="top">
    415420      Defines the LP solver being used and the LP model. Normally
     
    452457  Selecting the Next Node in the Search Tree
    453458  </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#comparison">CbcCompare - Comparison Methods</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="comparison"></a>CbcCompare - Comparison Methods</h2></div></div><div></div></div><p>
    454   The order in which the nodes of the search tree are explored can strongly influence the performance of branch-and-cut algorithms. CBC give users complete control over the search order. The search order is controlled via the <tt class="classname">CbcCompare...</tt> class. CBC provides an abstract base class, <tt class="classname">CbcCompareBase</tt>,  and several commonly used instances which are described in <a href="#compareTable" title="Table 3.1. Compare Classes Provided">Table 3.1</a>.
     459  The order in which the nodes of the search tree are explored can strongly influence the performance of branch-and-cut algorithms. CBC give users complete control over the search order, including the ability to dynamically change the node selection logic as the search progresses. The search order is controlled via the <tt class="classname">CbcCompare...</tt> class, and its method <tt class="function">test()</tt>. Dynamic changes can be made whenever
     460</p><div class="itemizedlist"><ul type="disc"><li>a new solution is found -- by customizing the method <tt class="function">newSolution()</tt>, or </li><li>every 1000 nodes -- by customizing the method <tt class="function">every1000Nodes()</tt>. </li></ul></div><p>
     461CBC provides an abstract base class, <tt class="classname">CbcCompareBase</tt>, and implementations of several commonly used node selection strategies as Compare Classes, see <a href="#compareTable" title="Table 3.1. Compare Classes Provided">Table 3.1</a>.
    455462  </p><div class="table"><a id="compareTable"></a><p class="title"><b>Table 3.1. Compare Classes Provided</b></p><table summary="Compare Classes Provided" border="0"><colgroup><col /><col /></colgroup><thead><tr><th>
    456463    Class name
     
    469476      been found. It then use estimates that are designed to give a slightly better solution.
    470477      If a reasonable number of nodes have been explored (or a reasonable number of
    471       solutions found), then this class will adopt a breadth-first search (i.e., making a comparison based strictly on objective function values) unless the tree is very large when it will revert to depth-first search. A better description of <tt class="classname">CbcCompareUser</tt> is given below.
     478      solutions found), then this class will adopt a breadth-first search (i.e., making a comparison based strictly on objective function values) unless the tree is very large, in which case it will revert to depth-first search. A better description of <tt class="classname">CbcCompareUser</tt> is given below.
    472479      </td></tr><tr><td align="left" valign="top"><tt class="classname">CbcCompareEstimate</tt></td><td align="left" valign="top">
    473       When pseudo costs are invoked, they can be used to guess a solution.  This class uses the guessed solution.
     480      When pseudo costs are invoked, CBC uses the psuedo costs to guess a solution.  This class uses the guessed solution.
    474481      </td></tr></tbody></table></div><p>
    475   It is relatively simple for an experienced user to create new compare class instances. The code in <a href="#test" title="Example 3.1. CbcCompareUser::test()">Example 3.1</a> describes how to build a new comparison class and the reasoning behind it. The complete source can be found in <tt class="filename">CbcCompareUser.hpp</tt> and <tt class="filename">CbcCompareUser.cpp</tt>, located in the CBC Samples directory. See <a href="#moreexamples" title="Chapter 7. &#10;More Samples&#10;">Chapter 7, <i>
    476 More Samples
    477 </i></a>. The key method in <tt class="classname">CbcCompare</tt> is <tt class="function">bool test(CbcNode* x, CbcNode* y))</tt> which returns <i class="parameter"><tt>true</tt></i> if node <i class="parameter"><tt>y</tt></i> is preferred over node <i class="parameter"><tt>x</tt></i>. In the <tt class="function">test()</tt> method, information from <tt class="classname">CbcNode</tt> can easily be used. <a href="#nodeTable" title="Table 3.2. Information Available from CbcNode">Table 3.2</a> list some commonly used methods to access information at a node.
     482  It is relatively simple for a user to create a customized node selection by creating a new compare class instances. The code in <a href="#test" title="Example 3.1. CbcCompareUser::test()">Example 3.1</a> describes how to build a new comparison class and the reasoning behind it. The complete source can be found in <tt class="filename">CbcCompareUser.hpp</tt> and <tt class="filename">CbcCompareUser.cpp</tt>, located in the CBC Samples directory. Besides the constructor, the only method the user -must- implement in <tt class="classname">CbcCompare</tt> is <tt class="function">bool test(CbcNode* x, CbcNode* y))</tt> which returns <i class="parameter"><tt>true</tt></i> if node <i class="parameter"><tt>y</tt></i> is preferred over node <i class="parameter"><tt>x</tt></i>. In the <tt class="function">test()</tt> method, information from <tt class="classname">CbcNode</tt> can easily be used. <a href="#nodeTable" title="Table 3.2. Information Available from CbcNode">Table 3.2</a> lists some commonly used methods to access information at a node.
    478483  </p><div class="table"><a id="nodeTable"></a><p class="title"><b>Table 3.2. Information Available from <tt class="classname">CbcNode</tt></b></p><table summary="Information Available from CbcNode" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td align="left" valign="top"><tt class="function">double objectiveValue() const</tt></td><td align="left" valign="top">
    479484      Value of objective at the node.
     
    495500  <tt class="function">newSolution()</tt> is called whenever a solution is found and the method <tt class="function">every1000Nodes()</tt> is called every 1000 nodes.  When these methods are called, the user has the opportunity to modify the
    496501  behavior of <tt class="function">test()</tt> by adjusting their common variables (e.g., <tt class="varname">weight_</tt>). Because <tt class="classname">CbcNode</tt> has a pointer to the model, the user can also influence the search through actions such as changing the maximum time CBC is allowed, once a solution has been found (e.g., <tt class="function">CbcModel::setMaximumSeconds(double value)</tt>). In <tt class="filename">CbcCompareUser.cpp</tt> of the <tt class="filename">COIN/Cbc/Samples</tt> directory,  four items of data are used.
     502</p><p>
    497503</p><div class="itemizedlist"><ul type="disc"><li><p>
    4985041) The number of solutions found so far
     
    5045104) A saved value of weight, <tt class="varname">saveWeight_</tt> (for when weight is set back to -1.0 for special reason)
    505511  </p></li></ul></div><p>
    506 The full code for the <tt class="function">CbcCompareUser::test()</tt> method is given in <a href="#test" title="Example 3.1. CbcCompareUser::test()">Example 3.1</a>.
     512</p><p>
     513Initially, <tt class="varname">weight</tt>_ is -1.0 and the search is biased towards depth first.  In
     514fact, <tt class="function">test()</tt> prefers <i class="parameter"><tt>y</tt></i> if <i class="parameter"><tt>y</tt></i> has fewer unsatisfied variables. In the case of a tie, <tt class="function">test()</tt> prefers the node with the greater depth in tree. The full code for the <tt class="function">CbcCompareUser::test()</tt> method is given in <a href="#test" title="Example 3.1. CbcCompareUser::test()">Example 3.1</a>.
    507515</p><div class="example"><a id="test"></a><p class="title"><b>Example 3.1. <tt class="function">CbcCompareUser::test()</tt></b></p><pre class="programlisting">
    508516   
     
    530538     
    531539  </pre></div><p>
    532 Initially, <tt class="varname">weight</tt>_ is -1.0 and the search is biased towards depth first.  In
    533 fact, <tt class="function">test()</tt> prefers <i class="parameter"><tt>y</tt></i> if <i class="parameter"><tt>y</tt></i> has fewer unsatisfied variables. In the case of a tie, <tt class="function">test()</tt> prefers the node with the greater depth in tree. Once a solution is found, <tt class="function">newSolution()</tt> is called. The method <tt class="function">newSolution()</tt> interacts with <tt class="function">test()</tt> by means of the variable <tt class="varname">weight_</tt>. If the solution was achieved by branching,  a calculation is made to determine the cost per unsatisfied integer variable to go from the continuous solution to an integer solution.  The variable <tt class="varname">weight_</tt> is then set to aim at a slightly better solution.  From then on, <tt class="function">test()</tt> returns <i class="parameter"><tt>true</tt></i> if it seems that <i class="parameter"><tt>y</tt></i> will lead to a better solution than <i class="parameter"><tt>x</tt></i>. This source for <tt class="function">newSolution()</tt> in given in <a href="#newSolution" title="Example 3.2. CbcCompareUser::newSolution()">Example 3.2</a>.
     540CBC calls the method <tt class="function">newSolution()</tt> after a new solution is found. The method <tt class="function">newSolution()</tt> interacts with <tt class="function">test()</tt> by means of the variable <tt class="varname">weight_</tt>. If the solution was achieved by branching,  a calculation is made to determine the cost per unsatisfied integer variable to go from the continuous solution to an integer solution.  The variable <tt class="varname">weight_</tt> is then set to aim at a slightly better solution.  From then on, <tt class="function">test()</tt> returns <i class="parameter"><tt>true</tt></i> if it seems that <i class="parameter"><tt>y</tt></i> will lead to a better solution than <i class="parameter"><tt>x</tt></i>. This source for <tt class="function">newSolution()</tt> in given in <a href="#newSolution" title="Example 3.2. CbcCompareUser::newSolution()">Example 3.2</a>.
    534541</p><div class="example"><a id="newSolution"></a><p class="title"><b>Example 3.2. <tt class="function">CbcCompareUser::newSolution()</tt></b></p><pre class="programlisting">
    535542   
     
    542549{
    543550  if (model-&gt;getSolutionCount()==model-&gt;getNumberHeuristicSolutions())
    544     return; // solution was found by rounding so ignore it.
     551    return; // The number of solutions found by any means equals the
     552            // number of solutions, so this solution was found by rounding.
     553            // Ignore it.
    545554
    546555  // set weight_ to get close to this solution
     
    548557    (model-&gt;getObjValue()-objectiveAtContinuous)/
    549558    ((double) numberInfeasibilitiesAtContinuous);
    550   weight_ = 0.98*costPerInteger;
    551   saveWeight_=weight_;
     559  weight_ = 0.98*costPerInteger; // this aims for a solution
     560                                 // slightly better than known.
     561                                 // why 0.98? why not?! Experiment yourself.                                 
     562  saveWeight_=weight_; // We're going to switching between depth-first and breadth-first
     563                       // branching strategies, depending on what we find in the tree.
     564                       // When doing depth first, we'll want to retrieve this weight.
     565                       // So, let's save it.
    552566  numberSolutions_++;
    553567  if (numberSolutions_&gt;5)
     
    558572  </pre></div><p>
    559573
    560 As the search progresses, the comparison can be modified. If many nodes (or many solutions) have been genereated, then <tt class="varname">weight_</tt> is set to 0.0 leading to a breadth-first search.  Breadth-first search can lead to an enormous tree. If the tree size is exceeds 10000, it may be desirable to return to a search biased towards depth first. Changing the behavior in this manner is done by the method <tt class="function">every1000Nodes</tt> shown in <a href="#everyK" title="Example 3.3. CbcCompareUser::every1000Nodes()">Example 3.3</a>.
     574As the search progresses, the comparison can be modified. If many nodes (or many solutions) have been generated, then <tt class="varname">weight_</tt> is set to 0.0 leading to a breadth-first search.  Breadth-first search can lead to an enormous tree. If the tree size is exceeds 10000, it may be desirable to return to a search biased towards depth first. Changing the behavior in this manner is done by the method <tt class="function">every1000Nodes</tt> shown in <a href="#everyK" title="Example 3.3. CbcCompareUser::every1000Nodes()">Example 3.3</a>.
    561575  </p><div class="example"><a id="everyK"></a><p class="title"><b>Example 3.3. <tt class="function">CbcCompareUser::every1000Nodes()</tt></b></p><pre class="programlisting">
    562576   
    563 // This allows the test() method to change behavior every so often
     577// This allows the test() method to change behavior every 1000 nodes.
    564578bool
    565579CbcCompareUser::every1000Nodes(CbcModel * model, int numberNodes)
    566580{
    567   if (numberNodes&gt;10000)
     581  if (numberNodes&gt;10000) 
    568582    weight_ =0.0; // compare nodes based on objective value
    569   else if (numberNodes==1000&amp;&amp;weight_==-2.0)
    570     weight_=-1.0; // Go to depth first
    571   // get size of tree
     583    // get size of tree
    572584  treeSize_ = model-&gt;tree()-&gt;size();
    573585  if (treeSize_&gt;10000) {
     
    575587    if (treeSize_&gt;20000)
    576588      weight_=-1.0;
    577     else if ((numberNodes%4000)!=0)
     589    else if ((numberNodes%4000)!=0)  // Flip-flop between the strategies.
     590                                     // Why 4000? Why not? Experiment yourself.
    578591      weight_=-1.0;
    579592    else
     
    594607  current bounds. CBC provides an abstract base class <tt class="classname">CbcHeuristic</tt> and a rounding heuristic in CBC.
    595608  </p><p>
    596   This chapter describes how to build a greedy heuristic for a set covering problem, e.g., the miplib problem fast0507. A more general (and efficient) version of the heuristic is in <tt class="filename">CbcHeuristicGreedy.hpp</tt> and <tt class="filename">CbcHeuristicGreedy.cpp</tt> located in the <tt class="filename">COIN/Cbc/Samples</tt> directory, see <a href="#moreexamples" title="Chapter 7. &#10;More Samples&#10;">Chapter 7, <i>
     609  This chapter describes how to build a greedy heuristic for a set covering problem, e.g., the miplib problem fast0507. A more general (and efficient) version of the heuristic is in <tt class="filename">CbcHeuristicGreedy.hpp</tt> and <tt class="filename">CbcHeuristicGreedy.cpp</tt> located in the <tt class="filename">COIN/Cbc/Samples</tt> directory, see <a href="#moreexamples" title="Chapter 8. &#10;More Samples&#10;">Chapter 8, <i>
    597610More Samples
    598611</i></a>.
    599612</p><p>
    600613  The greedy heuristic will leave all variables taking value one at this node of the
    601   tree at value one, and will initially set all other variable to value zero. 
     614  tree at value one, and will initially set all other variables to value zero. 
    602615  All variables are then sorted in order of their cost
    603616  divided by the number of entries in rows which are not yet covered. (We may randomize that
    604617  value a bit so that ties will be broken in different ways on different runs of the heuristic.)
    605618  The best one is choosen, and set to one. The process is repeated. Because this is
    606   a set covering problem (i.e., all constraints are ≥), the heuristic is guaranteed to find a solution (but not necessarily an improved solution). The speed of the heuristic could be improved by just redoing those affected, but for illustrative purposes we will keep it simple.(The speed could also be improved if all elements are 1.0).
     619  a set covering problem (i.e., all constraints are ≥), the heuristic is guaranteed to find a solution (but not necessarily an improved solution). The speed of the heuristic could be improved by just redoing those affected, but for illustrative purposes we will keep it simple. (The speed could also be improved if all elements are 1.0).
    607620</p><p>
    608621  The key <tt class="classname">CbcHeuristic</tt> method is <tt class="function">int solution(double &amp; solutionValue,
    609622                                              double * betterSolution)</tt>.
    610623  The <tt class="function">solution()</tt> method returns 0 if no solution found, and returns 1 if a solution is found, in which case it fills in the objective value and primal solution.  The code in <tt class="filename">CbcHeuristicGreedy.cpp</tt> is a little more complicated than this following example. For instance, the code here assumes all variables are integer.  The important bit of data is a copy of the matrix (stored by column) before any cuts have been made.  The data used are bounds, objective and the matrix plus two work arrays.
    611   </p><div class="example"><a id="id2966006"></a><p class="title"><b>Example 4.1. Data</b></p><pre class="programlisting">
     624  </p><div class="example"><a id="id3047001"></a><p class="title"><b>Example 4.1. Data</b></p><pre class="programlisting">
    612625   
    613626  OsiSolverInterface * solver = model_-&gt;solver(); // Get solver from CbcModel
     
    635648  </pre></div><p>
    636649The <tt class="varname">newSolution</tt> is then initialized to the rounded down solution.
    637 </p><div class="example"><a id="id2966036"></a><p class="title"><b>Example 4.2. Initialize <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
     650</p><div class="example"><a id="id3047030"></a><p class="title"><b>Example 4.2. Initialize <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
    638651   
    639652  for (iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     
    648661    newSolution[iColumn]=value;
    649662    if (value) {
    650       double cost = direction * objective[iColumn];
     663      double cost = objective[iColumn];
    651664      newSolutionValue += value*cost;
    652665      for (j=columnStart[iColumn];
     
    661674
    662675
    663 At this point some row activities may be below their lower bound. To correct this infeasibility, the variable which is cheapest in reducing the sum of infeasibilities is found and updated, and the process repeats.  This is a finite process. (Theimplementation could be faster, but is kept simple for illustrative purposes.)
    664   </p><div class="example"><a id="id2966116"></a><p class="title"><b>Example 4.3. Create Feasible <tt class="varname">newSolution</tt> from Initial <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
     676At this point some row activities are below their lower bound. To correct the infeasibility, the variable which is cheapest in reducing the sum of infeasibilities is found and updated, and the process repeats.  This is a finite process. (The implementation could be faster, but is kept simple for illustrative purposes.)
     677  </p><div class="example"><a id="id3047111"></a><p class="title"><b>Example 4.3. Create Feasible <tt class="varname">newSolution</tt> from Initial <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
    665678   
    666679  while (true) {
     
    708721     
    709722  </pre></div><p>
    710 A solution value of <tt class="varname">newSolution</tt> is compared to the best solution value. If <tt class="varname">newSolution</tt> is an improvement, its feasibility is validated.
    711   </p><div class="example"><a id="id2966155"></a><p class="title"><b>Example 4.4. Check Solution Quality of <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
     723A solution value of <tt class="varname">newSolution</tt> is compared to the best solution value. If <tt class="varname">newSolution</tt> is an improvement, its feasibility is validated. We expect <tt class="varname">newSolution</tt> to be feasible, and are trapping for unexpected numerical errors.
     724  </p><div class="example"><a id="id3047155"></a><p class="title"><b>Example 4.4. Check Solution Quality of <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
    712725   
    713726  returnCode=0; // 0 means no good solution
     
    745758  </pre></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="branchChapter"></a>Chapter 5. 
    746759  Branching
    747  </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#branching">Pseudo Cost Branching</a></dt><dt><a href="#followOn">Follow-On Branching</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="branching"></a>Pseudo Cost Branching</h2></div></div><div></div></div><p>
     760 </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#branchingIntro">Branching Overview</a></dt><dt><a href="#branching">Pseudo Cost Branching</a></dt><dt><a href="#followOn">Follow-On Branching</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="branchingIntro"></a>Branching Overview</h2></div></div><div></div></div><p>
     761CBC's concept of branching is based on the idea of an "object". An object has (i) a feasible region, (ii) can be evaluated for infeasibility, (iii) can be branched on, e.g., a method of generating a branching object, which defines an up branch and a down branch, and (iv) allows comparsion of the effect of branching. Instances of objects include.
     762</p><div class="itemizedlist"><ul type="disc"><li><tt class="classname">CbcSimpleInteger</tt>, </li><li><tt class="classname">CbcSimpleIntegerPseudoCosts</tt>,  </li><li><tt class="classname">CbcClique</tt>, </li><li><tt class="classname">CbcSOS</tt> (type 1 and 2), </li><li><tt class="classname">CbcFollowOn</tt>, and </li><li><tt class="classname">CbcLotsize</tt>.</li></ul></div><p>
     763In <a href="#branchChapter" title="Chapter 5. &#10;  Branching&#10; ">Chapter 5, <i>
     764  Branching
     765 </i></a>, we give examples of how to use existing branching objects. (The next revision of this Guide should include an example of how to write your own branching object; Contributions of examples are welcome.)
     766</p></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="branching"></a>Pseudo Cost Branching</h2></div></div><div></div></div><p>
    748767
    749768If the user declares variables as integer but does no more, then CBC will treat them
     
    751770it is assumed that if a variable is at 1.3 then the cost of branching that variable down will be 0.3 times the down pseudo cost and the cost of branching up would be 0.7 times the up pseudo cost.  Pseudo costs can be used both for branching and for choosing a node.
    752771   The full code is in <tt class="filename">longthin.cpp</tt> located in the CBC Samples directory, see
    753   <a href="#moreexamples" title="Chapter 7. &#10;More Samples&#10;">Chapter 7, <i>
     772  <a href="#moreexamples" title="Chapter 8. &#10;More Samples&#10;">Chapter 8, <i>
    754773More Samples
    755774</i></a>.
     
    801820   The full sample code for follow-on brancing is in <tt class="filename">crew.cpp</tt>
    802821  located in the CBC Samples directory, see
    803   <a href="#moreexamples" title="Chapter 7. &#10;More Samples&#10;">Chapter 7, <i>
     822  <a href="#moreexamples" title="Chapter 8. &#10;More Samples&#10;">Chapter 8, <i>
    804823More Samples
    805824</i></a>).  In this case, the simple integer
    806 variables are left which may be necessary if other sorts of constraints exist. Follow-on branching rules are to be considered first, so the priorities are set to indicated the follow-on rules take precedence. Priority 1 is the highest priority.
    807 
    808 </p><div class="example"><a id="id2966435"></a><p class="title"><b>Example 5.2. <tt class="classname">CbcFollowOn</tt></b></p><pre class="programlisting">
     825variables are left which may be necessary if other sorts of constraints exist. Follow-on branching rules are to be considered first, so the priorities are set to indicate the follow-on rules take precedence. Priority 1 is the highest priority.
     826
     827</p><div class="example"><a id="id3047524"></a><p class="title"><b>Example 5.2. <tt class="classname">CbcFollowOn</tt></b></p><pre class="programlisting">
    809828   
    810829  int iColumn;
     
    840859  model.passInPriorities(&amp;followPriority,true);
    841860     
    842   </pre></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="SolverChap"></a>Chapter 6. 
    843   Advance Solver Uses
     861  </pre></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="CutsChap"></a>Chapter 6. Cutting planes</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#cuts">Using Cut Generators with CBC</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="cuts"></a>Using Cut Generators with CBC</h2></div></div><div></div></div><p>
     862In the next version of this Guide, we need to have an example illustrating how to use COIN's CGL with CBC. Contribtions are welcome.
     863
     864  </p></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="SolverChap"></a>Chapter 7. 
     865  Advanced Solver Uses
    844866</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#solver">Creating a Solver via Inheritance</a></dt><dt><a href="#quadratic">Quadratic MIP</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="solver"></a>Creating a Solver via Inheritance</h2></div></div><div></div></div><p>
    845867  CBC uses a generic <tt class="classname">OsiSolverInterface</tt> and its <tt class="function">resolve</tt> capability.
    846868  This does not give much flexibility so advanced users can inherit from their interface
    847   of choice.  This section illustrates how to implement such a solver for a long thin problem, e.g., fast0507 again.  As with the other examples in the Guide, the sample code is not guaranteed to be the fastest way to solve the problem. The main purpose of the example is to illustrate techniques. The full source is in <tt class="filename">CbcSolver2.hpp</tt> and <tt class="filename">CbcSolver2.cpp</tt> located in the CBC Samples directory, see
    848   <a href="#moreexamples" title="Chapter 7. &#10;More Samples&#10;">Chapter 7, <i>
     869  of choice.  This section illustrates how to implement a specialized solver for a long thin problem, e.g., fast0507 again.  As with the other examples in the Guide, the sample code is not guaranteed to be the fastest way to solve the problem. The main purpose of the example is to illustrate techniques. The full source is in <tt class="filename">CbcSolver2.hpp</tt> and <tt class="filename">CbcSolver2.cpp</tt> located in the CBC Samples directory, see
     870  <a href="#moreexamples" title="Chapter 8. &#10;More Samples&#10;">Chapter 8, <i>
    849871More Samples
    850872</i></a>.
    851873</p><p>
    852874The method <tt class="function">initialSolve</tt> is called a few times in CBC, and provides a convenient starting point. The <tt class="varname">modelPtr_</tt> derives from <tt class="classname">OsiClpSolverInterface</tt>.
    853   </p><div class="example"><a id="initialSolve"></a><p class="title"><b>Example 6.1. <tt class="function">initialSolve()</tt></b></p><pre class="programlisting">
     875  </p><div class="example"><a id="initialSolve"></a><p class="title"><b>Example 7.1. <tt class="function">initialSolve()</tt></b></p><pre class="programlisting">
    854876   
    855877  // modelPtr_ is of type ClpSimplex *
     
    868890  </pre></div><p>
    869891The <tt class="function">resolve()</tt> method is more complicated than <tt class="function">initialSolve()</tt>.  The main pieces of data are a counter <tt class="varname">count_</tt> which is incremented each solve and an integer array <tt class="varname">node_</tt> which stores the last time
    870 a variable was active in a solution.  For the first few times, the normal Dual Simplex is called and
     892a variable was active in a solution.  For the first few solves, the normal Dual Simplex is called and
    871893<tt class="varname">node_</tt> array is updated.
    872 </p><div class="example"><a id="id2966664"></a><p class="title"><b>Example 6.2. First Few Solves</b></p><pre class="programlisting">
     894</p><div class="example"><a id="id3047792"></a><p class="title"><b>Example 7.2. First Few Solves</b></p><pre class="programlisting">
    873895   
    874896  if (count_&lt;10) {
     
    891913After the first few solves, only those variables which took part in a solution in the last so many
    892914solves are used.  As fast0507 is a set covering problem, any rows which are already covered can be taken out.
    893   </p><div class="example"><a id="id2966692"></a><p class="title"><b>Example 6.3. Create Small Problem</b></p><pre class="programlisting">
     915  </p><div class="example"><a id="id3047820"></a><p class="title"><b>Example 7.3. Create Small Sub-Problem</b></p><pre class="programlisting">
    894916   
    895917    int * whichRow = new int[numberRows]; // Array to say which rows used
     
    9851007     
    9861008  </pre></div><p>
    987 If the variables cover the rows, then the problem is feasible (no cuts are being used). If the rows
    988 were equality constraints, then this might not be the case. More work would be needed.  After the solution, the reduct costs are checked. If any reduced costs are negative, the code goes back to the full problem and cleans up with Primal Simplex.
    989   </p><div class="example"><a id="id2966737"></a><p class="title"><b>Example 6.4. Check Optimal Solution</b></p><pre class="programlisting">
     1009If the variables cover the rows, then the problem is feasible (no cuts are being used). (If the rows
     1010were equality constraints, then this might not be the case. More work would be needed.)  After the solution to the subproblem, the reduced costs of the full problem are checked. If the reduced cost of any variable not in the subproblem is negative, the code goes back to the full problem and cleans up with Primal Simplex.
     1011  </p><div class="example"><a id="id3047866"></a><p class="title"><b>Example 7.4. Check Optimal Solution</b></p><pre class="programlisting">
    9901012   
    9911013    temp-&gt;setDualObjectiveLimit(1.0e50); // Switch off dual cutoff as problem is restricted
     
    10411063   The full code is in <tt class="filename">ClpQuadInterface.hpp</tt> and
    10421064   <tt class="filename">ClpQuadInterface.cpp</tt> located in the CBC Samples directory, see
    1043   <a href="#moreexamples" title="Chapter 7. &#10;More Samples&#10;">Chapter 7, <i>
     1065  <a href="#moreexamples" title="Chapter 8. &#10;More Samples&#10;">Chapter 8, <i>
    10441066More Samples
    10451067</i></a>).
    1046   </p><div class="example"><a id="id2966802"></a><p class="title"><b>Example 6.5. Solving a Quadratic MIP</b></p><pre class="programlisting">
     1068  </p><div class="example"><a id="id3047932"></a><p class="title"><b>Example 7.5. Solving a Quadratic MIP</b></p><pre class="programlisting">
    10471069   
    10481070  // save cutoff
     
    10611083  ClpObjective * saveObjective  = modelPtr_-&gt;objectiveAsObject();
    10621084  modelPtr_-&gt;setObjectivePointer(quadraticObjective_);
    1063   modelPtr_-&gt;primal();
     1085  modelPtr_-&gt;primal(); // Th model has a quadratic objective,
     1086                       // so this invokes quadratic primal.
    10641087  modelPtr_-&gt;setDualObjectiveLimit(cutoff);
    10651088  if (modelPtr_-&gt;objectiveValue()&gt;cutoff)
     
    10671090  modelPtr_-&gt;setObjectivePointer(saveObjective);
    10681091     
    1069   </pre></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="moreexamples"></a>Chapter 7. 
     1092  </pre></div><p>
     1093Rather than implementing all the method from scratch, we based the quadratic solver <tt class="classname">ClpQuadInteface</tt> on the linear programming solver <tt class="classname">OsiClpSolverInterface</tt>. This is a convenient approach to take when prototyping ideas. After the merit of an idea is proven, the user can decide is a more serious implementation is warranted.
     1094</p></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="moreexamples"></a>Chapter 8. 
    10701095More Samples
    1071 </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2968762">CBC's Samples Directory</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2968762"></a>CBC's Samples Directory</h2></div></div><div></div></div><p>
     1096</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id3049424">CBC's Samples Directory</a></dt></dl></div><div class="section" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3049424"></a>CBC's Samples Directory</h2></div></div><div></div></div><p>
    10721097The CBC distribution includes a number of <tt class="filename">.cpp</tt> sample files.
    10731098Users are encouraged to use them as starting points for their own CBC projects.
     
    10771102by </p><pre class="programlisting">make DRIVER=name</pre><p> which produces an executable <tt class="filename">testit</tt>.  Below is a list of
    10781103some of the most useful sample files with a short description for each file.
    1079 </p><div class="table"><a id="id2969026"></a><p class="title"><b>Table 7.1. Basic Samples</b></p><table summary="Basic Samples" border="0"><colgroup><col /><col /></colgroup><thead><tr><th align="left" valign="bottom">
     1104</p><div class="table"><a id="id3050381"></a><p class="title"><b>Table 8.1. Basic Samples</b></p><table summary="Basic Samples" border="0"><colgroup><col /><col /></colgroup><thead><tr><th align="left" valign="bottom">
    10801105        Source file       
    10811106        </th><th align="left" valign="bottom">
     
    10921117        <tt class="function">CbcHeuristicUser.cpp</tt>
    10931118        with corresponding <tt class="function">*.hpp</tt> files.
    1094         </td></tr></tbody></table></div><div class="table"><a id="id2969203"></a><p class="title"><b>Table 7.2. Advanced Samples</b></p><table summary="Advanced Samples" border="0"><colgroup><col /><col /></colgroup><thead><tr><th align="left" valign="bottom">
     1119        </td></tr></tbody></table></div><div class="table"><a id="id3050556"></a><p class="title"><b>Table 8.2. Advanced Samples</b></p><table summary="Advanced Samples" border="0"><colgroup><col /><col /></colgroup><thead><tr><th align="left" valign="bottom">
    10951120        Source file       
    10961121        </th><th align="left" valign="bottom">
     
    11211146        </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/lotsize.cpp" target="_top"><tt class="filename">lotsize.cpp</tt></a></td><td align="left" valign="top">
    11221147        This artificially creates a Lot Sizing problem.
    1123         </td></tr></tbody></table></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="messages"></a>Chapter 8. 
     1148        </td></tr></tbody></table></div></div></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="messages"></a>Chapter 9. 
    11241149  Messages
    11251150  </h2></div></div><div></div></div><p>
     
    11371162  </p><p>There are several log levels. Setting the log level to be <i class="parameter"><tt>i</tt></i> produces the log messages for level <i class="parameter"><tt>i</tt></i> and all levels less than <i class="parameter"><tt>i</tt></i>.
    11381163 </p><div class="itemizedlist"><ul type="disc"><li>
    1139     Logging Level 0: Switches off all CBC messages, but one.
     1164    Log Level 0: Switches off all CBC messages, but one.
    11401165    </li><li>
    1141     Logging Level 1: The default. 
     1166    Log Level 1: The default. 
    11421167    </li><li>
    1143     Logging Level 2: Substantial amount of information, e.g., message 15 is generated once per node. Can be useful when the evaluation at each node is slow.
     1168    Log Level 2: Substantial amount of information, e.g., message 15 is generated once per node. Can be useful when the evaluation at each node is slow.
    11441169    </li><li>
    1145     Logging Level 3: Tremendous amount of information, e.g., multiple messages per node.
    1146     </li></ul></div><div class="table"><a id="id2970505"></a><p class="title"><b>Table 8.1. 
    1147   CBC Messages Passed At Logging Level 0
    1148   </b></p><table summary="&#10;  CBC Messages Passed At Logging Level 0&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
     1170    Log Level 3: Tremendous amount of information, e.g., multiple messages per node.
     1171    </li></ul></div><div class="table"><a id="id3051858"></a><p class="title"><b>Table 9.1. 
     1172  CBC Messages Passed At Log Level 0
     1173  </b></p><table summary="&#10;  CBC Messages Passed At Log Level 0&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
    11491174      Code
    11501175      </th><th> </th><th align="left">
     
    11541179      </td><td> </td><td align="left"><tt class="computeroutput">No integer variables - nothing to do</tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    11551180
    1156       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id2970650"></a><p class="title"><b>Table 8.2. 
    1157   CBC Messages Passed At or Above Logging Level 1
    1158   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 1&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
     1181      </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3052003"></a><p class="title"><b>Table 9.2. 
     1182  CBC Messages Passed At or Above Log Level 1
     1183  </b></p><table summary="&#10;  CBC Messages Passed At or Above Log Level 1&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
    11591184      Code
    11601185      </th><th> </th><th align="left">
     
    12781303      </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    12791304     
    1280       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id2972014"></a><p class="title"><b>Table 8.3. 
    1281   CBC Messages Passed At or Above Logging Level 2
    1282   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 2&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
     1305      </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3053367"></a><p class="title"><b>Table 9.3. 
     1306  CBC Messages Passed At or Above Log Level 2
     1307  </b></p><table summary="&#10;  CBC Messages Passed At or Above Log Level 2&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
    12831308      Code
    12841309      </th><th> </th><th align="left">
     
    13081333      </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    13091334     
    1310       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id2972415"></a><p class="title"><b>Table 8.4. 
    1311   CBC Messages Passed At or Above Logging Level 3
    1312   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 3&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
     1335      </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3053768"></a><p class="title"><b>Table 9.4. 
     1336  CBC Messages Passed At or Above Log Level 3
     1337  </b></p><table summary="&#10;  CBC Messages Passed At or Above Log Level 3&#10;  " border="0"><colgroup><col /><col /><col /><col /></colgroup><thead><tr><th align="center">
    13131338      Code
    13141339      </th><th> </th><th align="left">
     
    13261351      </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    13271352     
    1328       </p></td><td class="auto-generated"> </td></tr></tbody></table></div></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2974565"></a>Appendix A. FAQ</h2></div></div><div></div></div><div class="qandaset"><table border="0" summary="Q and A Set"><col align="left" width="1%" /><tbody><tr class="question"><td align="left" valign="top"><a id="id2973929"></a><a id="id2974588"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1353      </p></td><td class="auto-generated"> </td></tr></tbody></table></div></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id3055917"></a>Appendix A. FAQ</h2></div></div><div></div></div><div class="qandaset"><table border="0" summary="Q and A Set"><col align="left" width="1%" /><tbody><tr class="question"><td align="left" valign="top"><a id="id3055281"></a><a id="id3055940"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13291354  What is <a href="http://www.coin-or.org/faqs.html#CBC" target="_top">CBC</a>?
    13301355  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
     
    13351360  library (though a rudimentary stand-alone executable exists).
    13361361  The first documented release was .90.0  The current release is version .90.0. (JF 04/01/05)
    1337   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2974643"></a><a id="id2974646"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1362  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3055996"></a><a id="id3055999"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13381363  What are some of the features of CBC?
    13391364  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    13401365  CBC allows the use of any CGL cuts and the use of heuristics and
    13411366   specialized branching methods. (JF 04/01/05)
    1342   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2975582"></a><a id="id2975585"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1367  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3056934"></a><a id="id3056937"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13431368  How do I obtain and install CBC?
    13441369  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
     
    13501375  <a href="http://www.coin-or.org/faqs.html#BuildCode" target="_top">install</a>
    13511376  COIN-OR modules. (JF 04/01/05)
    1352   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2975631"></a><a id="id2975634"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1377  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3056984"></a><a id="id3056987"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13531378  Is CBC reliable?
    13541379  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    13551380  CBC has been tested on many problems,
    13561381  but more testing and improvement is needed before it can get to version 1.0. (JF 04/01/05)
    1357   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2975657"></a><a id="id2975660"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1382  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3057009"></a><a id="id3057012"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13581383  Is there any documentation for CBC? 
    13591384  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
     
    13621387  <a href="http://www.coin-or.org/Doxygen/Cbc/" target="_top">CBC class descriptions</a> generated
    13631388  by <a href="http://www.doxygen.org" target="_top">Doxygen</a>. (JF 04/01/05)
    1364   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2975698"></a><a id="id2975702"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1389  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3057051"></a><a id="id3057054"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13651390  Is CBC as fast as Cplex or Xpress?
    13661391  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    13671392   No. However its design is much more flexible so advanced users
    13681393   will be able to tailor CBC to their needs. (JF 04/01/05)
    1369   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2975724"></a><a id="id2975728"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1394  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3057077"></a><a id="id3057080"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13701395  When will version 1.0 of CBC be available? 
    13711396  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
    13721397  It is expected that version 1.0 will be released in time for the 2005
    13731398  <a href="http://www.informs.org" target="_top">INFORMS</a> annual meeting. (JF 04/01/05)
    1374   </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id2975758"></a><a id="id2975761"></a><b>Q:. </b></td><td align="left" valign="top"><p>
     1399  </p></td></tr><tr class="question"><td align="left" valign="top"><a id="id3057110"></a><a id="id3057113"></a><b>Q:. </b></td><td align="left" valign="top"><p>
    13751400  What can the community do to help?
    13761401  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:. </b></td><td align="left" valign="top"><p>
     
    14001425<tt class="filename">COIN/Cbc/Doc/html</tt>.  The same can be done for
    14011426the COIN core, from the <tt class="filename">COIN/Coin</tt> directory.
    1402 </p></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id2974315"></a>Appendix C. Revision History</h2></div></div><div></div></div><div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.2</td><td align="left">May 2, 2005</td><td align="left">RLH</td></tr><tr><td align="left" colspan="3">Book chapter for CBC Tutorial at INFORMS 2005 annual meeting. Reorganized the content. Added CBC Messages. Changed the font type to distinguish functions/variables/classnames/code from text.</td></tr><tr><td align="left">Revision 0.1</td><td align="left">April 1, 2005</td><td align="left">JF</td></tr><tr><td align="left" colspan="3">First draft. The CBC documenation uses the DocBook CLP documentation created by David de la Nuez.</td></tr></table></div></div></div></body></html>
     1427</p></div><div class="appendix" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id3055667"></a>Appendix C. Revision History</h2></div></div><div></div></div><div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.21</td><td align="left">May 10, 2005</td><td align="left">RLH</td></tr><tr><td align="left" colspan="3">Fixed typos caught by Cole Smith, editor of the INFORMS Tutorial Book, and added place holders for needs-to-be-written sections, e.g., Using CGL with CBC.</td></tr><tr><td align="left">Revision 0.2</td><td align="left">May 2, 2005</td><td align="left">RLH</td></tr><tr><td align="left" colspan="3">Book chapter for CBC Tutorial at INFORMS 2005 annual meeting. Reorganized the content. Added CBC Messages. Changed the font type to distinguish functions/variables/classnames/code from text.</td></tr><tr><td align="left">Revision 0.1</td><td align="left">April 1, 2005</td><td align="left">JF</td></tr><tr><td align="left" colspan="3">First draft. The CBC documentation uses the DocBook CLP documentation created by David de la Nuez.</td></tr></table></div></div></div></body></html>
  • html/trunk/Cbc/ch01.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 1. 
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 1. 
    23    Introduction
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="index.html" title="CBC User Guide"><link rel="next" href="ch01s02.html" title="
    4   Prerequisites
    5   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. 
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="index.html" title="CBC User Guide"/><link rel="next" href="ch01s02.html" title="&#10;  Prerequisites&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. 
    65    Introduction
    7   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. 
     6  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="intro"/>Chapter 1. 
    87    Introduction
    9   </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch01.html#id2826645">
     8  </h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch01.html#id3165529">
    109  Welcome to CBC
    1110  </a></dt><dt><a href="ch01s02.html">
    1211  Prerequisites
    13   </a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2826645"></a>
     12  </a></dt><dt><a href="ch01s03.html">Preliminaries</a></dt><dt><a href="ch01s04.html">
     13Branch-and-Cut Overview
     14</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3165529"/>
    1415  Welcome to CBC
    15   </h2></div></div><div></div></div><p>
    16   COIN Branch and Cut or CBC is an open-source mixed integer solver written
    17   in C++.  It is primarily meant to be used as a callable library, but a
    18   basic, stand-alone do link **** link linkend="cbcexe"executable version is also
    19   available.  This Branch and Cut solver relies on many other parts of the COIN
    20   repository.  So it relies on Cgl for cut generators and any cut generator written to
    21   CGL standards may be used in CBC.  Again some of these cut generators e.g. Gomory cuts
    22   rely on the factorization functionality of CoinFactorization.  CBC needs a linear solver
    23   and uses the Osi (Open Solver Interface) interface to access the linaer solver so
    24   many solvers may be used.  However the most common use is expected to be when
    25   using COIN's native linear Solver - CLP.
    26   </p><p>
    27   Before examining CBC in more detail it may be helpful to give a very brief description
    28   of Branch and Cut (which should really be called Branch and Cut and Bound).  If some
    29   variables in the model must take on integer values e.g. 0,1 or 2 then the integrality
    30   requirement is relaxed and a lower bound of 0.0 and an upper bound of 2.0 put on the
    31   variable(s). This linear model can be solved using a solver.  If all "integer"
    32   variables take integer values then we are finished;  if not we choose one non-integral
    33   variable e.g. with value 1.3 (A) (B) and create two linear models - one with the variable
    34   having an upper bound of 1.0 and the other with a lower bound of 2.0.  We then put
    35   these two models on our tree of models and solve one of them.  We repeat the process
    36   taking one model off our tree (C) (D) and repeating the process.  As every time we
    37   branch we tighten the problem so the objective value can not improve.  So if we
    38   obtain a valid solution we can use that as a bound to prune the tree.  If we
    39   try and make the linear models more integral by using Cuts then it is termed
    40   Branch and Cut (E) (F).
    41   </p><div class="table"><a name="id2826677"></a><p class="title"><b>Table 1.1. Associated classes</b></p><table summary="Associated classes" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>
    42     Note
    43     </th><th>
    44     Class name
    45     </th><th>
    46     Description
    47     </th></tr></thead><tbody><tr><td align="left" valign="top">
    48       (A)
    49       </td><td align="left" valign="top">
    50       CbcBranch...
    51       </td><td align="left" valign="top">
    52       These classes define what is the nature of discontinuity.  The simplest
    53       are variables which must take an integral value but there others
    54       which will be described later e.g. lotsizing variables. 
    55       </td></tr><tr><td align="left" valign="top">
    56       (B)
    57       </td><td align="left" valign="top">
    58       CbcNode
    59       </td><td align="left" valign="top">
    60       This is the class that decides which variable/entity  to branch on next.
    61       Even advanced users will probably only interact with this by setting
    62       CbcModel parameters e.g. priorities.
    63       </td></tr><tr><td align="left" valign="top">
    64       (C)
    65       </td><td align="left" valign="top">
    66       CbcTree
    67       </td><td align="left" valign="top">
    68       All unsolved models can be thought of as being on a tree where each
    69       model can branch two or more times.  The user should not need to be
    70       concerned with this class.
    71       </td></tr><tr><td align="left" valign="top">
    72       (D)
    73       </td><td align="left" valign="top">
    74       CbcCompare...
    75       </td><td align="left" valign="top">
    76       All unsolved models are in a tree but which leaf do we choose.  These
    77       classes are very small simple ones which can be tailored to suit the problem.
    78       </td></tr><tr><td align="left" valign="top">
    79       (E)
    80       </td><td align="left" valign="top">
    81       CglCutGenerators
    82       </td><td align="left" valign="top">
    83       Any cut generator from Cgl can be given to the model to be used with parameters
    84       which modify when each generator will be tried.  Few people will write their
    85       own cut generators but all should see which are effective.
    86       </td></tr><tr><td align="left" valign="top">
    87       (F)
    88       </td><td align="left" valign="top">
    89       CbcHeuristics
    90       </td><td align="left" valign="top">
    91       Heuristics are very important for obtaining valid solutions quickly.  Some
    92       are available but this is an area where it is useful and interesting to
    93       write specialized ones.
    94       </td></tr></tbody></table></div><p>
    95   There are a number of resources available to help new CBC users get started.
    96   This document is designed to be used in conjunction with the files in the
    97   Samples subdirectory of the main CBC directory (<tt class="filename">COIN/Cbc/Samples</tt>).
    98   The Samples illustrate how to use CBC and may also serve as useful starting points
    99   for user projects.  In the event that either this document or the available
    100   <a href="apb.html" title="Appendix B. Doxygen">Doxygen content</a> conflicts with the observed
    101   behavior of the source code, the comments in the header files, found in
    102   <tt class="filename">COIN/Cbc/include</tt>, are the ultimate reference.
    103   </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CBC User Guide </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
     16  </h2></div></div><div/></div><p>
     17  The COIN
     18    <sup>[<a id="id3221690" href="#ftn.id3221690">1</a>]</sup>
     19Branch and Cut solver (CBC) is an open-source mixed-integer program (MIP) solver written  in C++. CBC is intended to be used primarily as a callable library to create customized branch-and-cut solvers. A basic, stand-alone  executable version is also available. CBC is an active open-source project led by John Forrest at www.coin-or.org.
     20 </p></div><div class="footnotes"><br/><hr width="100" align="left"/><div class="footnote"><p><sup>[<a id="ftn.id3221690" href="#id3221690">1</a>] </sup>
     21        The complete acronym is "COIN-OR" which stands for the Compuational Infrastructure for Operations Research. For simplicity (and in keeping with the directory and function names) we will simply use "COIN".
     22        </p></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CBC User Guide </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
    10423  Prerequisites
    10524  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch01s02.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>
    23  Prerequisites
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch01.html" title="Chapter 1. 
    4     Introduction
    5   "><link rel="previous" href="ch01.html" title="Chapter 1. 
    6     Introduction
    7   "><link rel="next" href="ch02.html" title="Chapter 2. 
    8   Basic Model Classes
    9   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch01.html" title="Chapter 1. &#10;    Introduction&#10;  "/><link rel="previous" href="ch01.html" title="Chapter 1. &#10;    Introduction&#10;  "/><link rel="next" href="ch01s03.html" title="Preliminaries"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
    105  Prerequisites
    116  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><th width="60%" align="center">Chapter 1. 
    127    Introduction
    13   </th><td width="20%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2896885"></a>
     8  </th><td width="20%" align="right"> <a accesskey="n" href="ch01s03.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3221650"/>
    149  Prerequisites
    15   </h2></div></div><div></div></div><p>
    16   CBC is written in C++, so it is expected that users of CBC will be writing
    17   C++ programs which use CBC as a library.  Thus a working knowledge of
     10  </h2></div></div><div/></div><p>
     11  The primary users of CBC are expected to be developers implementing customized branch-and-cut algorithms in C++ using CBC as a library. Consequently, this document assumes a working knowledge of
    1812  <a href="http://www.cplusplus.com/doc/tutorial/" target="_top">C++</a>, including basic
    19   object-oriented programming terminology is assumed in this document.  In
    20   addition, the user should be familiar with the fundamental concepts of
     13  object-oriented programming terminology, and familiarity with the fundamental concepts of
    2114  <a href="http://carbon.cudenver.edu/~hgreenbe/courseware/LPshort/intro.html" target="_top">
    22   Linear Programming</a> and
     15  linear programming</a> (LP) and
    2316  <a href="http://carbon.cudenver.edu/~hgreenbe/courseware/MIP/intro.html" target="_top">
    24   Mixed Integer Programming (may need better linke)</a> .
    25   </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. 
     17  mixed integer programming</a> (MIP).
     18  </p><p>
     19
     20CBC relies on other parts of the COIN repository. CBC needs a LP solver and relies on the COIN Open Solver Inteface (OSI) to communicate with the user's choice of solver. Any LP solver with an OSI interface can be used with CBC. The LP solver expected to be used most commonly is COIN's native linear program solver, CLP. For cut generators, CBC relies on the COIN Cut Generation Library (CGL). Any cut generator written to CGL standards can be used with CBC. Some of the cut generators in CGL rely on other parts of COIN, e.g., CGL's Gomory cut generator rely on the factorization functionality of <tt class="classname">CoinFactorization</tt>. This document assumes basic familiarity with OSI and CGL.
     21</p><p>
     22Technically speaking, CBC accesses the solver (and sometime the model and data it contains) through an <tt class="classname">OSISolverInterface</tt>. For the sake of simplicity, we will refer to the <tt class="classname">OsiSolverInterface</tt> as "the solver" in this document, rather than "the standard application programming interface to the solver." We hope any confusion caused by blurring this distinction will be mitigated by the shorter sentences. 
     23 
     24</p><p>
     25In summary, readers should have the following prerequisites:
     26   </p><div class="itemizedlist"><ul type="disc"><li>C++ knowledge,</li><li>LP and MIP fundamentals, and </li><li>OSI familiarity.</li></ul></div><p>
     27</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. 
    2628    Introduction
    27    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. 
    28   Basic Model Classes
    29   </td></tr></table></div></body></html>
     29   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Preliminaries</td></tr></table></div></body></html>
  • html/trunk/Cbc/ch01s03.html

    r555 r557  
    11<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
    2 <html xmlns="http://www.w3.org/1999/xhtml"><head><title>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Preliminaries</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch01.html" title="Chapter 1. &#10;    Introduction&#10;  "/><link rel="previous" href="ch01s02.html" title="&#10;  Prerequisites&#10;  "/><link rel="next" href="ch01s04.html" title="&#10;Branch-and-Cut Overview&#10;"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Preliminaries</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><th width="60%" align="center">Chapter 1. 
     3    Introduction
     4  </th><td width="20%" align="right"> <a accesskey="n" href="ch01s04.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3165821"/>Preliminaries</h2></div></div><div/></div><p>
     5  </p><div class="itemizedlist"><ul type="disc"><li>Unless otherwise stated, the problem being optimized is a minimization problem. </li><li>The terms "model" and "problem" are used synonymously.</li><li>Notation: We use the convention of appending an underscore to
     6              a variable in order to distinguish member data of a class.</li><li>The Cbc Samples directory, <tt class="filename">COIN/Cbc/Samples</tt>
     7              contains the source code for the examples in the Guide.</li><li>The sample code in the Guide is written for illustrative
     8              purposes of the CBC concepts and usage. The sample code is not
     9              necessarily written for performance.</li></ul></div><p>
     10</p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
     11  Prerequisites
     12   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
    313Branch-and-Cut Overview
    4 </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch01.html" title="Chapter 1. &#10;    Introduction&#10;  "/><link rel="previous" href="ch01s02.html" title="&#10;  Prerequisites&#10;  "/><link rel="next" href="ch02.html" title="Chapter 2. &#10;   The CBC Model Class&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
    5 Branch-and-Cut Overview
    6 </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><th width="60%" align="center">Chapter 1. 
    7     Introduction
    8   </th><td width="20%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2910617"/>
    9 Branch-and-Cut Overview
    10 </h2></div></div><div/></div><p>
    11   Before examining CBC in more detail, we tersely describe the basic branch-and-cut algorithm by way of example, (which should really be called branch-and-cut-and-bound) and show the major C++ class(es) in CBC related to each step. The major CBC classes, labeled (A) through (F), are described in <a href="ch01s03.html#assClasses" title="Table 1.1. Associated Classes">Table 1.1</a>.
    12  </p><p>
    13 Step 1. (Bound) Given a MIP model to minimize where some variables must take on integer values (e.g., 0, 1, or 2), relax the integrality requirements (e.g., consider each "integer" variable to be continuous with a lower bound of 0.0 and an upper bound of 2.0). Solve the resulting linear model with an LP solver to obtain a lower bound on the MIP's objective function value.  If the optimal LP solution has integer values for the MIP's integer variables, we are finished. Any MIP-feasible solution provides an upper bound on the objective value. The upper bound equals the lower bound; the solution is optimal.   
    14  </p><p> 
    15 Step 2. (Branch) Otherwise, there exists an "integer" variable with a non-integral value. Choose one non-integral variable (e.g., with value 1.3) (A)(B) and branch. Create two nodes, one with the branching variable having an upper bound of 1.0, and the other with the branching variable having a lower bound of 2.0. Add the two nodes to the search tree.
    16  </p><p>
    17 While (search tree is not empty) {
    18 </p><p>
    19    Step 3. (Choose Node) Pick a node off the tree (C)(D)
    20 </p><p>
    21    Step 4. (Re-optimize LP) Create an LP relaxation and solve.
    22 </p><p>
    23    Step 5. (Bound) Interrogate the optimal LP solution, and try to prune the node by one of the following.
    24    </p><div class="itemizedlist"><ul type="disc"><li>
    25     LP is infeasible, prune the node.
    26     </li><li>
    27     Else, the optimal LP solution value of the node exceeds the current upper bound, prune the node. 
    28     </li><li>
    29     Else, the optimal LP solution of the node does not exceed the current upper bound and the solution is feasible to the MIP. Update the upper bound, and the best known MIP solution, and  prune the node by optimality.         
    30     </li></ul></div><p> 
    31 </p><p>
    32    Step 6. (Branch) If we were unable to prune the node, then branch. Choose one non-integral variable to branch on (A)(B). Create two nodes and add them to the search tree.
    33 }
    34  </p><p>     
    35 This is the outline of a "branch-and-bound" algorithm. If in optimizing the linear programs, we use cuts to tighten the LP relaxations (E)(F), then we have a "branch-and-cut" algorithm. (Note, if cuts are only used in Step 1, the method is called a "cut-and-branch" algorithm.)
    36  
    37  
    38   </p><div class="table"><a id="assClasses"/><p class="title"><b>Table 1.1. Associated Classes</b></p><table summary="Associated Classes" border="0"><colgroup><col/><col/><col/></colgroup><thead><tr><th>
    39     Note
    40     </th><th>
    41     Class name
    42     </th><th>
    43     Description
    44     </th></tr></thead><tbody><tr><td align="left" valign="top">
    45       (A)
    46       </td><td align="left" valign="top"><tt class="classname">CbcBranch...</tt></td><td align="left" valign="top">
    47       These classes define the nature of MIP's discontinuity.  The simplest discontinuity
    48       is a variable which must take an integral value. Other types of discontinuities
    49       exist, e.g., lot-sizing variables.
    50       </td></tr><tr><td align="left" valign="top">
    51       (B)
    52       </td><td align="left" valign="top"><tt class="classname">CbcNode</tt></td><td align="left" valign="top">
    53       This class decides which variable/entity to branch on next.
    54       Even advanced users will probably only interact with this class by setting
    55       <tt class="classname">CbcModel</tt> parameters ( e.g., priorities).
    56       </td></tr><tr><td align="left" valign="top">
    57       (C)
    58       </td><td align="left" valign="top"><tt class="classname">CbcTree</tt></td><td align="left" valign="top">
    59       All unsolved models can be thought of as being nodes on a tree where each
    60       node (model) can branch two or more times.  The user should not need to be
    61       concerned with this class.
    62       </td></tr><tr><td align="left" valign="top">
    63       (D)
    64       </td><td align="left" valign="top"><tt class="classname">CbcCompare...</tt></td><td align="left" valign="top">
    65       These classes are used in determine which of the unexplored nodes in the tree to consider next. These
    66       classes are very small simple classes that can be tailored to suit the problem.
    67       </td></tr><tr><td align="left" valign="top">
    68       (E)
    69       </td><td align="left" valign="top"><tt class="classname">CglCutGenerators</tt></td><td align="left" valign="top">
    70       Any cut generator from CGL can be used in CBC. The cut generators are passed to CBC with parameters
    71       which modify when each generator will be tried. All cut generators should be tried to
    72       determine which are effective. Few users will write their own cut generators.
    73       </td></tr><tr><td align="left" valign="top">
    74       (F)
    75       </td><td align="left" valign="top"><tt class="classname">CbcHeuristics</tt></td><td align="left" valign="top">
    76       Heuristics are very important for obtaining valid solutions quickly.  Some
    77       heuristics are available, but this is an area where it is useful and interesting to
    78       write specialized ones.
    79       </td></tr></tbody></table></div><p>
    80   There are a number of resources available to help new CBC users get started.
    81   This document is designed to be used in conjunction with the files in the
    82   Samples subdirectory of the main CBC directory (<tt class="filename">COIN/Cbc/Samples</tt>).
    83   The Samples illustrate how to use CBC and may also serve as useful starting points
    84   for user projects.  In the event that either this document or the available
    85   <a href="apb.html" title="Appendix B. Doxygen">Doxygen content</a> conflicts with the observed
    86   behavior of the source code, the comments in the header files, found in
    87   <tt class="filename">COIN/Cbc/include</tt>, are the ultimate reference.
    88   </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
    89   Prerequisites
    90    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. 
    91    The CBC Model Class
    92   </td></tr></table></div></body></html>
     14</td></tr></table></div></body></html>
  • html/trunk/Cbc/ch02.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 2. 
    2   Basic Model Classes
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="ch01s02.html" title="
    4   Prerequisites
    5   "><link rel="next" href="ch02s02.html" title="
    6   First Example
    7   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. 
    8   Basic Model Classes
    9   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="cbcmodelclass"></a>Chapter 2. 
    10   Basic Model Classes
    11   </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch02.html#hierarchy">
    12   Hierarchy and list of classes
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 2. 
     3   The CBC Model Class
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch01s04.html" title="&#10;Branch-and-Cut Overview&#10;"/><link rel="next" href="ch02s02.html" title="&#10;  Simple Branch-and-Bound Example&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. 
     5   The CBC Model Class
     6  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="cbcmodelclass"/>Chapter 2. 
     7   The CBC Model Class
     8  </h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch02.html#hierarchy">
     9  Overview
    1310  </a></dt><dt><a href="ch02s02.html">
    14   First Example
     11  Simple Branch-and-Bound Example
    1512  </a></dt><dt><a href="ch02s03.html">
    16   Getting at the Solution (CbcModel methods)
    17   </a></dt><dt><a href="ch02s04.html">Some Useful Set and Get Methods</a></dt><dt><a href="ch02s05.html">
    18   Methods which have a major impact on solution process
    19   </a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="hierarchy"></a>
    20   Hierarchy and list of classes
    21   </h2></div></div><div></div></div><p>
    22   The class that controls Coin Branch and Cut is CbcModel.  This is where most
    23   of the parameter setting is done.  CbcModel uses other classes some of
    24   which are virtual and may have multiple instances.  More details on the more
    25   useful classes will be given later.
    26   The absolute minimum number of actions for CbcModel is:
    27   <tt class="function">CbcModel(OsiSolverInterface &amp; linearSolver)</tt> as constructor,
    28   and <tt class="function">branchAndBound()</tt> for solving the problem.
    29   </p><div class="table"><a name="id2896498"></a><p class="title"><b>Table 2.1. Classes used by CbcModel - Most useful</b></p><table summary="Classes used by CbcModel - Most useful" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>
    30     Class name
    31     </th><th>
    32     Description
    33     </th><th>
    34     Notes
    35     </th></tr></thead><tbody><tr><td align="left" valign="top">
    36       CbcCompareBase
    37       </td><td align="left" valign="top">
    38       Controls choice of next node on tree
    39       </td><td align="left" valign="top">
    40       Default is CbcCompareDefault, others in CbcCompareActual.hpp include
    41       CbcCompareDepth and CbcCompareObjective.  Very easy for user to
    42       experiment.
    43       </td></tr><tr><td align="left" valign="top">
    44       CbcCutGenerator
    45       </td><td align="left" valign="top">
    46       Is a CglCutGenerator with data to decide when to use.
    47       </td><td align="left" valign="top">
    48       Need to know how to add generator to CbcModel.
    49       Not much need to know about details of class.
    50       </td></tr><tr><td align="left" valign="top">
    51       CbcHeuristic
    52       </td><td align="left" valign="top">
    53       Heuristic to try and get valid solutions
    54       </td><td align="left" valign="top">
    55       User can get a lot of value out of coding this.  There can be
    56       as many as you like.
    57       </td></tr><tr><td align="left" valign="top">
    58       CbcObject
    59       </td><td align="left" valign="top">
    60       Definition of what it means for a variable to be satisfied.
    61       </td><td align="left" valign="top">
    62       Virtual - instances include simple integer, simple integer with pseudocosts,
    63       SOS (type 1 and 2) and lotsizing. (found in CbcBranch..hpp).  An object has to
    64       have a method of generating a branching object which defines an up and down
    65       branch.
    66       </td></tr><tr><td align="left" valign="top">
    67       OsiSolverInterface
    68       </td><td align="left" valign="top">
    69       Defines the solver being used and the LP model.  Is normally
    70       passed across to CbcModel before branch and cut.
    71       </td><td align="left" valign="top">
    72       Virtual class - the user would instantiate a particular solver e.g.
    73       OsiClpSolverInterface or OsiXprSolverInterface.
    74       </td></tr></tbody></table></div><div class="table"><a name="id2897749"></a><p class="title"><b>Table 2.2. Classes used by CbcModel - Least useful</b></p><table summary="Classes used by CbcModel - Least useful" border="0"><colgroup><col><col><col></colgroup><thead><tr><th>
    75     Class name
    76     </th><th>
    77     Description
    78     </th><th>
    79     Notes
    80     </th></tr></thead><tbody><tr><td align="left" valign="top">
    81       CbcBranchDecision
    82       </td><td align="left" valign="top">
    83       Part of code for choosing which variable to branch on.  Most of
    84       work is done by definitions in CbcObject
    85       </td><td align="left" valign="top">
    86       Defaults to CbcBranchDefaultDecision
    87       Not much need to know about.
    88       </td></tr><tr><td align="left" valign="top">
    89       CbcCountRowCut
    90       </td><td align="left" valign="top">
    91       Interface to OsiRowCut but counts use so can gracefully vanish.
    92       </td><td align="left" valign="top">
    93       See OsiRowCut for extra information.
    94       Not much need to know about.
    95       </td></tr><tr><td align="left" valign="top">
    96       CbcNode
    97       </td><td align="left" valign="top">
    98       Controls choice of variable/entity to branch on
    99       </td><td align="left" valign="top">
    100       Controlled via CbcModel parameters.
    101       Not much need to know about.
    102       </td></tr><tr><td align="left" valign="top">
    103       CbcNodeInfo
    104       </td><td align="left" valign="top">
    105       Contains data for bounds, basis etc for one node of tree
    106       </td><td align="left" valign="top">
    107       Not much need to know about (header in CbcNode.hpp).
    108       </td></tr><tr><td align="left" valign="top">
    109       CbcTree
    110       </td><td align="left" valign="top">
    111       How tree is stored
    112       </td><td align="left" valign="top">
    113       Can be changed but unlikely.
    114       Not much need to know about.
    115       </td></tr><tr><td align="left" valign="top">
    116       CoinMessageHandler
    117       </td><td align="left" valign="top">
    118       Deals with message handling
    119       </td><td align="left" valign="top">
    120       User can inherit from to specialize message handling. 
    121       Not much need to know about.
    122       </td></tr><tr><td align="left" valign="top">
    123       CoinWarmStartBasis
    124       </td><td align="left" valign="top">
    125       Representation of a basis to be used by solver
    126       </td><td align="left" valign="top">
    127       Not much need to know about.
    128       </td></tr></tbody></table></div></div><tt class="function">double getIntegerTolerance()</tt> and
    129   <tt class="function">setIntegerTolerance(double)</tt>.  An integer variable
    130   is deemed to be at an integral value if it is no further than this tolerance
    131   away.
    132   </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
    133   Prerequisites
    134    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
    135   First Example
     13The Relationship Between OSI and CBC
     14</a></dt><dt><a href="ch02s04.html">
     15  Getting Solution Information
     16  </a></dt><dt><a href="ch02s05.html">
     17   Useful Set and Get Methods in CbcModel
     18  </a></dt><dt><a href="ch02s06.html">
     19  Impacting the Solution Process
     20  </a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="hierarchy"/>
     21  Overview
     22  </h2></div></div><div/></div><p>
     23  The main class in CBC is <tt class="classname">CbcModel</tt>.  The <tt class="classname">CbcModel</tt> class is where most
     24  of the parameter setting is done. The absolute minimum number of actions taken with <tt class="classname">CbcModel</tt> is two,
     25    </p><div class="itemizedlist"><ul type="disc"><li>
     26    <tt class="function">CbcModel(OsiSolverInterface &amp; linearSolver)</tt> as constructor, and
     27    </li><li>
     28    <tt class="function">branchAndBound()</tt> for solving the problem.   
     29    </li></ul></div><p>
     30  </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
     31Branch-and-Cut Overview
     32 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
     33  Simple Branch-and-Bound Example
    13634  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch02s02.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
    2   First Example
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch02.html" title="Chapter 2. 
    4   Basic Model Classes
    5   "><link rel="previous" href="ch02.html" title="Chapter 2. 
    6   Basic Model Classes
    7   "><link rel="next" href="ch02s03.html" title="
    8   Getting at the Solution (CbcModel methods)
    9   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
    10   First Example
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>
     3  Simple Branch-and-Bound Example
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch02.html" title="Chapter 2. &#10;   The CBC Model Class&#10;  "/><link rel="previous" href="ch02.html" title="Chapter 2. &#10;   The CBC Model Class&#10;  "/><link rel="next" href="ch02s03.html" title="&#10;The Relationship Between OSI and CBC&#10;"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
     5  Simple Branch-and-Bound Example
    116  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
    12   Basic Model Classes
    13   </th><td width="20%" align="right"> <a accesskey="n" href="ch02s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="firstexample"></a>
    14   First Example
    15   </h2></div></div><div></div></div><p>
    16   Below is our first CBC sample program.  It is short enough to present in full
    17   (this code can be found in the CBC Samples directory, see
    18   <a href="ch05.html" title="Chapter 5. 
    19 More Samples
    20 ">Chapter 5, <i>
    21 More Samples
    22 </i></a>).  Most of the remaining examples in this Guide
    23   will take the form of small code fragments.
    24   </p><div class="example"><a name="id2898102"></a><p class="title"><b>Example 2.1. minimum.cpp</b></p><pre class="programlisting">
     7   The CBC Model Class
     8  </th><td width="20%" align="right"> <a accesskey="n" href="ch02s03.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="firstexample"/>
     9  Simple Branch-and-Bound Example
     10  </h2></div></div><div/></div><p>
     11  The first sample program shows how to perform simple branch-and-bound with CBC.  This program is short enough to present in full.  Most of the remaining examples will take the form of small code fragments.
     12  The complete code for all the examples in this Guide can be found in the CBC Samples directory, <tt class="filename">COIN/Cbc/Samples</tt>.
     13
     14  </p><div class="example"><a id="minimum.cpp"/><p class="title"><b>Example 2.1. minimum.cpp</b></p><pre class="programlisting">
    2515   
    2616// Copyright (C) 2005, International Business Machines
     
    2919#include "CbcModel.hpp"
    3020
    31 // Using as solver
     21// Using CLP as the solver
    3222#include "OsiClpSolverInterface.hpp"
    3323
     
    3525{
    3626  OsiClpSolverInterface solver1;
    37   // Read in example model
     27
     28  // Read in example model in MPS file format
    3829  // and assert that it is a clean model
    3930  int numMpsReadErrors = solver1.readMps("../../Mps/Sample/p0033.mps","");
    4031  assert(numMpsReadErrors==0);
    4132
    42   // Pass data and solver to CbcModel
     33  // Pass the solver with the problem to be solved to CbcModel
    4334  CbcModel model(solver1);
    4435
    4536  // Do complete search
    4637  model.branchAndBound();
    47   /* Print solution.  CbcModel clones solver so we
    48      need to get current copy */
     38
     39  /* Print the solution.  CbcModel clones the solver so we
     40     need to get current copy from the CbcModel */
    4941  int numberColumns = model.solver()-&gt;getNumCols();
    5042   
    51   const double * solution = model.solver()-&gt;getColSolution();
     43  const double * solution = model.bestSolution();
    5244   
    5345  for (int iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     
    5547    if (fabs(value)&gt;1.0e-7&amp;&amp;model.solver()-&gt;isInteger(iColumn))
    5648      printf("%d has value %g\n",iColumn,value);
    57   }
     49   }
    5850  return 0;
    5951}   
    6052     
    6153  </pre></div><p>
    62   This sample program creates a  <tt class="classname">OsiClpSolverInterface</tt> solver,
    63   reads an MPS file, and if there are no errors, passes it to <tt class="classname">CbcModel</tt>
    64   which solves it
    65   using the Branch and Bound algorithm.  The part of the program which solves the program
    66   is very small but before that the linear solver had to be created with data and
    67   after that the results were printed out.  So the user can see that often knowledge
    68   of the <tt class="classname">OsiSolverInterface</tt> methods will be necessary.
    69   In this case CbcModel has the identical methods so we could have used those but not
    70   always.  For instance the program produces a lot of output so one might add
    71    
    72   model.solver()-&gt;setHintParam(OsiDoReducePrint,true,OsiHintTry);
    73      
    74   to reduce the amount. That improves things a lot but we still get one message per node
    75   so we could add
    76    
    77     model.setLogLevel(1);
    78      
    79   The following section gives many of the ways of getting information from the
    80   model or underlying solver.
    81   </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. 
    82   Basic Model Classes
     54  The program in <a href="ch02s02.html#minimum.cpp" title="Example 2.1. minimum.cpp">Example 2.1</a> creates a <tt class="classname">OsiClpSolverInterface</tt> solver interface (i.e., <tt class="varname">solver1</tt>), and reads an MPS file. If there are no errors, the program passes the problem to <tt class="classname">CbcModel</tt> which solves the problem using the branch-and-bound algorithm. The part of the program which solves the problem is very small (one line!) but before that one line, the LP solver (i.e., <tt class="varname">solver1</tt>) had to be created and populated with the problem. After that one line, the results were printed out.
     55 </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. 
     56   The CBC Model Class
    8357   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
    84   Getting at the Solution (CbcModel methods)
    85   </td></tr></table></div></body></html>
     58The Relationship Between OSI and CBC
     59</td></tr></table></div></body></html>
  • html/trunk/Cbc/ch02s03.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
    2   Getting at the Solution (CbcModel methods)
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch02.html" title="Chapter 2. 
    4   Basic Model Classes
    5   "><link rel="previous" href="ch02s02.html" title="
    6   First Example
    7   "><link rel="next" href="ch02s04.html" title="Some Useful Set and Get Methods"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
    8   Getting at the Solution (CbcModel methods)
    9   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
    10   Basic Model Classes
    11   </th><td width="20%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="gettingsolution"></a>
    12   Getting at the Solution (CbcModel methods)
    13   </h2></div></div><div></div></div><p>
    14   The OSI way to check for optimality is to call model.isProvenOptimal().  Also
    15   available are <tt class="function">isProvenInfeasible()</tt>,
    16   <tt class="function">isSolutionLimitReached()</tt>,
    17   <tt class="function">isNodeLimitReached()</tt> or the feared
    18   <tt class="function">isAbandoned()</tt>. You can also pick up
    19   <tt class="function">int status()</tt> which returns 0 if finished,
    20    1 if stopped by user and 2 if difficulties. (status of 0 even if proved
    21    infeasible)
    22   </p><p>
    23   Similarly, we can pick up the solution values.  The OSI methods pick up
    24   the current solution.  This will match the best solution found so far if
    25   called after branchAndBound and if a solution was found.
    26   </p><div class="table"><a name="id2898257"></a><p class="title"><b>Table 2.3. 
    27   Methods for getting solution information from OSI solver
    28   </b></p><table summary="
    29   Methods for getting solution information from OSI solver
    30   " border="0"><colgroup><col><col></colgroup><thead><tr><th>
    31       Purpose
    32       </th><th>
    33       Name
    34       </th><th>
    35       Notes
    36       </th></tr></thead><tbody><tr><td align="left" valign="top">
    37       Primal column solution
    38       </td><td align="left" valign="top"><tt class="function">const double * getColSolution()</tt></td><td align="left" valign="top">
    39       Outside CBC will be best solution unless none found.  Safer to use
    40       CbcModel::bestSolution()
    41       </td></tr><tr><td align="left" valign="top">
    42       Dual row solution
    43       </td><td align="left" valign="top"><tt class="function">const double * getRowPrice()</tt></td><td align="left" valign="top">
    44       CbcModel:: version available and identical
    45       </td></tr><tr><td align="left" valign="top">
    46       Primal row solution
    47       </td><td align="left" valign="top"><tt class="function">const double * getRowActivity()</tt></td><td align="left" valign="top">
    48       CbcModel:: version available and identical
    49       </td></tr><tr><td align="left" valign="top">
    50       Dual column solution
    51       </td><td align="left" valign="top"><tt class="function">const double * getReducedCost()</tt></td><td align="left" valign="top"> </td></tr><tr><td align="left" valign="top">
    52       Number of rows in model
    53       </td><td align="left" valign="top"><tt class="function">int getNumRows()</tt></td><td align="left" valign="top">
    54       CbcModel:: version available and identical
    55       (but note that number of rows may change due to cuts)
    56       </td></tr><tr><td align="left" valign="top">
    57       Number of columns in model
    58       </td><td align="left" valign="top"><tt class="function">int getNumCols()</tt></td><td align="left" valign="top">
    59       CbcModel:: version available and identical
    60       </td></tr></tbody></table></div><p>
    61   The remainder of this chapter will show  more of the basic CBC tasks a user
    62   might wish to perform.
    63   </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
    64   First Example
    65    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Some Useful Set and Get Methods</td></tr></table></div></body></html>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>
     3The Relationship Between OSI and CBC
     4</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch02.html" title="Chapter 2. &#10;   The CBC Model Class&#10;  "/><link rel="previous" href="ch02s02.html" title="&#10;  Simple Branch-and-Bound Example&#10;  "/><link rel="next" href="ch02s04.html" title="&#10;  Getting Solution Information&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
     5The Relationship Between OSI and CBC
     6</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
     7   The CBC Model Class
     8  </th><td width="20%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="osiAndCbc"/>
     9The Relationship Between OSI and CBC
     10</h2></div></div><div/></div><p>
     11The program in <a href="ch02s02.html#minimum.cpp" title="Example 2.1. minimum.cpp">Example 2.1</a> illustrates the dependency of CBC on 
     12  the <tt class="classname">OsiSolverInterface</tt> class. The constructor of <tt class="classname">CbcModel</tt> takes a pointer to an <tt class="classname">OsiSolverInterface</tt> (i.e., a solver). The <tt class="classname">CbcModel</tt> clones the solver, and uses its own instance of the solver. The <tt class="classname">CbcModel</tt>'s solver and the original solver (e.g., <tt class="varname">solver1</tt>) are not in sync unless the user synchronizes them. The user can always access the <tt class="classname">CbcModel</tt>'s solver through the <tt class="function">model()</tt> class.  To synchronize the two solvers, explicitly refreshing the original, e.g., 
     13 </p><pre class="programlisting">
     14  solver1 = model.solver();
     15</pre><p>
     16<tt class="classname">CbcModel</tt>'s method <tt class="function">solver()</tt> returns a pointer to CBC's cloned solver.
     17</p><p>
     18For convenience, many of the OSI methods to access problem data have identical method names in  <tt class="classname">CbcModel</tt>. (It's just more convenient to type <tt class="function">model.getNumCols()</tt> rather than <tt class="function">model.solver()-&gt;getNumCols()</tt>). The <tt class="classname">CbcModel</tt> refreshes its solver at certain logical points during the algorithm. At these points, the information from the <tt class="classname">CbcModel</tt> <tt class="varname">model</tt> will match the information from the <tt class="function">model.solver()</tt>. Elsewhere, the information may vary. For instance, the method <tt class="function">CbcModel::bestSolution()</tt> will contain the best solution so far, the OSI method <tt class="function">getColSolution()</tt> may not. In this case, it is safer to use <tt class="function">CbcModel::bestSolution()</tt>.
     19</p><p>
     20While all the OSI methods used in <tt class="filename">minimum.cpp</tt> have equivalent methods in <tt class="classname">CbcModel</tt>, there are some OSI methods which do not. For example, if  the program produced a lot of undesired output, one might add the line
     21</p><pre class="programlisting">
     22  model.solver()-&gt;setHintParam(OsiDoReducePrint,true,OsiHintTry);
     23</pre><p>
     24 
     25  to reduce the output. There is no <tt class="function">setHintParam()</tt> method in <tt class="classname">CbcModel</tt>.
     26  </p></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
     27  Simple Branch-and-Bound Example
     28   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
     29  Getting Solution Information
     30  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch02s04.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Some Useful Set and Get Methods</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch02.html" title="Chapter 2. 
    2   Basic Model Classes
    3   "><link rel="previous" href="ch02s03.html" title="
    4   Getting at the Solution (CbcModel methods)
    5   "><link rel="next" href="ch02s05.html" title="
    6   Methods which have a major impact on solution process
    7   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Some Useful Set and Get Methods</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
    8   Basic Model Classes
    9   </th><td width="20%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="setsandgets"></a>Some Useful Set and Get Methods</h2></div></div><div></div></div><div class="table"><a name="id2898616"></a><p class="title"><b>Table 2.4. Some Useful Set and Get Methods</b></p><table summary="Some Useful Set and Get Methods" border="0"><colgroup><col><col></colgroup><thead><tr><th>
    10     Method(s)
    11     </th><th>
    12     Description
    13     </th></tr></thead><tbody><tr><td align="left" valign="top"><tt class="function">setMaximumNodes(int value)</tt><br><tt class="function">int maximumNodes()</tt><br><tt class="function">setMaximumSeconds(double value)</tt><br><tt class="function">double maximumSeconds()</tt><tt class="function">setMaximumSolutions(double value)</tt><br><tt class="function">double maximumSolutions()</tt></td><td align="left" valign="top">
    14       These methods tell CBC to stop after a given number of nodes or
    15       seconds or solutions (and returns these values).
    16       </td></tr><tr><td align="left" valign="top"><tt class="function">setIntegerTolerance(double)</tt><br><tt class="function">double getIntegerTolerance()</tt></td><td align="left" valign="top">
    17       An integer variable
    18       is deemed to be at an integral value if it is no further than this tolerance
    19       away.
    20       </td></tr><tr><td align="left" valign="top"><tt class="function">setAllowableGap(double)</tt><br><tt class="function">double getAllowableGap()</tt><br><tt class="function">setAllowablePercentageGap(double)</tt><br><tt class="function">double getAllowablePercentageGap()</tt><br><tt class="function">setAllowableFractionGap(double)</tt><br><tt class="function">double getAllowableFractionGap()</tt><br></td><td align="left" valign="top">
    21       CbcModel returns if the gap between the best known solution and the best
    22       possible solution is less than this (or as a percentage or fraction).
    23       </td></tr><tr><td align="left" valign="top"><tt class="function">setNumberStrong(double) </tt><br><tt class="function">int numberStrong() </tt></td><td align="left" valign="top">
    24       Get or set the maximum number of candidates at a node to
    25       be evaluated for strong branching.
    26       </td></tr><tr><td align="left" valign="top"><tt class="function">setPrintFrequency(int) </tt><br><tt class="function">int printFrequency()</tt></td><td align="left" valign="top">
    27       Controls the number of nodes evaluated between status prints.
    28       Print frequency has very slight overhead if small.
    29       </td></tr><tr><td align="left" valign="top"><tt class="function">int getNodeCount() </tt></td><td align="left" valign="top">
    30       Returns number of nodes search took
    31       </td></tr><tr><td align="left" valign="top"><tt class="function">int numberRowsAtContinuous()</tt></td><td align="left" valign="top">
    32       Returns number of rows at continuous
    33       </td></tr><tr><td align="left" valign="top"><tt class="function">int  numberIntegers()</tt><br><tt class="function">const int * integerVariable()</tt></td><td align="left" valign="top">
    34       Returns number of integers and an array giving which ones
    35       </td></tr><tr><td align="left" valign="top"><tt class="function">bool  isBinary(int)</tt><br><tt class="function">bool  isContinuous(int)</tt><br><tt class="function">const bool isInteger(int)</tt></td><td align="left" valign="top">
    36       Returns information on a variable.  You can use Osi methods
    37       to set these attributes (before handing to CbcModel)
    38       </td></tr><tr><td align="left" valign="top"><tt class="function">double getObjValue()</tt></td><td align="left" valign="top">
    39       This method returns the best objective value.so far
    40       </td></tr><tr><td align="left" valign="top"><tt class="function">double getCurrentObjValue()</tt></td><td align="left" valign="top">
    41       This method returns the current objective value.
    42       </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getObjCoefficients()</tt><br><tt class="function">double * objective()</tt></td><td align="left" valign="top">
    43       These methods return the objective coefficients.
    44       </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getRowLower()</tt><br><tt class="function">double * rowLower()</tt><br><tt class="function">const double * getRowUpper()</tt><br><tt class="function">double * rowUpper()</tt><br><tt class="function">const double * getColLower()</tt><br><tt class="function">double * columnLower()</tt><br><tt class="function">const double * getColUpper()</tt><br><tt class="function">double * columnUpper()</tt></td><td align="left" valign="top">
    45       These methods give lower and upper bounds on row and column activities.
    46       </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackMatrix * getMatrixByRow()</tt></td><td align="left" valign="top">
    47       This method returns a pointer to a row copy of matrix
    48       <tt class="classname">CoinPackedMatrix</tt> which can be further examined.
    49       </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackMatrix * getMatrixByCol()</tt></td><td align="left" valign="top">
    50       This method returns a pointer to a column copy of matrix
    51       <tt class="classname">CoinPackedMatrix</tt> which can be further examined.
    52       </td></tr><tr><td align="left" valign="top"><tt class="function">CoinBigIndex getNumElements()</tt><sup>[<a name="id2899440" href="#ftn.id2899440">a</a>]</sup></td><td align="left" valign="top">
    53       Returns the number of elements in the problem matrix.
    54       </td></tr><tr><td align="left" valign="top"><tt class="function">void setObjSense(double value)</tt><br><tt class="function">double objSense()</tt></td><td align="left" valign="top">
    55       These methods set and get the objective sense.  The parameter
    56       <i class="parameter"><tt>value</tt></i> should be +1 to minimize and -1 to maximize.
    57       </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a name="ftn.id2899440" href="#id2899440">a</a>] </sup>
    58         <span class="type">CoinBigIndex</span> is a <tt class="function">typedef</tt> which in
    59         most cases is the same as <span class="type">int</span>.
    60         </p></div></td></tr></tbody></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
    61   Getting at the Solution (CbcModel methods)
    62    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
    63   Methods which have a major impact on solution process
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>
     3  Getting Solution Information
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch02.html" title="Chapter 2. &#10;   The CBC Model Class&#10;  "/><link rel="previous" href="ch02s03.html" title="&#10;The Relationship Between OSI and CBC&#10;"/><link rel="next" href="ch02s05.html" title="&#10;   Useful Set and Get Methods in CbcModel&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
     5  Getting Solution Information
     6  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
     7   The CBC Model Class
     8  </th><td width="20%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="gettingsolution"/>
     9  Getting Solution Information
     10  </h2></div></div><div/></div><p>
     11  Optimality can be checked through a call to <tt class="function">model.isProvenOptimal()</tt>.  Also
     12  available are <tt class="function">isProvenInfeasible()</tt>,
     13  <tt class="function">isSolutionLimitReached()</tt>,
     14  <tt class="function">isNodeLimitReached()</tt> or the feared
     15  <tt class="function">isAbandoned()</tt>. There is also
     16  <tt class="function">int status()</tt> which returns 0 if finished (which includes the case when the algorithm is finished because it has been proved infeasible), 1 if stopped by user, and 2 if difficulties arose.
     17  </p><p>
     18  In addition to these <tt class="classname">CbcModel</tt> methods, solution values can be accessed via OSI methods.  The OSI methods pick up the current solution in the <tt class="classname">CBCModel</tt>.  The current solution will match the best solution found so far if called after <tt class="function">branchAndBound()</tt> and a solution was found.
     19  </p><div class="table"><a id="id3238631"/><p class="title"><b>Table 2.1. 
     20  Methods for Getting Solution Information from OSI
     21  </b></p><table summary="&#10;  Methods for Getting Solution Information from OSI &#10;  " border="0"><colgroup><col/><col/></colgroup><thead><tr><th>
     22      Purpose
     23      </th><th>
     24      Name
     25      </th><th>
     26      Notes
     27      </th></tr></thead><tbody><tr><td align="left" valign="top">
     28      Primal column solution
     29      </td><td align="left" valign="top"><tt class="function">const double * getColSolution()</tt></td><td align="left" valign="top">
     30      The OSI method will return the best solution found thus far, unless none has been found. It is safer to use <tt class="classname">CbcModel</tt> version, <tt class="function">CbcModel::bestSolution()</tt></td></tr><tr><td align="left" valign="top">
     31      Dual row solution
     32      </td><td align="left" valign="top"><tt class="function">const double * getRowPrice()</tt></td><td align="left" valign="top">
     33      Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getRowPrice()</tt>.
     34      </td></tr><tr><td align="left" valign="top">
     35      Primal row solution
     36      </td><td align="left" valign="top"><tt class="function">const double * getRowActivity()</tt></td><td align="left" valign="top">
     37      Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getRowActivity()</tt>.
     38      </td></tr><tr><td align="left" valign="top">
     39      Dual column solution
     40      </td><td align="left" valign="top"><tt class="function">const double * getReducedCost()</tt></td><td align="left" valign="top">
     41      Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::gtReducedCost()</tt>.
     42      </td></tr><tr><td align="left" valign="top">
     43      Number of rows in model
     44      </td><td align="left" valign="top"><tt class="function">int getNumRows()</tt></td><td align="left" valign="top">
     45      Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getNumRows()</tt>. Note: the number of rows can change due to cuts.
     46      </td></tr><tr><td align="left" valign="top">
     47      Number of columns in model
     48      </td><td align="left" valign="top"><tt class="function">int getNumCols()</tt></td><td align="left" valign="top">
     49      Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getNumCols()</tt>.
     50      </td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
     51The Relationship Between OSI and CBC
     52 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
     53   Useful Set and Get Methods in CbcModel
    6454  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch02s05.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
    2   Methods which have a major impact on solution process
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch02.html" title="Chapter 2. 
    4   Basic Model Classes
    5   "><link rel="previous" href="ch02s04.html" title="Some Useful Set and Get Methods"><link rel="next" href="ch03.html" title="Chapter 3. 
    6   Other Classes and examples
    7   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
    8   Methods which have a major impact on solution process
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>
     3   Useful Set and Get Methods in CbcModel
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch02.html" title="Chapter 2. &#10;   The CBC Model Class&#10;  "/><link rel="previous" href="ch02s04.html" title="&#10;  Getting Solution Information&#10;  "/><link rel="next" href="ch02s06.html" title="&#10;  Impacting the Solution Process&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
     5   Useful Set and Get Methods in CbcModel
    96  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
    10   Basic Model Classes
    11   </th><td width="20%" align="right"> <a accesskey="n" href="ch03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="majormethods"></a>
    12   Methods which have a major impact on solution process
    13   </h2></div></div><div></div></div><p>
    14   These are important methods which will impact search e.g. adding a cut
    15   generator.  The description here may not give all parameters if they are exotic.
    16   You will also find more on some of them under the description
    17   of that class:
    18   </p><div class="table"><a name="id2899565"></a><p class="title"><b>Table 2.5. Major methods</b></p><table summary="Major methods" border="0"><colgroup><col><col></colgroup><thead><tr><th>
     7   The CBC Model Class
     8  </th><td width="20%" align="right"> <a accesskey="n" href="ch02s06.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="setsandgets"/>
     9   Useful Set and Get Methods in <tt class="classname">CbcModel</tt>
     10  </h2></div></div><div/></div><p>
     11Most of the parameter setting in CBC is done through <tt class="classname">CbcModel</tt> methods. The most commonly used set and get methods are listed in <a href="ch02s05.html#setGet" title="Table 2.2. Useful Set and Get Methods in CbcModel">Table 2.2</a>.
     12</p><div class="table"><a id="setGet"/><p class="title"><b>Table 2.2. Useful Set and Get Methods in <tt class="classname">CbcModel</tt></b></p><table summary="Useful Set and Get Methods in CbcModel" border="0"><colgroup><col/><col/></colgroup><thead><tr><th>
    1913    Method(s)
    2014    </th><th>
    2115    Description
    22     </th></tr></thead><tbody><tr><td align="left" valign="top"><tt class="function">passInPriorities(const int * priorities, bool ifNotSimpleIntegers,
    23                         int defaultValue=1000)</tt></td><td align="left" valign="top">
    24       Normally this is a list of priorities (1 being highest) and the other
    25       ifNotSimpleIntegers being false which set priorities for all integer
    26       variables.  If two variables are unsatisfied and one has a higher priority
    27       then it is always preferred whatever its value.  This can be very powerful
    28       but also see PseudoCosts in CbcObject discussion.
    29       </td></tr><tr><td align="left" valign="top"><tt class="function">addCutGenerator(CglCutGenerator *,int howOften, const char * name)</tt></td><td align="left" valign="top">
    30       This is used to add a cut generator to CbcModel.  Any cut generator in Cgl
    31       can be used.  If howOften &gt;0 then the cut generator will be called at root
    32       node and every howOften nodes (There is an option to override and do at
    33       depth 0,k,2k..).  If -1 then the code sees how effective it was at root
    34       node and sets howOften dynamically.  If -99 then just does at root node.
    35       There is also a redundant -100 setting which switches off which can be useful
    36       for testing.  For usage see sample2.cpp in the CBC Samples
    37       directory<a href="ch05.html" title="Chapter 5. 
    38 More Samples
    39 ">Chapter 5, <i>
    40 More Samples
    41 </i></a> which uses the most common
    42       cut generators.
    43       </td></tr><tr><td align="left" valign="top"><tt class="function">addHeuristic(CbcHeuristic *)</tt></td><td align="left" valign="top">
    44       This adds one heuristic to CbcModel.See the section on CbcHeuristic to obtain
    45       a list of available heuristics and a guide as to building new ones.
    46       </td></tr><tr><td align="left" valign="top"><tt class="function">addObjects(int number,CbcObject ** objects) </tt></td><td align="left" valign="top">
    47       This adds members of the base class CbcObject to CbcModel.  See the section
    48       on CbcObject for detailed nformation.  The objects are cloned by code so
    49       user should delete after <tt class="function">addObjects</tt>.  There are two
    50       main cases.  The first is when the originally created objects are left and
    51       new ones added (maybe with a higher priority);  this might be used when
    52       simple integer objects exist and Special Ordered Sets of type 1 are going
    53       to be added, which while not necessary will give extra power in branching.
    54       The second case is when the old ones are being deleted. 
    55       For usage see sos.cpp in the CBC Samples
    56       directory<a href="ch05.html" title="Chapter 5. 
    57 More Samples
    58 ">Chapter 5, <i>
    59 More Samples
    60 </i></a>.
    61       </td></tr><tr><td align="left" valign="top"><tt class="function">CglPreProcess::preProcess(OsiSolverInterface &amp;)</tt></td><td align="left" valign="top">
    62       This is not really part of Cbc and can be used by other mixed integer
    63       solvers but it can be a useful tool.  It tries to fix variables and
    64       strengthen coefficients and also do a normal presolve.  Owing to the
    65       odd nature of integer programming it may not always reduce the time
    66       taken but is definitely worth trying.  For an example of using
    67       preProcess and postProcess see sample2.cpp in the CBC Samples
    68       directory<a href="ch05.html" title="Chapter 5. 
    69 More Samples
    70 ">Chapter 5, <i>
    71 More Samples
    72 </i></a>.
    73       </td></tr><tr><td align="left" valign="top"><tt class="function">setNodeComparison(CbcCompareBase *)</tt></td><td align="left" valign="top">
    74        This is used to use a non-default node comparison function
    75        to see which is the next node on tree to explore.  This
    76        can make a large difference and specialized ones are easy to program.
    77        See the section on CbcCompare.
    78       </td></tr></tbody></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Some Useful Set and Get Methods </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. 
    79   Other Classes and examples
     16    </th></tr></thead><tbody><tr><td align="left" valign="top"><tt class="function">bool setMaximumNodes(int value)</tt><br/><tt class="function">int getMaximumNodes() const</tt><br/><tt class="function">bool setMaximumSeconds(double value)</tt><br/><tt class="function">double getMaximumSeconds()</tt><br/><tt class="function">bool setMaximumSolutions(double value)</tt><br/><tt class="function">double getMaximumSolutions() const</tt></td><td align="left" valign="top">
     17      These set methods tell CBC to stop after a given number of nodes,
     18      seconds, or solutions is reached. The get methods return the corresponding values.
     19      </td></tr><tr><td align="left" valign="top"><tt class="function">bool setIntegerTolerance(double value) const</tt><br/><tt class="function">double getIntegerTolerance() const</tt></td><td align="left" valign="top">
     20      An integer variable is deemed to be at an integral value if it is no further than this <i class="parameter"><tt>value</tt></i> (tolerance) away.
     21      </td></tr><tr><td align="left" valign="top"><tt class="function">bool setAllowableGap(double value)</tt><br/><tt class="function">double getAllowableGap() const</tt><br/><tt class="function">bool setAllowablePercentageGap(double value)</tt><br/><tt class="function">double getAllowablePercentageGap() const</tt><br/><tt class="function">bool setAllowableFractionGap(double value)</tt><br/><tt class="function">double getAllowableFractionGap() const</tt><br/></td><td align="left" valign="top"><tt class="classname">CbcModel</tt> returns if the gap between the best known solution and the best
     22      possible solution is less than this <i class="parameter"><tt>value</tt></i>, or as a percentage, or a fraction.
     23      </td></tr><tr><td align="left" valign="top"><tt class="function">void setNumberStrong(double value) </tt><br/><tt class="function">int numberStrong()
     24<sup>[<a id="id3239366" href="#ftn.id3239366">a</a>]</sup> const </tt></td><td align="left" valign="top">
     25      These methods set or get the maximum number of candidates at a node to
     26      be evaluated for strong branching.
     27      </td></tr><tr><td align="left" valign="top"><tt class="function">void setPrintFrequency(int value) </tt><br/><tt class="function">int printFrequency() const</tt></td><td align="left" valign="top">
     28      Controls the number of nodes evaluated between status prints.
     29      Print frequency has a very slight overhead, if <i class="parameter"><tt>value</tt></i> is small.
     30      </td></tr><tr><td align="left" valign="top"><tt class="function">int getNodeCount() const</tt></td><td align="left" valign="top">
     31      Returns number of nodes evaluated in the search.
     32      </td></tr><tr><td align="left" valign="top"><tt class="function">int numberRowsAtContinuous() const</tt></td><td align="left" valign="top">
     33      Returns number of rows in the problem when handed to the solver (i.e., before cuts where added). Commonly used in implementing heuristics.
     34      </td></tr><tr><td align="left" valign="top"><tt class="function">int  numberIntegers() const</tt><br/><tt class="function">const int * integerVariable() const</tt></td><td align="left" valign="top">
     35      Returns number of integer variables and an array specifying them.
     36      </td></tr><tr><td align="left" valign="top"><tt class="function">bool isBinary(int colIndex) const</tt><br/><tt class="function">bool isContinuous(int colIndex) const</tt><br/><tt class="function">bool isInteger(int colIndex) const</tt></td><td align="left" valign="top">
     37      Returns information on variable <i class="parameter"><tt>colIndex</tt></i>. OSI methods
     38      can be used to set these attributes (before handing the model to <tt class="classname">CbcModel</tt>).
     39      </td></tr><tr><td align="left" valign="top"><tt class="function">double getObjValue() const</tt></td><td align="left" valign="top">
     40      This method returns the best objective value so far.
     41      </td></tr><tr><td align="left" valign="top"><tt class="function">double getCurrentObjValue() const</tt></td><td align="left" valign="top">
     42      This method returns the current objective value.
     43      </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getObjCoefficients() const</tt><br/></td><td align="left" valign="top">
     44      This method return the objective coefficients.
     45      </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getRowLower() const</tt><br/><tt class="function">const double * getRowUpper() const</tt><br/><tt class="function">const double * getColLower() const</tt><br/><tt class="function">const double * getColUpper() const</tt><br/></td><td align="left" valign="top">
     46      These methods return the lower and upper bounds on row and column activities.
     47      </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackedMatrix * getMatrixByRow() const</tt></td><td align="left" valign="top">
     48      This method returns a pointer to a row copy of matrix stored as a
     49      <tt class="classname">CoinPackedMatrix</tt> which can be further examined.
     50      </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackedMatrix * getMatrixByCol() const</tt></td><td align="left" valign="top">
     51      This method returns a pointer to a column copy of matrix stored as a
     52      <tt class="classname">CoinPackedMatrix</tt> which can be further examined.
     53      </td></tr><tr><td align="left" valign="top"><tt class="function">CoinBigIndex getNumElements() const</tt><sup>[<a id="id3239920" href="#ftn.id3239920">b</a>]</sup></td><td align="left" valign="top">
     54      Returns the number of nonzero elements in the problem matrix.
     55      </td></tr><tr><td align="left" valign="top"><tt class="function">void setObjSense(double value)</tt><br/><tt class="function">double getObjSense() const</tt></td><td align="left" valign="top">
     56      These methods set and get the objective sense.  The parameter
     57      <i class="parameter"><tt>value</tt></i> should be +1 to minimize and -1 to maximize.
     58      </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a id="ftn.id3239366" href="#id3239366">a</a>] </sup>
     59This methods (and some of the other) do not follow the "get" convention. The convention has changed over time and there are still some inconsistencies to be cleaned up.
     60</p></div><div class="footnote"><p><sup>[<a id="ftn.id3239920" href="#id3239920">b</a>] </sup>
     61        <span class="type">CoinBigIndex</span> is a <tt class="function">typedef</tt> which in
     62        most cases is the same as <span class="type">int</span>.
     63        </p></div></td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
     64  Getting Solution Information
     65   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 
     66  Impacting the Solution Process
    8067  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch03.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 3. 
    2   Other Classes and examples
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="ch02s05.html" title="
    4   Methods which have a major impact on solution process
    5   "><link rel="next" href="ch03s02.html" title="CbcHeuristic - heuristic methods"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. 
    6   Other Classes and examples
    7   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="otherclasses"></a>Chapter 3. 
    8   Other Classes and examples
    9   </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch03.html#comparison">CbcCompare - Comparison methods</a></dt><dt><a href="ch03s02.html">CbcHeuristic - heuristic methods</a></dt><dt><a href="ch03s03.html">Branching</a></dt><dt><a href="ch03s04.html">Advanced use of solver</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="comparison"></a>CbcCompare - Comparison methods</h2></div></div><div></div></div><p>
    10   Although the unexplored nodes of the search are organized in a tree, the
    11   order of solution is not predetermined and can be influenced by the user.
    12   Cbc provides a abstract base class CbcCompareBase
    13   and then instances of each.  It is relatively simple for an advanced user to
    14   create new instances and an explanation of an example will be given later.
    15   </p><div class="table"><a name="id2901322"></a><p class="title"><b>Table 3.1. Compare Classes provided</b></p><table summary="Compare Classes provided" border="0"><colgroup><col><col></colgroup><thead><tr><th>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 3. 
     3  Selecting the Next Node in the Search Tree
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch02s06.html" title="&#10;  Impacting the Solution Process&#10;  "/><link rel="next" href="ch04.html" title="Chapter 4. &#10;  Getting Good Bounds in CBC&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. 
     5  Selecting the Next Node in the Search Tree
     6  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s06.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="otherclasses"/>Chapter 3. 
     7  Selecting the Next Node in the Search Tree
     8  </h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch03.html#comparison">CbcCompare - Comparison Methods</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="comparison"/>CbcCompare - Comparison Methods</h2></div></div><div/></div><p>
     9  The order in which the nodes of the search tree are explored can strongly influence the performance of branch-and-cut algorithms. CBC give users complete control over the search order, including the ability to dynamically change the node selection logic as the search progresses. The search order is controlled via the <tt class="classname">CbcCompare...</tt> class, and its method <tt class="function">test()</tt>. Dynamic changes can be made whenever
     10</p><div class="itemizedlist"><ul type="disc"><li>a new solution is found -- by customizing the method <tt class="function">newSolution()</tt>, or </li><li>every 1000 nodes -- by customizing the method <tt class="function">every1000Nodes()</tt>. </li></ul></div><p>
     11CBC provides an abstract base class, <tt class="classname">CbcCompareBase</tt>, and implementations of several commonly used node selection strategies as Compare Classes, see <a href="ch03.html#compareTable" title="Table 3.1. Compare Classes Provided">Table 3.1</a>.
     12  </p><div class="table"><a id="compareTable"/><p class="title"><b>Table 3.1. Compare Classes Provided</b></p><table summary="Compare Classes Provided" border="0"><colgroup><col/><col/></colgroup><thead><tr><th>
    1613    Class name
    1714    </th><th>
    1815    Description
    19     </th></tr></thead><tbody><tr><td align="left" valign="top">
    20       CbcCompareDepth
    21       </td><td align="left" valign="top">
     16    </th></tr></thead><tbody><tr><td align="left" valign="top"><tt class="classname">CbcCompareDepth</tt></td><td align="left" valign="top">
    2217      This will always choose the node deepest in tree.  It gives minimum
    23       tree size but may take a long time to find best solution.
    24       </td></tr><tr><td align="left" valign="top">
    25       CbcCompareObjective
    26       </td><td align="left" valign="top">
     18      tree size but may take a long time to find the best solution.
     19      </td></tr><tr><td align="left" valign="top"><tt class="classname">CbcCompareObjective</tt></td><td align="left" valign="top">
    2720      This will always choose the node with the best objective value.  This may
    2821      give a very large tree.  It is likely that the first solution found
    2922      will be the best and the search should finish soon after the first solution
    3023      is found.
    31       </td></tr><tr><td align="left" valign="top">
    32       CbcCompareDefault
    33       </td><td align="left" valign="top">
    34       This is designed to do a mostly depth first search until a solution has
    35       been found and then use estimates designed to give a slightly better solution.
    36       If a reasonable number of nodes have been done or a reasonable number of
    37       solutions found then it will go breadth first (i.e. on objective) unless
    38       the tree is very large when it will revert to depth first.  Probably
    39       CbcCompareUser described below is better.
    40       </td></tr><tr><td align="left" valign="top">
    41       CbcCompareEstimate
    42       </td><td align="left" valign="top">
    43       If pseudocosts are being used then they can be used to guess a solution.
    44       This just uses guessed solution.
     24      </td></tr><tr><td align="left" valign="top"><tt class="classname">CbcCompareDefault</tt></td><td align="left" valign="top">
     25      This is designed to do a mostly depth-first search until a solution has
     26      been found. It then use estimates that are designed to give a slightly better solution.
     27      If a reasonable number of nodes have been explored (or a reasonable number of
     28      solutions found), then this class will adopt a breadth-first search (i.e., making a comparison based strictly on objective function values) unless the tree is very large, in which case it will revert to depth-first search. A better description of <tt class="classname">CbcCompareUser</tt> is given below.
     29      </td></tr><tr><td align="left" valign="top"><tt class="classname">CbcCompareEstimate</tt></td><td align="left" valign="top">
     30      When pseudo costs are invoked, CBC uses the psuedo costs to guess a solution.  This class uses the guessed solution.
    4531      </td></tr></tbody></table></div><p>
    46   This describes how to build a new comparison class and the reasoning
    47   behind it. This is <tt class="filename">CbcCompareUser.hpp</tt> and
    48    <tt class="filename">CbcCompareUser.cpp</tt>
    49   (this code can be found in the CBC Samples directory, see
    50   <a href="ch05.html" title="Chapter 5. 
    51 More Samples
    52 ">Chapter 5, <i>
    53 More Samples
    54 </i></a>).
    55   The key CbcCompare method is test which returns true if node y is better
    56   than node x.  In this method the user can easily use
    57   </p><div class="table"><a name="id2902562"></a><p class="title"><b>Table 3.2. Information available from CbcModel</b></p><table summary="Information available from CbcModel" border="0"><colgroup><col><col></colgroup><tbody><tr><td align="left" valign="top">
    58       objectiveValue()
    59       </td><td align="left" valign="top">
    60       Value of objective at that node.
    61       </td></tr><tr><td align="left" valign="top">
    62       numberUnsatisfied()
    63       </td><td align="left" valign="top">
     32  It is relatively simple for a user to create a customized node selection by creating a new compare class instances. The code in <a href="ch03.html#test" title="Example 3.1. CbcCompareUser::test()">Example 3.1</a> describes how to build a new comparison class and the reasoning behind it. The complete source can be found in <tt class="filename">CbcCompareUser.hpp</tt> and <tt class="filename">CbcCompareUser.cpp</tt>, located in the CBC Samples directory. Besides the constructor, the only method the user -must- implement in <tt class="classname">CbcCompare</tt> is <tt class="function">bool test(CbcNode* x, CbcNode* y))</tt> which returns <i class="parameter"><tt>true</tt></i> if node <i class="parameter"><tt>y</tt></i> is preferred over node <i class="parameter"><tt>x</tt></i>. In the <tt class="function">test()</tt> method, information from <tt class="classname">CbcNode</tt> can easily be used. <a href="ch03.html#nodeTable" title="Table 3.2. Information Available from CbcNode">Table 3.2</a> lists some commonly used methods to access information at a node.
     33  </p><div class="table"><a id="nodeTable"/><p class="title"><b>Table 3.2. Information Available from <tt class="classname">CbcNode</tt></b></p><table summary="Information Available from CbcNode" border="0"><colgroup><col/><col/></colgroup><tbody><tr><td align="left" valign="top"><tt class="function">double objectiveValue() const</tt></td><td align="left" valign="top">
     34      Value of objective at the node.
     35      </td></tr><tr><td align="left" valign="top"><tt class="function">int numberUnsatisfied() const</tt></td><td align="left" valign="top">
    6436      Number of unsatisfied integers (assuming branching
    65       object is an integer - otherwise might be number of unsatsified sets)
    66       </td></tr><tr><td align="left" valign="top">
    67       depth()
    68       </td><td align="left" valign="top">
    69        depth in tree of node
    70       </td></tr><tr><td align="left" valign="top">
    71       guessedObjectiveValue()
    72       </td><td align="left" valign="top"> </td></tr><tr><td align="left" valign="top">
    73       way()   
    74       </td><td align="left" valign="top">
    75        which way would be next from this node
    76        (for more advanced use)
    77       </td></tr><tr><td align="left" valign="top">
    78       variable()
    79       </td><td align="left" valign="top">
    80        which "variable" would be branched on.
    81        (for more advanced use)
     37      object is an integer - otherwise it might be number of unsatisfied sets).
     38      </td></tr><tr><td align="left" valign="top"><tt class="function">int depth() const</tt></td><td align="left" valign="top">
     39       Depth of the node in the search tree.
     40      </td></tr><tr><td align="left" valign="top"><tt class="function">double guessedObjectiveValue() const</tt></td><td align="left" valign="top">
     41     If user was setting this (e.g., if using pseudo costs).
     42      </td></tr><tr><td align="left" valign="top"><tt class="function">int way() const</tt></td><td align="left" valign="top">
     43       The way which branching would next occur from this node
     44       (for more advanced use).
     45      </td></tr><tr><td align="left" valign="top"><tt class="function">int variable() const</tt></td><td align="left" valign="top">
     46       The branching "variable" (associated with the <tt class="classname">CbcBranchingObject</tt> -- for more advanced use).
    8247      </td></tr></tbody></table></div><p>
    83   </p><p>
    84   There is no information on the state of the tree.  If you wanted you could
    85   keep a pointer to the CbcModel but the way it is meant to work is that
    86   newSolution is called whenever a solution is found and every1000Nodes is
    87   called every 1000 nodes.  When these are called the user can modify the
    88   behavior of test.  Because the model is passed in the user can also do other things
    89   such as changing the maximum time of Branch and Cut once a solution has been found.
    90 
    91 So in CbcCompareUser in Samples
    92 the four items of data are:
    93 1) The number of solutions found so far
    94 2) The size of the tree (number of active nodes)
    95 3) A weight which is initialized to -1.0
    96 4) A saved value of weight (for when we set weight back to -1.0 for special reason)
    97 
    98 The full code for test is:
    99 </p><div class="example"><a name="id2902771"></a><p class="title"><b>Example 3.1. test</b></p><pre class="programlisting">
     48</p><p>
     49The node desired in the tree is often a function of the how the search is progressing. In the design of CBC, there is no information on the state of the tree. The CBC is designed so that the method
     50  <tt class="function">newSolution()</tt> is called whenever a solution is found and the method <tt class="function">every1000Nodes()</tt> is called every 1000 nodes.  When these methods are called, the user has the opportunity to modify the
     51  behavior of <tt class="function">test()</tt> by adjusting their common variables (e.g., <tt class="varname">weight_</tt>). Because <tt class="classname">CbcNode</tt> has a pointer to the model, the user can also influence the search through actions such as changing the maximum time CBC is allowed, once a solution has been found (e.g., <tt class="function">CbcModel::setMaximumSeconds(double value)</tt>). In <tt class="filename">CbcCompareUser.cpp</tt> of the <tt class="filename">COIN/Cbc/Samples</tt> directory,  four items of data are used.
     52</p><p>
     53</p><div class="itemizedlist"><ul type="disc"><li><p>
     541) The number of solutions found so far
     55  </p></li><li><p>
     562) The size of the tree (defined to be the number of active nodes)
     57  </p></li><li><p>
     583) A weight, <tt class="varname">weight_</tt>, which is initialized to -1.0
     59  </p></li><li><p>
     604) A saved value of weight, <tt class="varname">saveWeight_</tt> (for when weight is set back to -1.0 for special reason)
     61  </p></li></ul></div><p>
     62</p><p>
     63Initially, <tt class="varname">weight</tt>_ is -1.0 and the search is biased towards depth first.  In
     64fact, <tt class="function">test()</tt> prefers <i class="parameter"><tt>y</tt></i> if <i class="parameter"><tt>y</tt></i> has fewer unsatisfied variables. In the case of a tie, <tt class="function">test()</tt> prefers the node with the greater depth in tree. The full code for the <tt class="function">CbcCompareUser::test()</tt> method is given in <a href="ch03.html#test" title="Example 3.1. CbcCompareUser::test()">Example 3.1</a>.
     65</p><div class="example"><a id="test"/><p class="title"><b>Example 3.1. <tt class="function">CbcCompareUser::test()</tt></b></p><pre class="programlisting">
    10066   
    10167// Returns true if y better than x
     
    11278      return x-&gt;depth() &lt; y-&gt;depth();
    11379  } else {
    114     // after solution
     80    // after solution.
     81    // note: if weight_=0, comparison is based
     82    //       solely on objective value
    11583    double weight = CoinMax(weight_,0.0);
    11684    return x-&gt;objectiveValue()+ weight*x-&gt;numberUnsatisfied() &gt;
     
    12088     
    12189  </pre></div><p>
    122 So initially as weight is &lt; 0.0 we are biased towards depth first.  In
    123 fact it prefers y is y has fewer unsatisfied variables - if there is a tie
    124 then it prefers the one with greater depth in tree.
    125 
    126 Once we get a solution newSolution is called.  If it was a solution
    127 achieved by branching we work out how much it cost per unsatisfied integer
    128 variable to go from continuous solution to integer solution.  We then set
    129 the weight to aim at a slightly better solution.  From then on test
    130 returns true if it looks as if y will lead to a better solution than x.
    131 This is done by newSolution
    132 </p><div class="example"><a name="id2902794"></a><p class="title"><b>Example 3.2. newSolution</b></p><pre class="programlisting">
     90CBC calls the method <tt class="function">newSolution()</tt> after a new solution is found. The method <tt class="function">newSolution()</tt> interacts with <tt class="function">test()</tt> by means of the variable <tt class="varname">weight_</tt>. If the solution was achieved by branching,  a calculation is made to determine the cost per unsatisfied integer variable to go from the continuous solution to an integer solution.  The variable <tt class="varname">weight_</tt> is then set to aim at a slightly better solution.  From then on, <tt class="function">test()</tt> returns <i class="parameter"><tt>true</tt></i> if it seems that <i class="parameter"><tt>y</tt></i> will lead to a better solution than <i class="parameter"><tt>x</tt></i>. This source for <tt class="function">newSolution()</tt> in given in <a href="ch03.html#newSolution" title="Example 3.2. CbcCompareUser::newSolution()">Example 3.2</a>.
     91</p><div class="example"><a id="newSolution"/><p class="title"><b>Example 3.2. <tt class="function">CbcCompareUser::newSolution()</tt></b></p><pre class="programlisting">
    13392   
    134 // This allows method to change behavior as it is called
    135 // after each solution
     93// This allows the test() method to change behavior by resetting weight_.
     94// It is called after each new solution is found.
    13695void
    13796CbcCompareUser::newSolution(CbcModel * model,
     
    14099{
    141100  if (model-&gt;getSolutionCount()==model-&gt;getNumberHeuristicSolutions())
    142     return; // solution was got by rounding so we ignore
    143   // set to get close to this solution
     101    return; // The number of solutions found by any means equals the
     102            // number of solutions, so this solution was found by rounding.
     103            // Ignore it.
     104
     105  // set weight_ to get close to this solution
    144106  double costPerInteger =
    145107    (model-&gt;getObjValue()-objectiveAtContinuous)/
    146108    ((double) numberInfeasibilitiesAtContinuous);
    147   weight_ = 0.98*costPerInteger;
    148   saveWeight_=weight_;
     109  weight_ = 0.98*costPerInteger; // this aims for a solution
     110                                 // slightly better than known.
     111                                 // why 0.98? why not?! Experiment yourself.                                 
     112  saveWeight_=weight_; // We're going to switching between depth-first and breadth-first
     113                       // branching strategies, depending on what we find in the tree.
     114                       // When doing depth first, we'll want to retrieve this weight.
     115                       // So, let's save it.
    149116  numberSolutions_++;
    150117  if (numberSolutions_&gt;5)
    151     weight_ =0.0; // this searches on objective
     118    weight_ =0.0; // comparison in test() will be
     119                  // based strictly on objective value.
    152120}
    153121     
    154122  </pre></div><p>
    155123
    156 But as the search goes on this may be modified.
    157 
    158 If we have done a lot of nodes or got a lot of solutions then weight is
    159 set to 0.0 so we are doing breadth first search.  This can lead to an
    160 enormous tree so if the tree size is &gt;10000 then we go may go back to one biased
    161 towards depth first.  This is done by every1000Nodes.
    162   </p><div class="example"><a name="id2902874"></a><p class="title"><b>Example 3.3. newSolution</b></p><pre class="programlisting">
     124As the search progresses, the comparison can be modified. If many nodes (or many solutions) have been generated, then <tt class="varname">weight_</tt> is set to 0.0 leading to a breadth-first search.  Breadth-first search can lead to an enormous tree. If the tree size is exceeds 10000, it may be desirable to return to a search biased towards depth first. Changing the behavior in this manner is done by the method <tt class="function">every1000Nodes</tt> shown in <a href="ch03.html#everyK" title="Example 3.3. CbcCompareUser::every1000Nodes()">Example 3.3</a>.
     125  </p><div class="example"><a id="everyK"/><p class="title"><b>Example 3.3. <tt class="function">CbcCompareUser::every1000Nodes()</tt></b></p><pre class="programlisting">
    163126   
    164 // This allows method to change behavior
     127// This allows the test() method to change behavior every 1000 nodes.
    165128bool
    166129CbcCompareUser::every1000Nodes(CbcModel * model, int numberNodes)
    167130{
    168   if (numberNodes&gt;10000)
    169     weight_ =0.0; // this searches on objective
    170   else if (numberNodes==1000&amp;&amp;weight_==-2.0)
    171     weight_=-1.0; // Go to depth first
    172   // get size of tree
     131  if (numberNodes&gt;10000)
     132    weight_ =0.0; // compare nodes based on objective value
     133    // get size of tree
    173134  treeSize_ = model-&gt;tree()-&gt;size();
    174135  if (treeSize_&gt;10000) {
     
    176137    if (treeSize_&gt;20000)
    177138      weight_=-1.0;
    178     else if ((numberNodes%4000)!=0)
     139    else if ((numberNodes%4000)!=0)  // Flip-flop between the strategies.
     140                                     // Why 4000? Why not? Experiment yourself.
    179141      weight_=-1.0;
    180142    else
     
    184146}
    185147     
    186   </pre></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
    187   Methods which have a major impact on solution process
    188    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> CbcHeuristic - heuristic methods</td></tr></table></div></body></html>
     148  </pre></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
     149  Impacting the Solution Process
     150   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. 
     151  Getting Good Bounds in CBC
     152  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch03s02.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>CbcHeuristic - heuristic methods</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch03.html" title="Chapter 3. 
    2   Other Classes and examples
    3   "><link rel="previous" href="ch03.html" title="Chapter 3. 
    4   Other Classes and examples
    5   "><link rel="next" href="ch03s03.html" title="Branching"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CbcHeuristic - heuristic methods</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
    6   Other Classes and examples
    7   </th><td width="20%" align="right"> <a accesskey="n" href="ch03s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="heuristics"></a>CbcHeuristic - heuristic methods</h2></div></div><div></div></div><p>
    8   For practical use it is very useful to be able to get a good solution reasonably fast.
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CbcHeuristic - Heuristic Methods</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch03.html" title="Chapter 3. &#10;  Selecting a Node in the Search Tree&#10;  "/><link rel="previous" href="ch03.html" title="Chapter 3. &#10;  Selecting a Node in the Search Tree&#10;  "/><link rel="next" href="ch04.html" title="Chapter 4. &#10;  Branching&#10; "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CbcHeuristic - Heuristic Methods</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
     3  Selecting a Node in the Search Tree
     4  </th><td width="20%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="heuristics"/>CbcHeuristic - Heuristic Methods</h2></div></div><div/></div><p>
     5  In practice, it is very useful to get a good solution reasonably fast.
    96  A good bound will greatly reduce the run time and good solutions can satisfy the user
    10   on very large problems where a complete search is impossible.  Heuristics are obviously
    11   problem dependant although some have more general use.  I hope to increase the number.
    12   At present there is only one in Cbc itself although there are others in the Samples
    13   directory.  The heuristic is trying to obtain a solution to the original
    14   problem so it need only consider original rows and does not have to use the
     7  on very large problems where a complete search is impossible.  Obviously, heuristics are
     8  problem dependent although some have more general use.
     9  At present there is only one in CBC itself. Hopefully, the number of heuristics will grow.
     10  Other hueristics are in the <tt class="filename">COIN/Cbc/Samples</tt>
     11  directory.  A heuristic tries to obtain a solution to the original
     12  problem so it only needs to consider the original rows and does not have to use the
    1513  current bounds.
    1614  One to use a greedy heuristic designed for use in the miplib problem
    17   fast0507 will be developed later in this section.
    18   Cbc provides a abstract base class CbcHeuristic and a rounding heuristic in Cbc.
     15  fast0507 will be developed later in this section. 
     16  CBC provides an abstract base class <tt class="classname">CbcHeuristic</tt> and a rounding heuristic in CBC.
    1917  </p><p>
    2018  This describes how to build a greedy heuristic for a set covering problem.
    2119   A more general version is in <tt class="filename">CbcHeuristicGreedy.hpp</tt> and
    22    <tt class="filename">CbcHeuristicGreedy.cpp</tt>
    23   (this code can be found in the CBC Samples directory, see
    24   <a href="ch05.html" title="Chapter 5. 
     20   <tt class="filename">CbcHeuristicGreedy.cpp</tt> which can be found in the <tt class="filename">COIN/Cbc/Samples</tt> directory, see <a href="ch06.html" title="Chapter 6. &#10;More Samples&#10;">Chapter 6, <i>
    2521More Samples
    26 ">Chapter 5, <i>
    27 More Samples
    28 </i></a>).
     22</i></a>.
    2923
    3024  The heuristic we will code will leave all variables which are at one at this node of the
     
    4741  before any cuts have been made.  The data used are bounds, objective and the matrix
    4842  plus two work arrays.
    49   </p><div class="example"><a name="id2903012"></a><p class="title"><b>Example 3.4. Data</b></p><pre class="programlisting">
     43  </p><div class="example"><a id="id2984921"/><p class="title"><b>Example 3.4. Data</b></p><pre class="programlisting">
    5044   
    5145  OsiSolverInterface * solver = model_-&gt;solver(); // Get solver from CbcModel
     
    7367  </pre></div><p>
    7468Then we initialize newSolution as rounded down solution.
    75 </p><div class="example"><a name="id2903038"></a><p class="title"><b>Example 3.5. initialize newSolution</b></p><pre class="programlisting">
     69</p><div class="example"><a id="id2984946"/><p class="title"><b>Example 3.5. initialize newSolution</b></p><pre class="programlisting">
    7670   
    7771  for (iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     
    10195infeasibilities.  We then repeat.  This is a finite process and could be coded
    10296to be faster but this is simplest.
    103   </p><div class="example"><a name="id2903094"></a><p class="title"><b>Example 3.6. Create feasible new solution</b></p><pre class="programlisting">
     97  </p><div class="example"><a id="id2984998"/><p class="title"><b>Example 3.6. Create feasible new solution</b></p><pre class="programlisting">
    10498   
    10599  while (true) {
     
    149143We have finished so now we need to see if solution is better and doublecheck
    150144we are feasible.
    151   </p><div class="example"><a name="id2903189"></a><p class="title"><b>Example 3.7. Check good solution</b></p><pre class="programlisting">
     145  </p><div class="example"><a id="id2985096"/><p class="title"><b>Example 3.7. Check good solution</b></p><pre class="programlisting">
    152146   
    153147  returnCode=0; // 0 means no good solution
     
    183177  }
    184178     
    185   </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 3. 
    186   Other Classes and examples
    187    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Branching</td></tr></table></div></body></html>
     179  </pre></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 3. 
     180  Selecting a Node in the Search Tree
     181   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. 
     182  Branching
     183 </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch03s03.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Branching</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch03.html" title="Chapter 3. 
    2   Other Classes and examples
    3   "><link rel="previous" href="ch03s02.html" title="CbcHeuristic - heuristic methods"><link rel="next" href="ch03s04.html" title="Advanced use of solver"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Branching</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
    4   Other Classes and examples
    5   </th><td width="20%" align="right"> <a accesskey="n" href="ch03s04.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="branching"></a>Branching</h2></div></div><div></div></div><p>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Branching</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch03.html" title="Chapter 3. &#10;  Other Classes and Examples&#10;  "/><link rel="previous" href="ch03s02.html" title="CbcHeuristic - Heuristic Methods"/><link rel="next" href="ch03s04.html" title="Advanced use of solver"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Branching</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
     3  Other Classes and Examples
     4  </th><td width="20%" align="right"> <a accesskey="n" href="ch03s04.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="branching"/>Branching</h2></div></div><div/></div><p>
    65If the user declares variables as integer but does no more, then Cbc will treat them
    76as simple integer variables.  In many cases the user would like to do some more fine tuning.  This shows how to create integer variables with pseudo costs.  When pseudo costs are given then
     
    98   The full code is in <tt class="filename">longthin.cpp</tt>
    109  (this code can be found in the CBC Samples directory, see
    11   <a href="ch05.html" title="Chapter 5. 
    12 More Samples
    13 ">Chapter 5, <i>
     10  <a href="ch05.html" title="Chapter 5. &#10;More Samples&#10;">Chapter 5, <i>
    1411More Samples
    1512</i></a>). 
     
    1916  The expected cost of going up obviously depends on the cost of the
    2017  variable so we just choose pseudo costs to reflect that.
    21   </p><div class="example"><a name="id2903248"></a><p class="title"><b>Example 3.8. Pseudo costs</b></p><pre class="programlisting">
     18  </p><div class="example"><a id="id3369250"/><p class="title"><b>Example 3.8. Pseudo costs</b></p><pre class="programlisting">
    2219   
    2320  int iColumn;
     
    5956   The full code is in <tt class="filename">crew.cpp</tt>
    6057  (this code can be found in the CBC Samples directory, see
    61   <a href="ch05.html" title="Chapter 5. 
    62 More Samples
    63 ">Chapter 5, <i>
     58  <a href="ch05.html" title="Chapter 5. &#10;More Samples&#10;">Chapter 5, <i>
    6459More Samples
    6560</i></a>).  In this case we may as well leave the simple integer
     
    6762branch on the follow-on rules first so we use priorities to say that those are the
    6863important ones.
    69 </p><div class="example"><a name="id2903330"></a><p class="title"><b>Example 3.9. Follow-on branching</b></p><pre class="programlisting">
     64</p><div class="example"><a id="id3369354"/><p class="title"><b>Example 3.9. Follow-on branching</b></p><pre class="programlisting">
    7065   
    7166  int iColumn;
     
    10095  model.passInPriorities(&amp;followPriority,true);
    10196     
    102   </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CbcHeuristic - heuristic methods </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Advanced use of solver</td></tr></table></div></body></html>
     97  </pre></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">CbcHeuristic - Heuristic Methods </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Advanced use of solver</td></tr></table></div></body></html>
  • html/trunk/Cbc/ch03s04.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Advanced use of solver</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="ch03.html" title="Chapter 3. 
    2   Other Classes and examples
    3   "><link rel="previous" href="ch03s03.html" title="Branching"><link rel="next" href="ch04.html" title="Chapter 4. 
    4   Building and Modifying a Model
    5   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Advanced use of solver</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s03.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
    6   Other Classes and examples
    7   </th><td width="20%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="solver"></a>Advanced use of solver</h2></div></div><div></div></div><p>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Advanced use of solver</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch03.html" title="Chapter 3. &#10;  Other Classes and Examples&#10;  "/><link rel="previous" href="ch03s03.html" title="Branching"/><link rel="next" href="ch04.html" title="Chapter 4. &#10;  Building and Modifying a Model&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Advanced use of solver</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s03.html">Prev</a> </td><th width="60%" align="center">Chapter 3. 
     3  Other Classes and Examples
     4  </th><td width="20%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="solver"/>Advanced use of solver</h2></div></div><div/></div><p>
    85  Coin Branch and Cut uses a generic OsiSolverInterface and its <tt class="function">resolve</tt> capability.
    96  This does not give much flexibility so advanced users can inherit from the interface
     
    1411   <tt class="filename">CbcSolver2.cpp</tt>
    1512  (this code can be found in the CBC Samples directory, see
    16   <a href="ch05.html" title="Chapter 5. 
    17 More Samples
    18 ">Chapter 5, <i>
     13  <a href="ch05.html" title="Chapter 5. &#10;More Samples&#10;">Chapter 5, <i>
    1914More Samples
    2015</i></a>).
     
    2217  this is a simpler place to start.  The example derives from OsiClpSolverInterface and the code
    2318  is:
    24   </p><div class="example"><a name="id2903439"></a><p class="title"><b>Example 3.10. initialSolve</b></p><pre class="programlisting">
     19  </p><div class="example"><a id="id3369462"/><p class="title"><b>Example 3.10. initialSolve</b></p><pre class="programlisting">
    2520   
    2621  // modelPtr_ is of type ClpSimplex *
     
    4237a variable was active in a solution.  For the first few times normal dual is called and
    4338node_ array is updated.
    44 </p><div class="example"><a name="id2903488"></a><p class="title"><b>Example 3.11. First few solves</b></p><pre class="programlisting">
     39</p><div class="example"><a id="id3369511"/><p class="title"><b>Example 3.11. First few solves</b></p><pre class="programlisting">
    4540   
    4641  if (count_&lt;10) {
     
    6459solves.  As fast0507 is a set covering problem we can also take out any rows which are
    6560already covered.
    66   </p><div class="example"><a name="id2903514"></a><p class="title"><b>Example 3.12. Create small problem</b></p><pre class="programlisting">
     61  </p><div class="example"><a id="id3369538"/><p class="title"><b>Example 3.12. Create small problem</b></p><pre class="programlisting">
    6762   
    6863    int * whichRow = new int[numberRows]; // Array to say which rows used
     
    163158then we see if there are any negative reduced costs and if there are then we have to go to the
    164159full problem and use primal to clean up.
    165   </p><div class="example"><a name="id2903555"></a><p class="title"><b>Example 3.13. Check optimal solution</b></p><pre class="programlisting">
     160  </p><div class="example"><a id="id3369578"/><p class="title"><b>Example 3.13. Check optimal solution</b></p><pre class="programlisting">
    166161   
    167162    temp-&gt;setDualObjectiveLimit(1.0e50); // Switch off dual cutoff as problem is restricted
     
    219214   <tt class="filename">ClpQuadInterface.cpp</tt>
    220215  (this code can be found in the CBC Samples directory, see
    221   <a href="ch05.html" title="Chapter 5. 
    222 More Samples
    223 ">Chapter 5, <i>
     216  <a href="ch05.html" title="Chapter 5. &#10;More Samples&#10;">Chapter 5, <i>
    224217More Samples
    225218</i></a>).
    226   </p><div class="example"><a name="id2903598"></a><p class="title"><b>Example 3.14. Solve a quadratic mip</b></p><pre class="programlisting">
     219  </p><div class="example"><a id="id3369621"/><p class="title"><b>Example 3.14. Solve a quadratic mip</b></p><pre class="programlisting">
    227220   
    228221  // save cutoff
     
    247240  modelPtr_-&gt;setObjectivePointer(saveObjective);
    248241     
    249   </pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Branching </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. 
     242  </pre></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Branching </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. 
    250243  Building and Modifying a Model
    251244  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch04.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 4. 
    2   Building and Modifying a Model
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="ch03s04.html" title="Advanced use of solver"><link rel="next" href="ch05.html" title="Chapter 5. 
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 4. 
     3  Getting Good Bounds in CBC
     4  </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch03.html" title="Chapter 3. &#10;  Selecting the Next Node in the Search Tree&#10;  "/><link rel="next" href="ch05.html" title="Chapter 5. &#10;  Branching&#10; "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. 
     5  Getting Good Bounds in CBC
     6  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="hueristicChap"/>Chapter 4. 
     7  Getting Good Bounds in CBC
     8  </h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch04.html#heuristics">CbcHeuristic - Heuristic Methods</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="heuristics"/>CbcHeuristic - Heuristic Methods</h2></div></div><div/></div><p>
     9  In practice, it is very useful to get a good solution reasonably fast. Any MIP-feasible solution produces an upper bound, and a good bound will greatly reduce the run time. Good solutions can satisfy the user
     10  on very large problems where a complete search is impossible.  Obviously, heuristics are
     11  problem dependent, although some do have more general use.
     12  At present there is only one heuristic in CBC itself, <tt class="classname">CbcRounding</tt>. Hopefully, the number will grow. Other heuristics are in the <tt class="filename">COIN/Cbc/Samples</tt>
     13  directory.  A heuristic tries to obtain a solution to the original
     14  problem so it only needs to consider the original rows and does not have to use the
     15  current bounds. CBC provides an abstract base class <tt class="classname">CbcHeuristic</tt> and a rounding heuristic in CBC.
     16  </p><p>
     17  This chapter describes how to build a greedy heuristic for a set covering problem, e.g., the miplib problem fast0507. A more general (and efficient) version of the heuristic is in <tt class="filename">CbcHeuristicGreedy.hpp</tt> and <tt class="filename">CbcHeuristicGreedy.cpp</tt> located in the <tt class="filename">COIN/Cbc/Samples</tt> directory, see <a href="ch08.html" title="Chapter 8. &#10;More Samples&#10;">Chapter 8, <i>
    418More Samples
    5 "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. 
    6   Building and Modifying a Model
    7   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="osibuild"></a>Chapter 4. 
    8   Building and Modifying a Model
    9   </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch04.html#coinmodel">CoinModel</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="coinmodel"></a>CoinModel</h2></div></div><div></div></div><p>
    10   </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Advanced use of solver </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. 
    11 More Samples
    12 </td></tr></table></div></body></html>
     19</i></a>.
     20</p><p>
     21  The greedy heuristic will leave all variables taking value one at this node of the
     22  tree at value one, and will initially set all other variables to value zero. 
     23  All variables are then sorted in order of their cost
     24  divided by the number of entries in rows which are not yet covered. (We may randomize that
     25  value a bit so that ties will be broken in different ways on different runs of the heuristic.)
     26  The best one is choosen, and set to one. The process is repeated. Because this is
     27  a set covering problem (i.e., all constraints are &#8805;), the heuristic is guaranteed to find a solution (but not necessarily an improved solution). The speed of the heuristic could be improved by just redoing those affected, but for illustrative purposes we will keep it simple. (The speed could also be improved if all elements are 1.0).
     28</p><p>
     29  The key <tt class="classname">CbcHeuristic</tt> method is <tt class="function">int solution(double &amp; solutionValue,
     30                                              double * betterSolution)</tt>.
     31  The <tt class="function">solution()</tt> method returns 0 if no solution found, and returns 1 if a solution is found, in which case it fills in the objective value and primal solution.  The code in <tt class="filename">CbcHeuristicGreedy.cpp</tt> is a little more complicated than this following example. For instance, the code here assumes all variables are integer.  The important bit of data is a copy of the matrix (stored by column) before any cuts have been made.  The data used are bounds, objective and the matrix plus two work arrays.
     32  </p><div class="example"><a id="id3244936"/><p class="title"><b>Example 4.1. Data</b></p><pre class="programlisting">
     33   
     34  OsiSolverInterface * solver = model_-&gt;solver(); // Get solver from CbcModel
     35  const double * columnLower = solver-&gt;getColLower(); // Column Bounds
     36  const double * columnUpper = solver-&gt;getColUpper();
     37  const double * rowLower = solver-&gt;getRowLower(); // We know we only need lower bounds
     38  const double * solution = solver-&gt;getColSolution();
     39  const double * objective = solver-&gt;getObjCoefficients(); // In code we also use min/max
     40  double integerTolerance = model_-&gt;getDblParam(CbcModel::CbcIntegerTolerance);
     41  double primalTolerance;
     42  solver-&gt;getDblParam(OsiPrimalTolerance,primalTolerance);
     43  int numberRows = originalNumberRows_; // This is number of rows when matrix was passed in
     44  // Column copy of matrix (before cuts)
     45  const double * element = matrix_.getElements();
     46  const int * row = matrix_.getIndices();
     47  const CoinBigIndex * columnStart = matrix_.getVectorStarts();
     48  const int * columnLength = matrix_.getVectorLengths();
     49
     50  // Get solution array for heuristic solution
     51  int numberColumns = solver-&gt;getNumCols();
     52  double * newSolution = new double [numberColumns];
     53  // And to sum row activities
     54  double * rowActivity = new double[numberRows];
     55     
     56  </pre></div><p>
     57The <tt class="varname">newSolution</tt> is then initialized to the rounded down solution.
     58</p><div class="example"><a id="id3244965"/><p class="title"><b>Example 4.2. Initialize <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
     59   
     60  for (iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     61    CoinBigIndex j;
     62    double value = solution[iColumn];
     63    // Round down integer
     64    if (fabs(floor(value+0.5)-value)&lt;integerTolerance)
     65      value=floor(CoinMax(value+1.0e-3,columnLower[iColumn]));
     66    // make sure clean
     67    value = CoinMin(value,columnUpper[iColumn]);
     68    value = CoinMax(value,columnLower[iColumn]);
     69    newSolution[iColumn]=value;
     70    if (value) {
     71      double cost = objective[iColumn];
     72      newSolutionValue += value*cost;
     73      for (j=columnStart[iColumn];
     74           j&lt;columnStart[iColumn]+columnLength[iColumn];j++) {
     75        int iRow=row[j];
     76        rowActivity[iRow] += value*element[j];
     77      }
     78    }
     79  }
     80     
     81  </pre></div><p>
     82
     83
     84At this point some row activities are below their lower bound. To correct the infeasibility, the variable which is cheapest in reducing the sum of infeasibilities is found and updated, and the process repeats.  This is a finite process. (The implementation could be faster, but is kept simple for illustrative purposes.)
     85  </p><div class="example"><a id="id3245045"/><p class="title"><b>Example 4.3. Create Feasible <tt class="varname">newSolution</tt> from Initial <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
     86   
     87  while (true) {
     88    // Get column with best ratio
     89    int bestColumn=-1;
     90    double bestRatio=COIN_DBL_MAX;
     91    for (int iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     92      CoinBigIndex j;
     93      double value = newSolution[iColumn];
     94      double cost = direction * objective[iColumn];
     95      // we could use original upper rather than current
     96      if (value+0.99&lt;columnUpper[iColumn]) {
     97        double sum=0.0; // Compute how much we will reduce infeasibility by
     98        for (j=columnStart[iColumn];
     99             j&lt;columnStart[iColumn]+columnLength[iColumn];j++) {
     100          int iRow=row[j];
     101          double gap = rowLower[iRow]-rowActivity[iRow];
     102          if (gap&gt;1.0e-7) {
     103            sum += CoinMin(element[j],gap);
     104          if (element[j]+rowActivity[iRow]&lt;rowLower[iRow]+1.0e-7) {
     105            sum += element[j];
     106          }
     107        }
     108        if (sum&gt;0.0) {
     109          double ratio = (cost/sum)*(1.0+0.1*CoinDrand48());
     110          if (ratio&lt;bestRatio) {
     111            bestRatio=ratio;
     112            bestColumn=iColumn;
     113          }
     114        }
     115      }
     116    }
     117    if (bestColumn&lt;0)
     118      break; // we have finished
     119    // Increase chosen column
     120    newSolution[bestColumn] += 1.0;
     121    double cost = direction * objective[bestColumn];
     122    newSolutionValue += cost;
     123    for (CoinBigIndex j=columnStart[bestColumn];
     124         j&lt;columnStart[bestColumn]+columnLength[bestColumn];j++) {
     125      int iRow = row[j];
     126      rowActivity[iRow] += element[j];
     127    }
     128  }
     129     
     130  </pre></div><p>
     131A solution value of <tt class="varname">newSolution</tt> is compared to the best solution value. If <tt class="varname">newSolution</tt> is an improvement, its feasibility is validated. We expect <tt class="varname">newSolution</tt> to be feasible, and are trapping for unexpected numerical errors.
     132  </p><div class="example"><a id="id3245090"/><p class="title"><b>Example 4.4. Check Solution Quality of <tt class="varname">newSolution</tt></b></p><pre class="programlisting">
     133   
     134  returnCode=0; // 0 means no good solution
     135  if (newSolutionValue&lt;solutionValue) { // minimization
     136    // check feasible
     137    memset(rowActivity,0,numberRows*sizeof(double));
     138    for (iColumn=0;iColumn&lt;numberColumns;iColumn++) {
     139      CoinBigIndex j;
     140      double value = newSolution[iColumn];
     141      if (value) {
     142        for (j=columnStart[iColumn];
     143             j&lt;columnStart[iColumn]+columnLength[iColumn];j++) {
     144          int iRow=row[j];
     145          rowActivity[iRow] += value*element[j];
     146        }
     147      }
     148    }
     149    // check was approximately feasible
     150    bool feasible=true;
     151    for (iRow=0;iRow&lt;numberRows;iRow++) {
     152      if(rowActivity[iRow]&lt;rowLower[iRow]) {
     153        if (rowActivity[iRow]&lt;rowLower[iRow]-10.0*primalTolerance)
     154          feasible = false;
     155      }
     156    }
     157    if (feasible) {
     158      // new solution
     159      memcpy(betterSolution,newSolution,numberColumns*sizeof(double));
     160      solutionValue = newSolutionValue;
     161      // We have good solution
     162      returnCode=1;
     163    }
     164  }
     165     
     166  </pre></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 3. 
     167  Selecting the Next Node in the Search Tree
     168   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. 
     169  Branching
     170 </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch05.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 5. 
    2 More Samples
    3 </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="ch04.html" title="Chapter 4. 
    4   Building and Modifying a Model
    5   "><link rel="next" href="ch06.html" title="Chapter 6. 
    6   Messages
    7   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. 
    8 More Samples
    9 </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch06.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="moreexamples"></a>Chapter 5. 
    10 More Samples
    11 </h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch05.html#id2904722">CBC's Samples Directory</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2904722"></a>CBC's Samples Directory</h2></div></div><div></div></div><p>
    12 The CBC distribution includes a number of <tt class="filename">.cpp</tt> sample files.
    13 Users are encouraged to use them as starting points for their own CBC projects.
    14 The files can be found in the <tt class="filename">COIN/Cbc/Samples/</tt> directory.
    15 For the latest information on compiling and running these samples, please see
    16 the file <tt class="filename">COIN/Cbc/Samples/INSTALL</tt>.  Most of them can be built
    17 by </p><pre class="programlisting">make DRIVER=name</pre><p> which produces an executable testit.  Below is a list of
    18 some of the most useful sample files with a short description for each file.
    19 </p><div class="table"><a name="id2904739"></a><p class="title"><b>Table 5.1. Basic Samples</b></p><table summary="Basic Samples" border="0"><colgroup><col><col></colgroup><thead><tr><th align="left" valign="bottom">
    20         Source file       
    21         </th><th align="left" valign="bottom">
    22         Description
    23         </th></tr></thead><tbody><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/minimum.cpp" target="_top"><tt class="filename">minimum.cpp</tt></a></td><td align="left" valign="top">
    24         This is a CBC "Hello, world" program.  It reads a problem
    25         from an MPS file, and solves the problem.
    26         </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/sample2.cpp" target="_top"><tt class="filename">sample2.cpp</tt></a></td><td align="left" valign="top">
    27         This is designed to be a file that a user could modify to get a useful
    28         driver program for his or her project.  In particular, it demonstrates
    29         the use of Cgl's  preprocess functionality.
    30         It uses <tt class="function">CbcBranchUser.cpp</tt>,
    31         <tt class="function">CbcCompareUser.cpp</tt> and
    32         <tt class="function">CbcHeuristicUser.cpp</tt>
    33         with corresponding <tt class="function">*.hpp</tt> files.
    34         </td></tr></tbody></table></div><div class="table"><a name="id2905338"></a><p class="title"><b>Table 5.2. Advanced Samples</b></p><table summary="Advanced Samples" border="0"><colgroup><col><col></colgroup><thead><tr><th align="left" valign="bottom">
    35         Source file       
    36         </th><th align="left" valign="bottom">
    37         Description
    38         </th></tr></thead><tbody><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/crew.cpp" target="_top"><tt class="filename">crew.cpp</tt></a></td><td align="left" valign="top">
    39         This sample, shows the use of advanced branching and a use of priorities.
    40         It uses <tt class="function">CbcCompareUser.cpp</tt>
    41         with corresponding <tt class="function">*.hpp</tt> files.
    42         </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/longthin.cpp" target="_top"><tt class="filename">longthin.cpp</tt></a></td><td align="left" valign="top">
    43         This sample shows the advanced use of a solver.  It also has coding for
    44         a greedy heuristic.
    45         The solver is given in <tt class="function">CbcSolver2.hpp</tt> and
    46         <tt class="function">CbcSolver2.cpp</tt>.
    47         The heuristic is given in <tt class="function">CbcHeuristicGreedy.hpp</tt> and
    48         <tt class="function">CbcHeuristicGreedy.cpp</tt>.
    49         It uses <tt class="function">CbcBranchUser.cpp</tt> and
    50         <tt class="function">CbcCompareUser.cpp</tt>
    51         with corresponding <tt class="function">*.hpp</tt> files.
    52         </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/qmip.cpp" target="_top"><tt class="filename">qmip.cpp</tt></a></td><td align="left" valign="top">
    53         This solves a quadratic mip.  It is to show advanced use of a solver.
    54         The solver is given in <tt class="function">ClpQuadInterface.hpp</tt> and
    55         <tt class="function">ClpQuadInterface.cpp</tt>.
    56         It uses <tt class="function">CbcBranchUser.cpp</tt> and
    57         <tt class="function">CbcCompareUser.cpp</tt>
    58         with corresponding <tt class="function">*.hpp</tt> files.
    59         </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/sos.cpp" target="_top"><tt class="filename">sos.cpp</tt></a></td><td align="left" valign="top">
    60         This artificially creates a Special Ordered set problem.
    61         </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/lotsize.cpp" target="_top"><tt class="filename">lotsize.cpp</tt></a></td><td align="left" valign="top">
    62         This artificially creates a lot sizing problem.
    63         </td></tr></tbody></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. 
    64   Building and Modifying a Model
    65    </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. 
    66   Messages
    67   </td></tr></table></div></body></html>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 5. 
     3  Branching
     4 </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch04.html" title="Chapter 4. &#10;  Getting Good Bounds in CBC&#10;  "/><link rel="next" href="ch05s02.html" title="Pseudo Cost Branching"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. 
     5  Branching
     6 </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="branchChapter"/>Chapter 5. 
     7  Branching
     8 </h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch05.html#branchingIntro">Branching Overview</a></dt><dt><a href="ch05s02.html">Pseudo Cost Branching</a></dt><dt><a href="ch05s03.html">Follow-On Branching</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="branchingIntro"/>Branching Overview</h2></div></div><div/></div><p>
     9CBC's concept of branching is based on the idea of an "object". An object has (i) a feasible region, (ii) can be evaluated for infeasibility, (iii) can be branched on, e.g., a method of generating a branching object, which defines an up branch and a down branch, and (iv) allows comparsion of the effect of branching. Instances of objects include.
     10</p><div class="itemizedlist"><ul type="disc"><li><tt class="classname">CbcSimpleInteger</tt>, </li><li><tt class="classname">CbcSimpleIntegerPseudoCosts</tt>,  </li><li><tt class="classname">CbcClique</tt>, </li><li><tt class="classname">CbcSOS</tt> (type 1 and 2), </li><li><tt class="classname">CbcFollowOn</tt>, and </li><li><tt class="classname">CbcLotsize</tt>.</li></ul></div><p>
     11In <a href="ch05.html" title="Chapter 5. &#10;  Branching&#10; ">Chapter 5, <i>
     12  Branching
     13 </i></a>, we give examples of how to use existing branching objects. (The next revision of this Guide should include an example of how to write your own branching object; Contributions of examples are welcome.)
     14</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 4. 
     15  Getting Good Bounds in CBC
     16   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Pseudo Cost Branching</td></tr></table></div></body></html>
  • html/trunk/Cbc/ch06.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 6. 
    2   Messages
    3   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="up" href="index.html" title="CBC User Guide"><link rel="previous" href="ch05.html" title="Chapter 5. 
    4 More Samples
    5 "><link rel="next" href="apa.html" title="Appendix A. FAQ"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. 
    6   Messages
    7   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="messages"></a>Chapter 6. 
    8   Messages
    9   </h2></div></div><div></div></div><p>
    10   Some of the more common messages and codes passed by CLP are listed in the
    11   tables below.  This is list is not meant to exhaustive.  The notation is as
    12   for printf from "C":
    13   </p><div class="itemizedlist"><ul type="disc"><li>
    14     <tt class="computeroutput">%s</tt> is a string
    15     </li><li>
    16     <tt class="computeroutput">%d</tt> is an integer
    17     </li><li>
    18     <tt class="computeroutput">%g</tt> or <tt class="computeroutput">%f</tt>
    19     is a floating point value
    20     </li></ul></div><div class="table"><a name="id2904621"></a><p class="title"><b>Table 6.1. 
    21   COIN Messages passed at or above logging level 1
    22   </b></p><table summary="
    23   COIN Messages passed at or above logging level 1
    24   " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
    25       Code
    26       </th><th align="center">
    27       Area
    28       </th><th> </th><th align="left">
    29       Text and notes
    30       </th></tr></thead><tbody><tr><td align="left">
    31       1
    32       </td><td align="center">
    33       MPSREAD
    34       </td><td> </td><td align="left"><tt class="computeroutput">At line %d %s</tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    35       This just prints out NAME line, ROW line, etc
    36       </p></td></tr><tr><td align="left">
    37       2
    38       </td><td align="center">
    39       MPSREAD
    40       </td><td> </td><td align="left"><tt class="computeroutput">Problem %s has %d rows, %d columns and %d elements
    41       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    42       This gives statistics after reading an MPS file
    43       </p></td></tr><tr><td align="left">
    44       8
    45       </td><td align="center">
    46       MPSREAD
    47       </td><td> </td><td align="left"><tt class="computeroutput">%s read with %d errors
    48       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    49       This gives error statistics for file
    50       </p></td></tr><tr><td align="left">
    51       505
    52       </td><td align="center">
    53       PRESOLVE
    54       </td><td> </td><td align="left"><tt class="computeroutput">
    55       Presolved poblem not optimal, resolve after postsolve
    56       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    57       This could be because it was not feasible or because of maximum
    58       iterations.  If this message occurs then consider using primal clean up
    59       </p></td></tr><tr><td align="left">
    60       506
    61       </td><td align="center">
    62       PRESOLVE
    63       </td><td> </td><td align="left"><tt class="computeroutput">
    64       Presolve %d (%d) rows, %d (%d) columns and %d (%d) elements
    65       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    66       The first number is the number after presolve and the number
    67       in parentheses is amount of reduction
    68       </p></td></tr><tr><td align="left">
    69       510
    70       </td><td align="center">
    71       PRESOLVE
    72       </td><td> </td><td align="left"><tt class="computeroutput">
    73       Presolve is modifying %d integer bounds and re-presolving
    74       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    75       If presolve determines at the end that an integer variable have its bounds
    76       changed then it will repeat the entrire presolve
    77       </p></td></tr><tr><td align="left">
    78       511
    79       </td><td align="center">
    80       PRESOLVE
    81       </td><td> </td><td align="left"><tt class="computeroutput">
    82       After Postsolve, objective %g, infeasibilities - dual %g (%d),
    83       primal %g (%d)
    84       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    85       This gives the state after postsolve - this gives the objective value
    86       and the sum of dual and primal infeasibilities with the number of
    87       infeasibilities in parentheses.  Hopefully these should be zero
    88       </p></td></tr><tr><td align="left">
    89       512
    90       </td><td align="center">
    91       PRESOLVE
    92       </td><td> </td><td align="left"><tt class="computeroutput">
    93       Presolved model was optimal, full model needs cleaning up
    94       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    95       If the numbers in previous message (511) were large then maybe we need to
    96       know, if small then that's life
    97       </p></td></tr></tbody></table></div><div class="table"><a name="id2907202"></a><p class="title"><b>Table 6.2. 
    98   CLP Messages passed at or above logging level 1
    99   </b></p><table summary="
    100   CLP Messages passed at or above logging level 1
    101   " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
    102       Code
    103       </th><th align="center">
    104       Area
    105       </th><th> </th><th align="left">
    106       Text and notes
    107       </th></tr></thead><tbody><tr><td align="left">
    108       1
    109       </td><td align="center">
    110       SIMPLEX
    111       </td><td> </td><td align="left"><tt class="computeroutput">
    112       Primal infeasible - objective value %g
    113       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    114       You may need to look at previous messages or use methods.  Such as
    115       sumPrimalInfeasibilities() to find cause
    116       </p></td></tr><tr><td align="left">
    117       2
    118       </td><td align="center">
    119       SIMPLEX
    120       </td><td> </td><td align="left"><tt class="computeroutput">
    121       Dual infeasible - objective value %g
    122       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    123       You may need to look at previous messages or use methods.  Such as
    124       sumDualInfeasibilities() to find cause
    125       </p></td></tr><tr><td align="left">
    126       3
    127       </td><td align="center">
    128       SIMPLEX
    129       </td><td> </td><td align="left"><tt class="computeroutput">
    130       Stopped - objective value %g
    131       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    132       The algorithm stopped as requested by the user.
    133       </p></td></tr><tr><td align="left">
    134       4
    135       </td><td align="center">
    136       SIMPLEX
    137       </td><td> </td><td align="left"><tt class="computeroutput">
    138       Stopped due to errors - objective value %g
    139       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    140       Switch on log level 2 to see information on size of elements etc.  If they
    141       look reasonable then maybe we need to know.
    142       </p></td></tr><tr><td align="left">
    143       5
    144       </td><td align="center">
    145       SIMPLEX
    146       </td><td> </td><td align="left"><tt class="computeroutput">
    147       %d Obj %g Primal inf %g (%d) Dual inf %g (%d)
    148       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    149       At each re-factorization this gives the number of iterations and the value
    150       of the objective function.  If there are primal infeasibilities then the
    151       sum and number are given and similarly for dual infeasibilities.
    152       (This is a simplified form of message.)
    153       </p></td></tr><tr><td align="left">
    154       14
    155       </td><td align="center">
    156       SIMPLEX
    157       </td><td> </td><td align="left"><tt class="computeroutput">
    158       Perturbing problem by %g % of %g
    159       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    160       There is more to this message but if the user sees this then s/he has
    161       chosen to perturb the problem or the algorithm has decided to do so.
    162       If the numbers look too large the user may wish to think again.
    163       </p></td></tr><tr><td align="left">
    164       19
    165       </td><td align="center">
    166       SIMPLEX
    167       </td><td> </td><td align="left"><tt class="computeroutput">
    168       %d variables/rows fixed as scaled bounds too close
    169       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    170       If this occurs look carefully at your input data
    171       </p></td></tr><tr><td align="left">
    172       24
    173       </td><td align="center">
    174       SIMPLEX
    175       </td><td> </td><td align="left"><tt class="computeroutput">
    176       Matrix will be packed to eliminate small elements
    177       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    178       If this occurs the user should look carefully at data.
    179       </p></td></tr><tr><td align="left">
    180       26
    181       </td><td align="center">
    182       SIMPLEX
    183       </td><td> </td><td align="left"><tt class="computeroutput">
    184       Matrix will be packed to eliminate %d duplicate elements
    185       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    186       If this occurs the user should look carefully at data.
    187       </p></td></tr><tr><td align="left">
    188       28
    189       </td><td align="center">
    190       SIMPLEX
    191       </td><td> </td><td align="left"><tt class="computeroutput">
    192       Crash put %d variables in basis, %d dual infeasibilities
    193       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    194      
    195       </p></td></tr><tr><td align="left">
    196       29
    197       </td><td align="center">
    198       SIMPLEX
    199       </td><td> </td><td align="left"><tt class="computeroutput">
    200       End of values pass after %d iterations
    201       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    202       ??? If primal(1) or dual(1) the a sweep through model is made and this
    203       signals end of pass.
    204       </p></td></tr></tbody></table></div><div class="table"><a name="id2908139"></a><p class="title"><b>Table 6.3. 
    205   COIN Messages passed at or above logging level 0
    206   </b></p><table summary="
    207   COIN Messages passed at or above logging level 0
    208   " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
    209       Code
    210       </th><th align="center">
    211       Area
    212       </th><th> </th><th align="left">
    213       Text and notes
    214       </th></tr></thead><tbody><tr><td align="left">
    215       3001
    216       </td><td align="center">
    217       MPSREAD
    218       </td><td> </td><td align="left"><tt class="computeroutput">
    219       Illegal value for %s of %g
    220       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    221       String will be "infinity" if setInfinity passed bad value,
    222       or "default integer bound" if setDefaultBound passed bad value.
    223       </p></td></tr><tr><td align="left">
    224       3002
    225       </td><td align="center">
    226       MPSREAD
    227       </td><td> </td><td align="left"><tt class="computeroutput">
    228       Bad image at line %d &lt; %s &gt;
    229       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    230       This gives line number and the offending line
    231       </p></td></tr><tr><td align="left">
    232       3003
    233       </td><td align="center">
    234       MPSREAD
    235       </td><td> </td><td align="left"><tt class="computeroutput">
    236       Duplicate objective at line %d &lt; %s &gt;
    237       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    238       An objective row appears twice in one column
    239       </p></td></tr><tr><td align="left">
    240       3004
    241       </td><td align="center">
    242       MPSREAD
    243       </td><td> </td><td align="left"><tt class="computeroutput">
    244       Duplicate row %s at line %d %s
    245       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    246       The named row appears twice in one column.
    247       </p></td></tr><tr><td align="left">
    248       3005
    249       </td><td align="center">
    250       MPSREAD
    251       </td><td> </td><td align="left"><tt class="computeroutput">
    252       No match for row %s at line %d &lt; %s &gt;
    253       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    254       The named row did not appear in ROWS section.
    255       </p></td></tr><tr><td align="left">
    256       3006
    257       </td><td align="center">
    258       MPSREAD
    259       </td><td> </td><td align="left"><tt class="computeroutput">
    260       No match for column at line %d &lt; %s &gt;
    261       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    262       The named column (in BOUNDS section) did not appear in COLUMNS section.
    263       </p></td></tr><tr><td align="left">
    264       6001
    265       </td><td align="center">
    266       MPSREAD
    267       </td><td> </td><td align="left"><tt class="computeroutput">
    268       Unable to open mps input file %s
    269       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    270      
    271       </p></td></tr><tr><td align="left">
    272       6002
    273       </td><td align="center">
    274       MPSREAD
    275       </td><td> </td><td align="left"><tt class="computeroutput">
    276       Unknown image %s at line %d of file %s
    277       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    278       The Mps reader could not make sense of the image file specified.
    279       </p></td></tr><tr><td align="left">
    280       6003
    281       </td><td align="center">
    282       MPSREAD
    283       </td><td> </td><td align="left"><tt class="computeroutput">
    284       Consider the possibility of a compressed file which zlib is unable to read.
    285       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    286       Some .gz files can not be read by zlib.  Using gunzip and then gzip
    287       normally cures problem.
    288       </p></td></tr><tr><td align="left">
    289       6004
    290       </td><td align="center">
    291       MPSREAD
    292       </td><td> </td><td align="left"><tt class="computeroutput">
    293       EOF on file %s
    294       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    295       The Mps reader did not find expected section marker.     
    296       </p></td></tr><tr><td align="left">
    297       6005
    298       </td><td align="center">
    299       MPSREAD
    300       </td><td> </td><td align="left"><tt class="computeroutput">
    301       Returning as too many errors
    302       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    303       The reader has put out 100 messages and is giving up.
    304       </p></td></tr><tr><td align="left">
    305       507
    306       </td><td align="center">
    307       PRESOLVE
    308       </td><td> </td><td align="left"><tt class="computeroutput">
    309       Presolve determined that the problem is infeasible with tolerance of %g
    310       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    311       If you want you can try with a larger tolerance
    312       </p></td></tr><tr><td align="left">
    313       508
    314       </td><td align="center">
    315       PRESOLVE
    316       </td><td> </td><td align="left"><tt class="computeroutput">
    317       Presolve thinks problem is unbounded
    318       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    319       Perhaps the user should maximize if initially minimizing or vice versa.
    320       </p></td></tr><tr><td align="left">
    321       509
    322       </td><td align="center">
    323       PRESOLVE
    324       </td><td> </td><td align="left"><tt class="computeroutput">
    325       Presolve thinks problem is infeasible AND unbounded???
    326       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    327       If you get this message we want to know
    328       </p></td></tr></tbody></table></div><div class="table"><a name="id2909208"></a><p class="title"><b>Table 6.4. 
    329   CLP Messages passed at or above logging level 0
    330   </b></p><table summary="
    331   CLP Messages passed at or above logging level 0
    332   " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
    333       Code
    334       </th><th align="center">
    335       Area
    336       </th><th> </th><th align="left">
    337       Text and notes
    338       </th></tr></thead><tbody><tr><td align="left">
    339       3002
    340       </td><td align="center">
    341       SIMPLEX
    342       </td><td> </td><td align="left"><tt class="computeroutput">
    343       Not solving empty problem - %d rows, %d columns and %d elements
    344       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    345       Test problem size before solving.
    346       </p></td></tr><tr><td align="left">
    347       6002
    348       </td><td align="center">
    349       SIMPLEX
    350       </td><td> </td><td align="left"><tt class="computeroutput">
    351       %d bad bound pairs or bad objectives were found
    352       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    353       Either the value in the objective was too large or a lower bound was
    354       greater than an upper bound.
    355       </p></td></tr><tr><td align="left">
    356       6003
    357       </td><td align="center">
    358       SIMPLEX
    359       </td><td> </td><td align="left"><tt class="computeroutput">
    360       Matrix has %d large values, first at column %d, row %d is %g
    361       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    362       Some of the values in matrix are ridiculous.
    363       </p></td></tr><tr><td align="left">
    364       6004
    365       </td><td align="center">
    366       SIMPLEX
    367       </td><td> </td><td align="left"><tt class="computeroutput">
    368       Can't get out of loop ...
    369       </tt></td></tr><tr><td colspan="3"> </td><td align="left"><p>
    370      
    371       </p></td></tr></tbody></table></div><p>
    372   There are also messages available at log level 2 (the most likely useful relate
    373   to scaling), and will be addressed in a future version of this User Guide.
    374   </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. 
    375 More Samples
    376  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. FAQ</td></tr></table></div></body></html>
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 6. Cutting planes</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch05s03.html" title="Follow-On Branching"/><link rel="next" href="ch07.html" title="Chapter 7. &#10;  Advanced Solver Uses&#10;"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 6. Cutting planes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05s03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch07.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="CutsChap"/>Chapter 6. Cutting planes</h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch06.html#cuts">Using Cut Generators with CBC</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="cuts"/>Using Cut Generators with CBC</h2></div></div><div/></div><p>
     3In the next version of this Guide, we need to have an example illustrating how to use COIN's CGL with CBC. Contribtions are welcome.
     4
     5  </p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch07.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Follow-On Branching </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 7. 
     6  Advanced Solver Uses
     7</td></tr></table></div></body></html>
  • html/trunk/Cbc/ch08.html

    r556 r557  
    11<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
    22<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Chapter 8. 
     3More Samples
     4</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch07s02.html" title="Quadratic MIP"/><link rel="next" href="ch09.html" title="Chapter 9. &#10;  Messages&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. 
     5More Samples
     6</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch09.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="moreexamples"/>Chapter 8. 
     7More Samples
     8</h2></div></div><div/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="ch08.html#id3247359">CBC's Samples Directory</a></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3247359"/>CBC's Samples Directory</h2></div></div><div/></div><p>
     9The CBC distribution includes a number of <tt class="filename">.cpp</tt> sample files.
     10Users are encouraged to use them as starting points for their own CBC projects.
     11The files can be found in the <tt class="filename">COIN/Cbc/Samples/</tt> directory.
     12For the latest information on compiling and running these samples, please see
     13the file <tt class="filename">COIN/Cbc/Samples/INSTALL</tt>.  Most of them can be built
     14by </p><pre class="programlisting">make DRIVER=name</pre><p> which produces an executable <tt class="filename">testit</tt>.  Below is a list of
     15some of the most useful sample files with a short description for each file.
     16</p><div class="table"><a id="id3248316"/><p class="title"><b>Table 8.1. Basic Samples</b></p><table summary="Basic Samples" border="0"><colgroup><col/><col/></colgroup><thead><tr><th align="left" valign="bottom">
     17        Source file       
     18        </th><th align="left" valign="bottom">
     19        Description
     20        </th></tr></thead><tbody><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/minimum.cpp" target="_top"><tt class="filename">minimum.cpp</tt></a></td><td align="left" valign="top">
     21        This is a CBC "Hello, world" program.  It reads a problem
     22        in MPS file format, and solves the problem using simple branch-and-bound.
     23        </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/sample2.cpp" target="_top"><tt class="filename">sample2.cpp</tt></a></td><td align="left" valign="top">
     24        This is designed to be a file that a user could modify to get a useful
     25        driver program for his or her project.  In particular, it demonstrates
     26        the use of CGL's  preprocess functionality.
     27        It uses <tt class="function">CbcBranchUser.cpp</tt>,
     28        <tt class="function">CbcCompareUser.cpp</tt> and
     29        <tt class="function">CbcHeuristicUser.cpp</tt>
     30        with corresponding <tt class="function">*.hpp</tt> files.
     31        </td></tr></tbody></table></div><div class="table"><a id="id3248490"/><p class="title"><b>Table 8.2. Advanced Samples</b></p><table summary="Advanced Samples" border="0"><colgroup><col/><col/></colgroup><thead><tr><th align="left" valign="bottom">
     32        Source file       
     33        </th><th align="left" valign="bottom">
     34        Description
     35        </th></tr></thead><tbody><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/crew.cpp" target="_top"><tt class="filename">crew.cpp</tt></a></td><td align="left" valign="top">
     36        This sample shows the use of advanced branching and a use of priorities.
     37        It uses <tt class="function">CbcCompareUser.cpp</tt>
     38        with corresponding <tt class="function">*.hpp</tt> files.
     39        </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/longthin.cpp" target="_top"><tt class="filename">longthin.cpp</tt></a></td><td align="left" valign="top">
     40        This sample shows the advanced use of a solver.  It also has coding for
     41        a greedy heuristic.
     42        The solver is given in <tt class="function">CbcSolver2.hpp</tt> and
     43        <tt class="function">CbcSolver2.cpp</tt>.
     44        The heuristic is given in <tt class="function">CbcHeuristicGreedy.hpp</tt> and
     45        <tt class="function">CbcHeuristicGreedy.cpp</tt>.
     46        It uses <tt class="function">CbcBranchUser.cpp</tt> and
     47        <tt class="function">CbcCompareUser.cpp</tt>
     48        with corresponding <tt class="function">*.hpp</tt> files.
     49        </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/qmip.cpp" target="_top"><tt class="filename">qmip.cpp</tt></a></td><td align="left" valign="top">
     50        This solves a quadratic MIP.  It is to show advanced use of a solver.
     51        The solver is given in <tt class="function">ClpQuadInterface.hpp</tt> and
     52        <tt class="function">ClpQuadInterface.cpp</tt>.
     53        It uses <tt class="function">CbcBranchUser.cpp</tt> and
     54        <tt class="function">CbcCompareUser.cpp</tt>
     55        with corresponding <tt class="function">*.hpp</tt> files.
     56        </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/sos.cpp" target="_top"><tt class="filename">sos.cpp</tt></a></td><td align="left" valign="top">
     57        This artificially creates a Special Ordered Set problem.
     58        </td></tr><tr><td align="left" valign="top"><a href="http://www.coin-or.org/cgi-bin/cvsweb.cgi/COIN/Cbc/Samples/lotsize.cpp" target="_top"><tt class="filename">lotsize.cpp</tt></a></td><td align="left" valign="top">
     59        This artificially creates a Lot Sizing problem.
     60        </td></tr></tbody></table></div></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch09.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Quadratic MIP </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 9. 
    361  Messages
    4   </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="index.html" title="CBC User Guide"/><link rel="previous" href="ch07.html" title="Chapter 7. &#10;More Samples&#10;"/><link rel="next" href="apa.html" title="Appendix A. FAQ"/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 8. 
    5   Messages
    6   </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr></table><hr/></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="messages"/>Chapter 8. 
    7   Messages
    8   </h2></div></div><div/></div><p>
    9   Messages and codes passed by CBC are listed in the
    10   tables below.  For a complete list, see <tt class="filename">COIN/Cbc/CbcMessages.cpp</tt>. The notation used is the same as for the <tt class="function">printf</tt> in the C programming language.
    11   </p><div class="itemizedlist"><ul type="disc"><li>
    12     <tt class="computeroutput">%s</tt> is a string
    13     </li><li>
    14     <tt class="computeroutput">%d</tt> is an integer
    15     </li><li>
    16     <tt class="computeroutput">%g</tt> or <tt class="computeroutput">%f</tt>
    17     is a floating point value
    18     </li></ul></div><p>
    19 
    20   </p><p>There are several log levels. Setting the log level to be <i class="parameter"><tt>i</tt></i> produces the log messages for level <i class="parameter"><tt>i</tt></i> and all levels less than <i class="parameter"><tt>i</tt></i>.
    21  </p><div class="itemizedlist"><ul type="disc"><li>
    22     Logging Level 0: Switches off all CBC messages, but one.
    23     </li><li>
    24     Logging Level 1: The default. 
    25     </li><li>
    26     Logging Level 2: Substantial amount of information, e.g., message 15 is generated once per node. Can be useful when the evaluation at each node is slow.
    27     </li><li>
    28     Logging Level 3: Tremendous amount of information, e.g., multiple messages per node.
    29     </li></ul></div><div class="table"><a id="id2993965"/><p class="title"><b>Table 8.1. 
    30   CBC Messages Passed At Logging Level 0
    31   </b></p><table summary="&#10;  CBC Messages Passed At Logging Level 0&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    32       Code
    33       </th><th> </th><th align="left">
    34       Text and notes
    35       </th><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left">
    36       3007
    37       </td><td> </td><td align="left"><tt class="computeroutput">No integer variables - nothing to do</tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    38 
    39       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id2994110"/><p class="title"><b>Table 8.2. 
    40   CBC Messages Passed At or Above Logging Level 1
    41   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 1&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    42       Code
    43       </th><th> </th><th align="left">
    44       Text and notes
    45       </th><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left">
    46       1
    47       </td><td> </td><td align="left"><tt class="computeroutput">Search completed - best objective %g, took %d iterations and %d nodes
    48       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    49      
    50       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    51       3
    52       </td><td> </td><td align="left"><tt class="computeroutput">Exiting on maximum nodes
    53       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    54      
    55       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    56       4
    57       </td><td> </td><td align="left"><tt class="computeroutput">
    58       Integer solution of %g found after %d iterations and %d nodes
    59       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    60      
    61       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    62       5
    63       </td><td> </td><td align="left"><tt class="computeroutput">
    64       Partial search - best objective %g (best possible %g), took %d iterations and %d nodes
    65       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    66      
    67       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    68       6
    69       </td><td> </td><td align="left"><tt class="computeroutput">
    70       The LP relaxation is infeasible or too expensive
    71       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    72      
    73       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    74       9
    75       </td><td> </td><td align="left"><tt class="computeroutput">
    76       Objective coefficients multiple of %g
    77       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    78      
    79       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    80       10
    81       </td><td> </td><td align="left"><tt class="computeroutput">
    82       After %d nodes, %d on tree, %g best solution, best possible %g
    83       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    84      
    85       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    86       11
    87       </td><td> </td><td align="left"><tt class="computeroutput">
    88       Exiting as integer gap of %g less than %g or %g%%
    89       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    90            
    91       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    92       12
    93       </td><td> </td><td align="left"><tt class="computeroutput">
    94       Integer solution of %g found by heuristic after %d iterations and %d nodes
    95       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    96      
    97       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    98       13
    99       </td><td> </td><td align="left"><tt class="computeroutput">
    100       At root node, %d cuts changed objective from %g to %g in %d passes
    101       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    102      
    103       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    104       14
    105       </td><td> </td><td align="left"><tt class="computeroutput">
    106       Cut generator %d (%s) - %d row cuts (%d active), %d column cuts %? in %g seconds - new frequency is %d
    107       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    108      
    109       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    110       16
    111       </td><td> </td><td align="left"><tt class="computeroutput">
    112       Integer solution of %g found by strong branching after %d iterations and %d nodes
    113       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    114      
    115       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    116       17
    117       </td><td> </td><td align="left"><tt class="computeroutput">
    118       %d solved, %d variables fixed, %d tightened
    119       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    120      
    121       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    122       18
    123       </td><td> </td><td align="left"><tt class="computeroutput">
    124       After tightenVubs, %d variables fixed, %d tightened
    125       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    126      
    127       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    128       19
    129       </td><td> </td><td align="left"><tt class="computeroutput">
    130       Exiting on maximum solutions
    131       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    132      
    133       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    134       20
    135       </td><td> </td><td align="left"><tt class="computeroutput">
    136       Exiting on maximum time
    137       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    138      
    139       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    140       23
    141       </td><td> </td><td align="left"><tt class="computeroutput">
    142       Cutoff set to %g - equivalent to best solution of %g
    143       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    144      
    145       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    146       24
    147       </td><td> </td><td align="left"><tt class="computeroutput">
    148       Integer solution of %g found by subtree after %d iterations and %d nodes
    149       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    150      
    151       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    152       26
    153       </td><td> </td><td align="left"><tt class="computeroutput">
    154       Setting priorities for objects %d to %d inclusive (out of %d)
    155       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    156      
    157       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    158       3008
    159       </td><td> </td><td align="left"><tt class="computeroutput">
    160       Strong branching is fixing too many variables, too expensively!
    161       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    162      
    163       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id2995474"/><p class="title"><b>Table 8.3. 
    164   CBC Messages Passed At or Above Logging Level 2
    165   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 2&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    166       Code
    167       </th><th> </th><th align="left">
    168       Text and notes
    169       </th><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left">
    170       15
    171       </td><td> </td><td align="left"><tt class="computeroutput">
    172       Node %d Obj %g Unsat %d depth %d
    173       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    174      
    175       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    176       21
    177       </td><td> </td><td align="left"><tt class="computeroutput">
    178       On closer inspection node is infeasible
    179       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    180      
    181       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    182       22
    183       </td><td> </td><td align="left"><tt class="computeroutput">
    184       On closer inspection objective value of %g above cutoff of %g
    185       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    186      
    187       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    188       23
    189       </td><td> </td><td align="left"><tt class="computeroutput">
    190       Allowing solution, even though largest row infeasibility is %g
    191       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    192      
    193       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id2995875"/><p class="title"><b>Table 8.4. 
    194   CBC Messages Passed At or Above Logging Level 3
    195   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 3&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    196       Code
    197       </th><th> </th><th align="left">
    198       Text and notes
    199       </th><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left">
    200       7
    201       </td><td> </td><td align="left"><tt class="computeroutput">
    202       Strong branching on %d (%d), down %g (%d) up %g (%d) value %g
    203       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    204      
    205       </p></td><td class="auto-generated"> </td></tr><tr><td align="left">
    206       25
    207       </td><td> </td><td align="left"><tt class="computeroutput">
    208       %d cleanup iterations before strong branching
    209       </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    210      
    211       </p></td><td class="auto-generated"> </td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="apa.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 7. 
    212 More Samples
    213  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Appendix A. FAQ</td></tr></table></div></body></html>
     62  </td></tr></table></div></body></html>
  • html/trunk/Cbc/ch09.html

    r555 r557  
    2020  </p><p>There are several log levels. Setting the log level to be <i class="parameter"><tt>i</tt></i> produces the log messages for level <i class="parameter"><tt>i</tt></i> and all levels less than <i class="parameter"><tt>i</tt></i>.
    2121 </p><div class="itemizedlist"><ul type="disc"><li>
    22     Logging Level 0: Switches off all CBC messages, but one.
    23     </li><li>
    24     Logging Level 1: The default. 
    25     </li><li>
    26     Logging Level 2: Substantial amount of information, e.g., message 15 is generated once per node. Can be useful when the evaluation at each node is slow.
    27     </li><li>
    28     Logging Level 3: Tremendous amount of information, e.g., multiple messages per node.
    29     </li></ul></div><div class="table"><a id="id3219432"/><p class="title"><b>Table 9.1. 
    30   CBC Messages Passed At Logging Level 0
    31   </b></p><table summary="&#10;  CBC Messages Passed At Logging Level 0&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
     22    Log Level 0: Switches off all CBC messages, but one.
     23    </li><li>
     24    Log Level 1: The default. 
     25    </li><li>
     26    Log Level 2: Substantial amount of information, e.g., message 15 is generated once per node. Can be useful when the evaluation at each node is slow.
     27    </li><li>
     28    Log Level 3: Tremendous amount of information, e.g., multiple messages per node.
     29    </li></ul></div><div class="table"><a id="id3249793"/><p class="title"><b>Table 9.1. 
     30  CBC Messages Passed At Log Level 0
     31  </b></p><table summary="&#10;  CBC Messages Passed At Log Level 0&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    3232      Code
    3333      </th><th> </th><th align="left">
     
    3737      </td><td> </td><td align="left"><tt class="computeroutput">No integer variables - nothing to do</tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    3838
    39       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3219576"/><p class="title"><b>Table 9.2. 
    40   CBC Messages Passed At or Above Logging Level 1
    41   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 1&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
     39      </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3249938"/><p class="title"><b>Table 9.2. 
     40  CBC Messages Passed At or Above Log Level 1
     41  </b></p><table summary="&#10;  CBC Messages Passed At or Above Log Level 1&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    4242      Code
    4343      </th><th> </th><th align="left">
     
    161161      </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    162162     
    163       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3220940"/><p class="title"><b>Table 9.3. 
    164   CBC Messages Passed At or Above Logging Level 2
    165   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 2&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
     163      </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3251301"/><p class="title"><b>Table 9.3. 
     164  CBC Messages Passed At or Above Log Level 2
     165  </b></p><table summary="&#10;  CBC Messages Passed At or Above Log Level 2&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    166166      Code
    167167      </th><th> </th><th align="left">
     
    191191      </tt></td><td class="auto-generated"> </td></tr><tr><td colspan="2"> </td><td align="left"><p>
    192192     
    193       </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3221341"/><p class="title"><b>Table 9.4. 
    194   CBC Messages Passed At or Above Logging Level 3
    195   </b></p><table summary="&#10;  CBC Messages Passed At or Above Logging Level 3&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
     193      </p></td><td class="auto-generated"> </td></tr></tbody></table></div><div class="table"><a id="id3251702"/><p class="title"><b>Table 9.4. 
     194  CBC Messages Passed At or Above Log Level 3
     195  </b></p><table summary="&#10;  CBC Messages Passed At or Above Log Level 3&#10;  " border="0"><colgroup><col/><col/><col/><col/></colgroup><thead><tr><th align="center">
    196196      Code
    197197      </th><th> </th><th align="left">
  • html/trunk/Cbc/index.html

    r554 r557  
    1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>CBC User Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"><link rel="home" href="index.html" title="CBC User Guide"><link rel="next" href="ch01.html" title="Chapter 1. 
    2     Introduction
    3   "></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CBC User Guide</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch01.html">Next</a></td></tr></table><hr></div><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="cbcuserguide"></a>CBC User Guide</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">
     1<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
     2<html xmlns="http://www.w3.org/1999/xhtml"><head><title>CBC User Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="next" href="ch01.html" title="Chapter 1. &#10;    Introduction&#10;  "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">CBC User Guide</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch01.html">Next</a></td></tr></table><hr/></div><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="cbcuserguide"/>CBC User Guide</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">
    43    John
    54    </span> <span class="surname">
     
    76    </span></h3><div class="affiliation"><span class="orgname">
    87      IBM Research
    9       <br></span></div></div><div class="author"><h3 class="author"><span class="firstname">
    10     David
    11     </span> <span class="surname">
    12     de la Nuez
    13     </span></h3><div class="affiliation"><span class="orgname">
    14       Columbia University &amp; IBM Research
    15       <br></span></div></div><div class="author"><h3 class="author"><span class="firstname">
     8      <br/></span></div></div><div class="author"><h3 class="author"><span class="firstname">
    169    Robin
    1710    </span> <span class="surname">
     
    1912    </span></h3><div class="affiliation"><span class="orgname">
    2013      IBM Research
    21       <br></span></div></div></div></div><div><p class="copyright">Copyright © 2005 IBM Coportation</p></div><div><div class="legalnotice">
     14      <br/></span></div></div></div></div><div><p class="copyright">Copyright © 2005 IBM Coportation</p></div><div><div class="legalnotice">
    2215CBC and this documentation are provided under the terms of the
    2316<a href="http://opensource.org/licenses/cpl.php" target="_top">Common Public License
     
    3124CPL FAQ</a> available which is based on IBM's understanding of the
    3225<a href="http://opensource.org/licenses/cpl.php" target="_top">CPL</a>.
    33 </div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="ch01.html">
     26</div></div></div><div/><hr/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>1. <a href="ch01.html">
    3427    Introduction
    35   </a></dt><dd><dl><dt><a href="ch01.html#id2826645">
     28  </a></dt><dd><dl><dt><a href="ch01.html#id3165529">
    3629  Welcome to CBC
    3730  </a></dt><dt><a href="ch01s02.html">
    3831  Prerequisites
    39   </a></dt></dl></dd><dt>2. <a href="ch02.html">
    40   Basic Model Classes
     32  </a></dt><dt><a href="ch01s03.html">Preliminaries</a></dt><dt><a href="ch01s04.html">
     33Branch-and-Cut Overview
     34</a></dt></dl></dd><dt>2. <a href="ch02.html">
     35   The CBC Model Class
    4136  </a></dt><dd><dl><dt><a href="ch02.html#hierarchy">
    42   Hierarchy and list of classes
     37  Overview
    4338  </a></dt><dt><a href="ch02s02.html">
    44   First Example
     39  Simple Branch-and-Bound Example
    4540  </a></dt><dt><a href="ch02s03.html">
    46   Getting at the Solution (CbcModel methods)
    47   </a></dt><dt><a href="ch02s04.html">Some Useful Set and Get Methods</a></dt><dt><a href="ch02s05.html">
    48   Methods which have a major impact on solution process
     41The Relationship Between OSI and CBC
     42</a></dt><dt><a href="ch02s04.html">
     43  Getting Solution Information
     44  </a></dt><dt><a href="ch02s05.html">
     45   Useful Set and Get Methods in CbcModel
     46  </a></dt><dt><a href="ch02s06.html">
     47  Impacting the Solution Process
    4948  </a></dt></dl></dd><dt>3. <a href="ch03.html">
    50   Other Classes and examples
    51   </a></dt><dd><dl><dt><a href="ch03.html#comparison">CbcCompare - Comparison methods</a></dt><dt><a href="ch03s02.html">CbcHeuristic - heuristic methods</a></dt><dt><a href="ch03s03.html">Branching</a></dt><dt><a href="ch03s04.html">Advanced use of solver</a></dt></dl></dd><dt>4. <a href="ch04.html">
    52   Building and Modifying a Model
    53   </a></dt><dd><dl><dt><a href="ch04.html#coinmodel">CoinModel</a></dt></dl></dd><dt>5. <a href="ch05.html">
     49  Selecting the Next Node in the Search Tree
     50  </a></dt><dd><dl><dt><a href="ch03.html#comparison">CbcCompare - Comparison Methods</a></dt></dl></dd><dt>4. <a href="ch04.html">
     51  Getting Good Bounds in CBC
     52  </a></dt><dd><dl><dt><a href="ch04.html#heuristics">CbcHeuristic - Heuristic Methods</a></dt></dl></dd><dt>5. <a href="ch05.html">
     53  Branching
     54 </a></dt><dd><dl><dt><a href="ch05.html#branchingIntro">Branching Overview</a></dt><dt><a href="ch05s02.html">Pseudo Cost Branching</a></dt><dt><a href="ch05s03.html">Follow-On Branching</a></dt></dl></dd><dt>6. <a href="ch06.html">Cutting planes</a></dt><dd><dl><dt><a href="ch06.html#cuts">Using Cut Generators with CBC</a></dt></dl></dd><dt>7. <a href="ch07.html">
     55  Advanced Solver Uses
     56</a></dt><dd><dl><dt><a href="ch07.html#solver">Creating a Solver via Inheritance</a></dt><dt><a href="ch07s02.html">Quadratic MIP</a></dt></dl></dd><dt>8. <a href="ch08.html">
    5457More Samples
    55 </a></dt><dd><dl><dt><a href="ch05.html#id2904722">CBC's Samples Directory</a></dt></dl></dd><dt>6. <a href="ch06.html">
     58</a></dt><dd><dl><dt><a href="ch08.html#id3247359">CBC's Samples Directory</a></dt></dl></dd><dt>9. <a href="ch09.html">
    5659  Messages
    57   </a></dt><dt>A. <a href="apa.html">FAQ</a></dt><dt>B. <a href="apb.html">Doxygen</a></dt><dt>C. <a href="apc.html">Revision History</a></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="ch01.html#id2826677">Associated classes</a></dt><dt>2.1. <a href="ch02.html#id2896498">Classes used by CbcModel - Most useful</a></dt><dt>2.2. <a href="ch02.html#id2897749">Classes used by CbcModel - Least useful</a></dt><dt>2.3. <a href="ch02s03.html#id2898257">
    58   Methods for getting solution information from OSI solver
    59   </a></dt><dt>2.4. <a href="ch02s04.html#id2898616">Some Useful Set and Get Methods</a></dt><dt>2.5. <a href="ch02s05.html#id2899565">Major methods</a></dt><dt>3.1. <a href="ch03.html#id2901322">Compare Classes provided</a></dt><dt>3.2. <a href="ch03.html#id2902562">Information available from CbcModel</a></dt><dt>5.1. <a href="ch05.html#id2904739">Basic Samples</a></dt><dt>5.2. <a href="ch05.html#id2905338">Advanced Samples</a></dt><dt>6.1. <a href="ch06.html#id2904621">
    60   COIN Messages passed at or above logging level 1
    61   </a></dt><dt>6.2. <a href="ch06.html#id2907202">
    62   CLP Messages passed at or above logging level 1
    63   </a></dt><dt>6.3. <a href="ch06.html#id2908139">
    64   COIN Messages passed at or above logging level 0
    65   </a></dt><dt>6.4. <a href="ch06.html#id2909208">
    66   CLP Messages passed at or above logging level 0
    67   </a></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="ch02s02.html#id2898102">minimum.cpp</a></dt><dt>3.1. <a href="ch03.html#id2902771">test</a></dt><dt>3.2. <a href="ch03.html#id2902794">newSolution</a></dt><dt>3.3. <a href="ch03.html#id2902874">newSolution</a></dt><dt>3.4. <a href="ch03s02.html#id2903012">Data</a></dt><dt>3.5. <a href="ch03s02.html#id2903038">initialize newSolution</a></dt><dt>3.6. <a href="ch03s02.html#id2903094">Create feasible new solution</a></dt><dt>3.7. <a href="ch03s02.html#id2903189">Check good solution</a></dt><dt>3.8. <a href="ch03s03.html#id2903248">Pseudo costs</a></dt><dt>3.9. <a href="ch03s03.html#id2903330">Follow-on branching</a></dt><dt>3.10. <a href="ch03s04.html#id2903439">initialSolve</a></dt><dt>3.11. <a href="ch03s04.html#id2903488">First few solves</a></dt><dt>3.12. <a href="ch03s04.html#id2903514">Create small problem</a></dt><dt>3.13. <a href="ch03s04.html#id2903555">Check optimal solution</a></dt><dt>3.14. <a href="ch03s04.html#id2903598">Solve a quadratic mip</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. 
     60  </a></dt><dt>A. <a href="apa.html">FAQ</a></dt><dt>B. <a href="apb.html">Doxygen</a></dt><dt>C. <a href="apc.html">Revision History</a></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="ch01s04.html#assClasses">Associated Classes</a></dt><dt>2.1. <a href="ch02s04.html#id3238631">
     61  Methods for Getting Solution Information from OSI
     62  </a></dt><dt>2.2. <a href="ch02s05.html#setGet">Useful Set and Get Methods in CbcModel</a></dt><dt>2.3. <a href="ch02s06.html#id3240115">Classes Used by CbcModel - Most Useful</a></dt><dt>2.4. <a href="ch02s06.html#least">Classes Used by CbcModel - Least Useful</a></dt><dt>3.1. <a href="ch03.html#compareTable">Compare Classes Provided</a></dt><dt>3.2. <a href="ch03.html#nodeTable">Information Available from CbcNode</a></dt><dt>8.1. <a href="ch08.html#id3248316">Basic Samples</a></dt><dt>8.2. <a href="ch08.html#id3248490">Advanced Samples</a></dt><dt>9.1. <a href="ch09.html#id3249793">
     63  CBC Messages Passed At Log Level 0
     64  </a></dt><dt>9.2. <a href="ch09.html#id3249938">
     65  CBC Messages Passed At or Above Log Level 1
     66  </a></dt><dt>9.3. <a href="ch09.html#id3251301">
     67  CBC Messages Passed At or Above Log Level 2
     68  </a></dt><dt>9.4. <a href="ch09.html#id3251702">
     69  CBC Messages Passed At or Above Log Level 3
     70  </a></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="ch02s02.html#minimum.cpp">minimum.cpp</a></dt><dt>3.1. <a href="ch03.html#test">CbcCompareUser::test()</a></dt><dt>3.2. <a href="ch03.html#newSolution">CbcCompareUser::newSolution()</a></dt><dt>3.3. <a href="ch03.html#everyK">CbcCompareUser::every1000Nodes()</a></dt><dt>4.1. <a href="ch04.html#id3244936">Data</a></dt><dt>4.2. <a href="ch04.html#id3244965">Initialize newSolution</a></dt><dt>4.3. <a href="ch04.html#id3245045">Create Feasible newSolution from Initial newSolution</a></dt><dt>4.4. <a href="ch04.html#id3245090">Check Solution Quality of newSolution</a></dt><dt>5.1. <a href="ch05s02.html#pseudo">CbcSimpleIntegerPseudoCosts</a></dt><dt>5.2. <a href="ch05s03.html#id3245459">CbcFollowOn</a></dt><dt>7.1. <a href="ch07.html#initialSolve">initialSolve()</a></dt><dt>7.2. <a href="ch07.html#id3245727">First Few Solves</a></dt><dt>7.3. <a href="ch07.html#id3245755">Create Small Sub-Problem</a></dt><dt>7.4. <a href="ch07.html#id3245801">Check Optimal Solution</a></dt><dt>7.5. <a href="ch07s02.html#id3245867">Solving a Quadratic MIP</a></dt></dl></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. 
    6871    Introduction
    6972  </td></tr></table></div></body></html>
Note: See TracChangeset for help on using the changeset viewer.