source: trunk/Cbc/examples/CbcBranchFollow2.hpp

Last change on this file was 1574, checked in by lou, 7 years ago

Change to EPL license notice.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1// $Id: CbcBranchFollow2.hpp 1574 2011-01-05 01:13:55Z forrest $
2// Copyright (C) 2004, 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#ifndef CbcBranchFollowOn2_H
7#define CbcBranchFollowOn2_H
8
9#include "CbcBranchActual.hpp"
10#include "CoinPackedMatrix.hpp"
11
12
13/** Define a follow on class.
14    The idea of this is that in air-crew scheduling problems crew may fly in on flight A
15    and out on flight B or on some other flight.  A useful branch is one which on one side
16    fixes all which go out on flight B to 0, while the other branch fixes all those that do NOT
17    go out on flight B to 0.
18
19    This tries to generalize so that cuts are produced with sum aij xj <= bi on each side.
20    It should be intelligent enough to fix if things can be fixed.
21    We also need to make sure branch cuts work properly (i.e. persistence).
22
23    This branching rule should be in addition to normal rules and have a high priority.
24*/
25
26class CbcFollowOn2 : public CbcObject {
27
28public:
29
30  // Default Constructor
31  CbcFollowOn2 ();
32
33  /** Useful constructor
34  */
35  CbcFollowOn2 (CbcModel * model);
36 
37  // Copy constructor
38  CbcFollowOn2 ( const CbcFollowOn2 &);
39   
40  /// Clone
41  virtual CbcObject * clone() const;
42
43  // Assignment operator
44  CbcFollowOn2 & operator=( const CbcFollowOn2& rhs);
45
46  // Destructor
47  ~CbcFollowOn2 ();
48 
49  /// Infeasibility - large is 0.5
50  virtual double infeasibility(int & preferredWay) const;
51
52  /// This looks at solution and sets bounds to contain solution
53  virtual void feasibleRegion();
54  /// Creates a branching object
55  virtual CbcBranchingObject * createBranch(int way) ;
56  /** As some computation is needed in more than one place - returns row.
57      Also returns other row and effective rhs (so we can know if cut)
58  */
59  virtual int gutsOfFollowOn2(int & otherRow, int & preferredWay,
60                              int & effectiveRhs) const;
61
62  /// get and set for maximum rhws (affects cuts as branch)
63  inline int maximumRhs() const
64  { return maximumRhs_;}
65  inline void setMaximumRhs(int value)
66  { maximumRhs_=value;}
67protected:
68  /// data
69  /// Matrix
70  CoinPackedMatrix matrix_;
71  /// Matrix by row
72  CoinPackedMatrix matrixByRow_; 
73  /// Possible rhs (if 0 then not possible)
74  int * rhs_;
75  /// If >1 then allow cuts if effective rhs <= this
76  int maximumRhs_;
77};
78
79#endif
Note: See TracBrowser for help on using the repository browser.