BlisTreeNode.h
Go to the documentation of this file.
1 /*===========================================================================*
2  * This file is part of the BiCePS Linear Integer Solver (BLIS). *
3  * *
4  * BLIS is distributed under the Eclipse Public License as part of the *
5  * COIN-OR repository (http://www.coin-or.org). *
6  * *
7  * Authors: *
8  * *
9  * Yan Xu, Lehigh University *
10  * Ted Ralphs, Lehigh University *
11  * *
12  * Conceptual Design: *
13  * *
14  * Yan Xu, Lehigh University *
15  * Ted Ralphs, Lehigh University *
16  * Laszlo Ladanyi, IBM T.J. Watson Research Center *
17  * Matthew Saltzman, Clemson University *
18  * *
19  * *
20  * Copyright (C) 2001-2013, Lehigh University, Yan Xu, and Ted Ralphs. *
21  * All Rights Reserved. *
22  *===========================================================================*/
23 
24 #ifndef BlisTreeNode_h_
25 #define BlisTreeNode_h_
26 
27 //#############################################################################
28 
29 #include "AlpsNodeDesc.h"
30 
31 #include "BcpsObjectPool.h"
32 #include "BcpsTreeNode.h"
33 
34 #include "BcpsNodeDesc.h"
35 #include "BlisNodeDesc.h"
36 
37 class BcpsModel;
38 class BlisModel;
39 
40 
41 //#############################################################################
45 //#############################################################################
46 
47 
48 class BlisTreeNode : public BcpsTreeNode {
49 private:
50 
52  BlisTreeNode(const BlisTreeNode&);
53 
55 
57  //BcpsConstraintPool *constraintPool_;
58 
60  //BcpsVariablePool *variablePool_;
61 
63  //void saveExplicit();
64 
66  bool parallel(BlisModel *model,
67  BcpsConstraintPool &conPool,
68  int lastNew,
69  BlisConstraint *aCon);
70 
72  double estimateSolution(BlisModel *model,
73  const double *lpSolution,
74  double lpObjValue) const;
75 
76 public:
77 
80  :
81  BcpsTreeNode()
82  { init(); }
83 
86  init();
87  desc_ = new BlisNodeDesc(m);
88  }
89 
92  init();
93  desc_ = desc;
94  desc = NULL;
95  }
96 
98  virtual ~BlisTreeNode() {
99  //std::cout << "------ Delete blis part of node" << std::endl;
100  }
101 
103  void init() {
104  //constraintPool_ = new BcpsConstraintPool;
105  //variablePool_ = new BcpsVariablePool;
106  }
107 
110 
112  virtual void convertToExplicit();
114  virtual void convertToRelative();
116 
118  virtual int installSubProblem(BcpsModel *mode);
119 
121  virtual int process(bool isRoot = false, bool rampUp = false);
122 
124  virtual int bound(BcpsModel *model);
125 
130  virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> >
131  branch();
132 
134  int selectBranchObject(BlisModel *model,
135  bool& foundSol,
136  int numPassesLeft);
137 
140 
141  // Why need below?
142  //using BcpsTreeNode::generateConstraints ;
143 
145  int generateConstraints(BlisModel *model, BcpsConstraintPool &conPool);
146 
151  int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false);
152 
154  void getViolatedConstraints(BlisModel *model,
155  const double *currLpSolution,
156  BcpsConstraintPool & conPool);
157 
160  const double *solution,
161  BcpsConstraintPool & conPool);
162 
165 
167  //BcpsConstraintPool * constraintPool() { return constraintPool_; }
168 
170  //BcpsVariablePool * variablePool() { return variablePool_; }
171 
172  using AlpsKnowledge::encode ;
174  virtual AlpsEncoded* encode() const;
175 
177  virtual AlpsKnowledge* decode(AlpsEncoded&) const;
178 };
179 
180 #endif
BlisTreeNode(BlisModel *m)
Useful constructor.
Definition: BlisTreeNode.h:85
virtual void process()
double estimateSolution(BlisModel *model, const double *lpSolution, double lpObjValue) const
Estimate quality of a feasible solution.
This is the class in which we are finally able to concretely define the bounding procedure.
Definition: BlisSubTree.h:33
AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *&desc) const
Create a new node based on given desc.
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
int applyConstraints(BlisModel *model, OsiCuts &cutPool, const double *solution)
Select and apply constraints.
virtual int bound(BcpsModel *model)
Bounding procedure.
int selectBranchObject(BlisModel *model, bool &foundSol, int numPassesLeft)
Select a branching object based on give branching strategy.
virtual std::vector< CoinTriple< AlpsNodeDesc *, AlpsNodeStatus, double > > branch()
Takes the explicit description of the current active node and creates the children&#39;s descriptions...
void getViolatedConstraints(BlisModel *model, const double *currLpSolution, BcpsConstraintPool &conPool)
Get violated constraints.
void init()
Initilize member data when constructing a node.
Definition: BlisTreeNode.h:99
int generateConstraints(BlisModel *model, OsiCuts &cutPool)
Generate constraints.
bool parallel(BlisModel *model, OsiCuts *newCutSet, int lastNew, OsiRowCut *rowCut)
Constraint pool.
This data structure is to contain the packed form of an encodable knowledge.
Definition: AlpsEncoded.h:25
int reducedCostFix(BlisModel *model)
Fix and tighten varaibles based optimality conditions.
This class holds one node of the search tree.
Definition: AlpsTreeNode.h:50
int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false)
Call heuristic to search solutions.
BlisTreeNode & operator=(const BlisTreeNode &)
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
Definition: AlpsKnowledge.h:51
virtual void convertToRelative()
Convert explicit description to difference, and vise-vesa.
virtual ~BlisTreeNode()
Destructor.
Definition: BlisTreeNode.h:98
virtual AlpsEncoded * encode() const
Return constraint pool.
BlisTreeNode(AlpsNodeDesc *&desc)
Useful constructor.
Definition: BlisTreeNode.h:91
virtual int chooseBranchingObject(BcpsModel *)
To be defined.
Definition: BlisTreeNode.h:139
virtual int installSubProblem(BcpsModel *mode)
intall subproblem
BlisTreeNode()
Default constructor.
Definition: BlisTreeNode.h:74
virtual AlpsKnowledge * decode(AlpsEncoded &) const
Decode a node from an encoded object.
virtual AlpsEncoded * encode() const
This method should encode the content of the object and return a pointer to the encoded form...
A class to refer to the description of a search tree node.
Definition: AlpsNodeDesc.h:35
BlisReturnStatus
Definition: Blis.h:48
AlpsNodeDesc * desc_
The actual description of the tree node.
Definition: AlpsTreeNode.h:95
This class contain the data for a BCPS search tree node.
Definition: BcpsTreeNode.h:46