source: trunk/Cbc/examples/CbcBranchFollow2.hpp @ 2496

Last change on this file since 2496 was 2469, checked in by unxusr, 9 months ago

formatting

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