source: stable/1.1/Cbc/doc/intro.xml @ 1944

Last change on this file since 1944 was 120, checked in by rlh, 16 years ago

Rennovated Cbc user guide for INFORMS Tutorial book chapter

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.0 KB
1<?xml version="1.0" encoding="ISO-8859-1"?>
2  <chapter id="intro">
3  <title>
4    Introduction
5  </title>
6  <section>
7  <title>
8  Welcome to CBC
9  </title>
10  <para>
11  The COIN
12    <footnote>
13        <para>
14        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".
15        </para>
16      </footnote>
17Branch and Cut solver (CBC) is an open-source mixed-integer program (MIP) solver written  in C++.<!-- some intro here to MIP or to open-source --> CBC is intended to be used primarily as a callable library to create customized branch-and-cut solvers. A basic, stand-alone <!-- do link **** link linkend="cbcexe"--> executable version is also available. CBC is an active open-source project led by John Forrest at
18 </para>
19 </section>
21  <section>
22  <title>
23  Prerequisites
24  </title>
25  <para>
26  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
27  <ulink url="">C++</ulink>, including basic
28  object-oriented programming terminology, and familiarity with the fundamental concepts of
29  <ulink url="">
30  linear programming</ulink> and
31  <ulink url="">
32  mixed integer programming</ulink>. <!-- any better mip links? -->
33  </para>
35  <para>
36<!-- dependencies -->
37CBC 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 <classname>CoinFactorization</classname>. This document assumes basic familiarity with OSI and CGL.
40Technically speaking, CBC assesses the solver (and sometime the model and data it contains) through an <classname>OSISolverInterface</classname>. For the sake of simplicity, we will refer to the <classname>OsiSolverInterface</classname> 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. 
41 <!-- need a link to OSI and CGL documentation. Shoot, need OSI and CGL documentation! -->
42 </para>
44In summary, readers should have the following prerequisites:
45   <itemizedlist>
46    <listitem>
47    <simpara>
48    C++ knowledge,
49    </simpara>
50    </listitem>
51    <listitem>
52    <simpara>
53    LP and MIP fundamentals, and   
54    </simpara>
55    </listitem>
56    <listitem>
57    <simpara>
58    OSI familiarity.
59    </simpara>
60    </listitem>
61    </itemizedlist>
64Unless otherwise stated, we will assume the problem being optimized is a minimization problem. The terms "model" and "problem" are used synonymously.
66 </section>
70Branch-and-Cut Overview
72  <para>
73  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 <xref linkend="assClasses"/>.
74 </para>
76  <para>
77Step 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.   
78 </para>
79 <para> 
80Step 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.
81 </para>
82 <para>
83While (search tree is not empty) {
86   Step 3. (Choose Node) Pick a node off the tree (C)(D)
89   Step 4. (Re-optimize LP) Create an LP relaxation and solve.
92   Step 5. (Bound) Interrogate the optimal LP solution, and try to prune the node by one of the following.
93   <itemizedlist>
94    <listitem>
95    <simpara>
96    LP is infeasible, prune the node.
97    </simpara>
98    </listitem>
99    <listitem>
100    <simpara>
101    Else, the optimal LP solution value of the node exceeds the current upper bound, prune the node. 
102    </simpara>
103    </listitem>
104    <listitem>
105    <simpara>
106    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.         
107    </simpara>
108    </listitem>
109    </itemizedlist> 
112   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.
114 </para>
115 <para>     
116This 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.)
118  <!-- rlh: this explaination is for people who already know b&c -->
119  </para>
120  <table frame="none" id="assClasses">
121  <title>Associated Classes</title>
122    <tgroup cols="3">
123    <thead>
124    <row>
125    <entry>
126    Note
127    </entry>
128    <entry>
129    Class name
130    </entry>
131    <entry>
132    Description
133    </entry>
134    </row>
135    </thead>
136    <tbody>
137    <row>
138      <entry align="left" valign="top">
139      (A)
140      </entry>
141      <entry align="left" valign="top">
142      <classname>CbcBranch...</classname>
143      </entry>
144      <entry align="left" valign="top">
145      These classes define the nature of MIP's discontinuity.  The simplest discontinuity
146      is a variable which must take an integral value. Other types of discontinuities
147      exist, e.g., lot-sizing variables.
148      <!--rlh: why "...."? Currently 4: CbcBranchActual.cpp, CbcBranchBase.cpp CbcBranchCut.cpp, CbcBranchLotsizes.cpp--> 
149      </entry>
150    </row>
151    <row>
152      <entry align="left" valign="top">
153      (B)
154      </entry>
155      <entry align="left" valign="top">
156      <classname>CbcNode</classname>
157      </entry>
158      <entry align="left" valign="top">
159      This class decides which variable/entity to branch on next.
160      Even advanced users will probably only interact with this class by setting
161      <classname>CbcModel</classname> parameters ( e.g., priorities).
162      </entry>
163    </row>
164    <row>
165      <entry align="left" valign="top">
166      (C)
167      </entry>
168      <entry align="left" valign="top">
169      <classname>CbcTree</classname>
170      </entry>
171      <entry align="left" valign="top">
172      All unsolved models can be thought of as being nodes on a tree where each
173      node (model) can branch two or more times.  The user should not need to be
174      concerned with this class.
175      </entry>
176    </row>
177    <row>
178      <entry align="left" valign="top">
179      (D)
180      </entry>
181      <entry align="left" valign="top">
182      <classname>CbcCompare...</classname>
183      </entry>
184      <entry align="left" valign="top">
185      These classes are used in determine which of the unexplored nodes in the tree to consider next. These
186      classes are very small simple classes that can be tailored to suit the problem.
187      <!--rlh: Classes? Currently only 1: CbcCompateActual.cpp-->
188      </entry>
189    </row>
190    <row>
191      <entry align="left" valign="top">
192      (E)
193      </entry>
194      <entry align="left" valign="top">
195      <classname>CglCutGenerators</classname>
196      </entry>
197      <entry align="left" valign="top">
198      Any cut generator from CGL can be used in CBC. The cut generators are passed to CBC with parameters
199      which modify when each generator will be tried. All cut generators should be tried to
200      determine which are effective. Few users will write their own cut generators.
201      </entry>
202    </row>
203    <row>
204      <entry align="left" valign="top">
205      (F)
206      </entry>
207      <entry align="left" valign="top">
208      <classname>CbcHeuristics</classname>
209      </entry>
210      <entry align="left" valign="top">
211      Heuristics are very important for obtaining valid solutions quickly.  Some
212      heuristics are available, but this is an area where it is useful and interesting to
213      write specialized ones.
214      </entry>
215    </row>
216    </tbody>
217  </tgroup>
218  </table>
220  There are a number of resources available to help new CBC users get started.
221  This document is designed to be used in conjunction with the files in the
222  Samples subdirectory of the main CBC directory (<filename>COIN/Cbc/Samples</filename>).
223  The Samples illustrate how to use CBC and may also serve as useful starting points
224  for user projects.  In the event that either this document or the available
225  <link linkend="doxygen">Doxygen content</link> conflicts with the observed
226  behavior of the source code, the comments in the header files, found in
227  <filename>COIN/Cbc/include</filename>, are the ultimate reference.
228  </para>
229  </section>
231  </chapter>
Note: See TracBrowser for help on using the repository browser.