- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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
54 BlisTreeNode& operator=(const BlisTreeNode&);
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
79 BlisTreeNode()
80 :
81 BcpsTreeNode()
82 { init(); }
83
85 BlisTreeNode(BlisModel* m) {
86 init();
87 desc_ = new BlisNodeDesc(m);
88 }
89
91 BlisTreeNode(AlpsNodeDesc *&desc) {
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
109 AlpsTreeNode* createNewTreeNode(AlpsNodeDesc *&desc) const;
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
139 virtual int chooseBranchingObject(BcpsModel*) { return AlpsReturnStatusOk;}
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
159 BlisReturnStatus applyConstraints(BlisModel *model,
160 const double *solution,
161 BcpsConstraintPool & conPool);
162
164 BlisReturnStatus reducedCostFix(BlisModel *model);
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
BlisModel
Definition: BlisModel.h:60
BlisTreeNode::BlisTreeNode
BlisTreeNode(BlisModel *m)
Useful constructor.
Definition: BlisTreeNode.h:85
BlisNodeDesc.h
AlpsNodeDesc.h
BlisTreeNode::process
virtual void process()
BlisTreeNode::estimateSolution
double estimateSolution(BlisModel *model, const double *lpSolution, double lpObjValue) const
Estimate quality of a feasible solution.
BlisTreeNode
This is the class in which we are finally able to concretely define the bounding procedure.
Definition: BlisSubTree.h:33
BlisTreeNode::createNewTreeNode
AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *&desc) const
Create a new node based on given desc.
BlisTreeNode::convertToExplicit
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
BlisTreeNode::applyConstraints
int applyConstraints(BlisModel *model, OsiCuts &cutPool, const double *solution)
Select and apply constraints.
BlisTreeNode::bound
virtual int bound(BcpsModel *model)
Bounding procedure.
BlisTreeNode::selectBranchObject
int selectBranchObject(BlisModel *model, bool &foundSol, int numPassesLeft)
Select a branching object based on give branching strategy.
BlisTreeNode::branch
virtual std::vector< CoinTriple< AlpsNodeDesc *, AlpsNodeStatus, double > > branch()
Takes the explicit description of the current active node and creates the children&#39;s descriptions...
BlisTreeNode::getViolatedConstraints
void getViolatedConstraints(BlisModel *model, const double *currLpSolution, BcpsConstraintPool &conPool)
Get violated constraints.
BlisTreeNode::init
void init()
Initilize member data when constructing a node.
Definition: BlisTreeNode.h:99
BlisTreeNode::generateConstraints
int generateConstraints(BlisModel *model, OsiCuts &cutPool)
Generate constraints.
BlisTreeNode::parallel
bool parallel(BlisModel *model, OsiCuts *newCutSet, int lastNew, OsiRowCut *rowCut)
Constraint pool.
AlpsEncoded
This data structure is to contain the packed form of an encodable knowledge.
Definition: AlpsEncoded.h:25
BcpsObjectPool.h
AlpsReturnStatusOk
Definition: Alps.h:119
BlisTreeNode::reducedCostFix
int reducedCostFix(BlisModel *model)
Fix and tighten varaibles based optimality conditions.
AlpsTreeNode
This class holds one node of the search tree.
Definition: AlpsTreeNode.h:50
BlisTreeNode::callHeuristics
int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false)
Call heuristic to search solutions.
BcpsModel
Definition: BcpsModel.h:40
BcpsConstraintPool
Definition: BcpsObjectPool.h:104
BlisTreeNode::operator=
BlisTreeNode & operator=(const BlisTreeNode &)
BcpsTreeNode.h
AlpsKnowledge
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
Definition: AlpsKnowledge.h:51
BlisTreeNode::convertToRelative
virtual void convertToRelative()
Convert explicit description to difference, and vise-vesa.
BlisTreeNode::~BlisTreeNode
virtual ~BlisTreeNode()
Destructor.
Definition: BlisTreeNode.h:98
BlisTreeNode::encode
virtual AlpsEncoded * encode() const
Return constraint pool.
BlisNodeDesc
Definition: BlisNodeDesc.h:40
BlisTreeNode::BlisTreeNode
BlisTreeNode(AlpsNodeDesc *&desc)
Useful constructor.
Definition: BlisTreeNode.h:91
BlisTreeNode::chooseBranchingObject
virtual int chooseBranchingObject(BcpsModel *)
To be defined.
Definition: BlisTreeNode.h:139
BlisTreeNode::installSubProblem
virtual int installSubProblem(BcpsModel *mode)
intall subproblem
BlisConstraint
Definition: BlisConstraint.h:31
BlisTreeNode::BlisTreeNode
BlisTreeNode()
Default constructor.
Definition: BlisTreeNode.h:74
BlisTreeNode::decode
virtual AlpsKnowledge * decode(AlpsEncoded &) const
Decode a node from an encoded object.
BcpsNodeDesc.h
AlpsKnowledge::encode
virtual AlpsEncoded * encode() const
This method should encode the content of the object and return a pointer to the encoded form...
AlpsNodeDesc
A class to refer to the description of a search tree node.
Definition: AlpsNodeDesc.h:35
BlisReturnStatus
BlisReturnStatus
Definition: Blis.h:48
AlpsTreeNode::desc_
AlpsNodeDesc * desc_
The actual description of the tree node.
Definition: AlpsTreeNode.h:95
BcpsTreeNode
This class contain the data for a BCPS search tree node.
Definition: BcpsTreeNode.h:46