source: trunk/Cbc/src/CbcBranchDefaultDecision.hpp @ 1899

Last change on this file since 1899 was 1899, checked in by stefan, 5 years ago

fixup svn properties

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1// $Id: CbcBranchDefaultDecision.hpp 1899 2013-04-09 18:12:08Z stefan $
2// Copyright (C) 2002, International Business Machines
3// Corporation and others.  All Rights Reserved.
4// This code is licensed under the terms of the Eclipse Public License (EPL).
5
6// Edwin 11/10/2009-- carved out of CbcBranchActual
7
8#ifndef CbcBranchDefaultDecision_H
9#define CbcBranchDefaultDecision_H
10
11#include "CbcBranchBase.hpp"
12/** Branching decision default class
13
14  This class implements a simple default algorithm
15  (betterBranch()) for choosing a branching variable.
16*/
17
18class CbcBranchDefaultDecision : public CbcBranchDecision {
19public:
20    // Default Constructor
21    CbcBranchDefaultDecision ();
22
23    // Copy constructor
24    CbcBranchDefaultDecision ( const CbcBranchDefaultDecision &);
25
26    virtual ~CbcBranchDefaultDecision();
27
28    /// Clone
29    virtual CbcBranchDecision * clone() const;
30
31    /// Initialize, <i>e.g.</i> before the start of branch selection at a node
32    virtual void initialize(CbcModel * model);
33
34    /** \brief Compare two branching objects. Return nonzero if \p thisOne is
35           better than \p bestSoFar.
36
37      The routine compares branches using the values supplied in \p numInfUp and
38      \p numInfDn until a solution is found by search, after which it uses the
39      values supplied in \p changeUp and \p changeDn. The best branching object
40      seen so far and the associated parameter values are remembered in the
41      \c CbcBranchDefaultDecision object. The nonzero return value is +1 if the
42      up branch is preferred, -1 if the down branch is preferred.
43
44      As the names imply, the assumption is that the values supplied for
45      \p numInfUp and \p numInfDn will be the number of infeasibilities reported
46      by the branching object, and \p changeUp and \p changeDn will be the
47      estimated change in objective. Other measures can be used if desired.
48
49      Because an \c CbcBranchDefaultDecision object remembers the current best
50      branching candidate (#bestObject_) as well as the values used in the
51      comparison, the parameter \p bestSoFar is redundant, hence unused.
52    */
53    virtual int betterBranch(CbcBranchingObject * thisOne,
54                             CbcBranchingObject * bestSoFar,
55                             double changeUp, int numInfUp,
56                             double changeDn, int numInfDn);
57    /** Sets or gets best criterion so far */
58    virtual void setBestCriterion(double value);
59    virtual double getBestCriterion() const;
60
61    /** \brief Compare N branching objects. Return index of best
62        and sets way of branching in chosen object.
63
64      This routine is used only after strong branching.
65    */
66
67    virtual int
68    bestBranch (CbcBranchingObject ** objects, int numberObjects, int numberUnsatisfied,
69                double * changeUp, int * numberInfeasibilitiesUp,
70                double * changeDown, int * numberInfeasibilitiesDown,
71                double objectiveValue) ;
72private:
73
74    /// Illegal Assignment operator
75    CbcBranchDefaultDecision & operator=(const CbcBranchDefaultDecision& rhs);
76
77    /// data
78
79    /// "best" so far
80    double bestCriterion_;
81
82    /// Change up for best
83    double bestChangeUp_;
84
85    /// Number of infeasibilities for up
86    int bestNumberUp_;
87
88    /// Change down for best
89    double bestChangeDown_;
90
91    /// Pointer to best branching object
92    CbcBranchingObject * bestObject_;
93
94    /// Number of infeasibilities for down
95    int bestNumberDown_;
96
97};
98
99#endif
100
Note: See TracBrowser for help on using the repository browser.