CbcModel is extremely flexible and customizable. The class structure of CBC is designed to make the most commonly desired customizations of branch-and-cut possible. These include:
To enable this flexibility, CbcModel 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 CbcModel that are of most interest and of least interest.
Table 2.3. Classes Used by CbcModel - Most Useful
Class name | Description | Notes |
---|---|---|
CbcCompareBase | Controls which node on the tree is selected. | The default is CbcCompareDefault. Other comparison classes in CbcCompareActual.hpp include CbcCompareDepth and CbcCompareObjective. Experimenting with these classes and creating new compare classes is easy. |
CbcCutGenerator | A wrapper for CglCutGenerator with additional data to control when the cut generator is invoked during the tree search. | Other than knowing how to add a cut generator to CbcModel, there is not much the average user needs to know about this class. However, sophisticated users can implement their own cut generators. |
CbcHeuristic | Heuristic that attempts to generate valid MIP-solutions leading to good upper bounds. | Specialized heuristics can dramatically improve branch-and-cut performance. As many different heuristics as desired can be used in CBC. Advanced users should consider implementing custom heuristics when tackling difficult problems. |
CbcObject | Defines what it means for a variable to be satisfied. Used in branching. | 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 CbcSimpleInteger, CbcSimpleIntegerPseudoCosts, CbcClique, CbcSOS (type 1 and 2), CbcFollowOn, and CbcLotsize. |
OsiSolverInterface | Defines the LP solver being used and the LP model. Normally a pointer to the desired OsiSolverInteface is passed to CbcModel before branch and cut. | Virtual class. The user instantiates the solver interface of their choice, e.g., OsiClpSolverInterface. |
There is not much about the classes listed in Table 2.4 that the average user needs to know about.
Table 2.4. Classes Used by CbcModel - Least Useful
Class name | Description | Notes |
---|---|---|
CbcBranchDecision | Used in choosing which variable to branch on, however, most of the work is done by the definitions in CbcObject. | Defaults to CbcBranchDefaultDecision. |
CbcCountRowCut | Interface to OsiRowCut. It counts the usage so cuts can gracefully vanish. | See OsiRowCut for more details. |
CbcNode | Controls which variable/entity is selected to be branch on. | Controlled via CbcModel parameters. Information from CbcNode can be useful in creating customized node selection rules. |
CbcNodeInfo | Contains data on bounds, basis, etc. for one node of the search tree. | Header is located in CbcNode.hpp. |
CbcTree | Defines how the search tree is stored. | This class can be changed but it is not likely to be modified. |
CoinMessageHandler | Deals with message handling | The user can inherit from CoinMessageHandler to specialize message handling. |
CoinWarmStartBasis | Basis representation to be used by solver |