Blis 0.95.0
Loading...
Searching...
No Matches
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-2023, 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 "BlisConfig.h"
36#include "BlisNodeDesc.h"
37
38class BcpsModel;
39class BlisModel;
40
41
42//#############################################################################
46//#############################################################################
47
48
49class BLISLIB_EXPORT BlisTreeNode : public BcpsTreeNode {
50private:
51
53 BlisTreeNode(const BlisTreeNode&);
54
55 BlisTreeNode& operator=(const BlisTreeNode&);
56
58 //BcpsConstraintPool *constraintPool_;
59
61 //BcpsVariablePool *variablePool_;
62
64 //void saveExplicit();
65
67 bool parallel(BlisModel *model,
68 BcpsConstraintPool &conPool,
69 int lastNew,
70 BlisConstraint *aCon);
71
73 double estimateSolution(BlisModel *model,
74 const double *lpSolution,
75 double lpObjValue) const;
76
77public:
78
81 :
82 BcpsTreeNode()
83 { init(); }
84
87 init();
88 desc_ = new BlisNodeDesc(m);
89 }
90
92 BlisTreeNode(AlpsNodeDesc *&desc) {
93 init();
94 desc_ = desc;
95 desc = NULL;
96 }
97
99 virtual ~BlisTreeNode() {
100 //std::cout << "------ Delete blis part of node" << std::endl;
101 }
102
104 void init() {
105 //constraintPool_ = new BcpsConstraintPool;
106 //variablePool_ = new BcpsVariablePool;
107 }
108
110 AlpsTreeNode* createNewTreeNode(AlpsNodeDesc *&desc) const;
111
114 virtual void convertToExplicit();
115 virtual void convertToRelative();
117
119 virtual int installSubProblem(BcpsModel *mode);
120
122 virtual int process(bool isRoot = false, bool rampUp = false);
123
125 virtual int bound(BcpsModel *model);
126
131 virtual std::vector< CoinTriple<AlpsNodeDesc*, AlpsNodeStatus, double> >
133
136 bool& foundSol,
137 int numPassesLeft);
138
140 virtual int chooseBranchingObject(BcpsModel*) { return AlpsReturnStatusOk;}
141
142 // Why need below?
143 //using BcpsTreeNode::generateConstraints ;
144
146 int generateConstraints(BlisModel *model, BcpsConstraintPool &conPool);
147
152 int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false);
153
156 const double *currLpSolution,
157 BcpsConstraintPool & conPool);
158
161 const double *solution,
162 BcpsConstraintPool & conPool);
163
166
168 //BcpsConstraintPool * constraintPool() { return constraintPool_; }
169
171 //BcpsVariablePool * variablePool() { return variablePool_; }
172
173 using AlpsKnowledge::encode ;
175 virtual AlpsEncoded* encode() const;
176
178 virtual AlpsKnowledge* decode(AlpsEncoded&) const;
179};
180
181#endif
BlisReturnStatus
Definition Blis.h:48
This is the class in which we are finally able to concretely define the bounding procedure.
Definition BlisSubTree.h:35
virtual void convertToRelative()
virtual int bound(BcpsModel *model)
Bounding procedure.
int generateConstraints(BlisModel *model, BcpsConstraintPool &conPool)
Generate constraints.
AlpsTreeNode * createNewTreeNode(AlpsNodeDesc *&desc) const
Create a new node based on given desc.
int selectBranchObject(BlisModel *model, bool &foundSol, int numPassesLeft)
Select a branching object based on give branching strategy.
BlisTreeNode(AlpsNodeDesc *&desc)
Useful constructor.
virtual int process(bool isRoot=false, bool rampUp=false)
Performing the bounding operation.
virtual int installSubProblem(BcpsModel *mode)
intall subproblem
virtual int chooseBranchingObject(BcpsModel *)
To be defined.
BlisReturnStatus reducedCostFix(BlisModel *model)
Fix and tighten varaibles based optimality conditions.
virtual ~BlisTreeNode()
Destructor.
virtual AlpsKnowledge * decode(AlpsEncoded &) const
Decode a node from an encoded object.
void getViolatedConstraints(BlisModel *model, const double *currLpSolution, BcpsConstraintPool &conPool)
Get violated constraints.
BlisTreeNode()
Default constructor.
BlisTreeNode(BlisModel *m)
Useful constructor.
BlisReturnStatus applyConstraints(BlisModel *model, const double *solution, BcpsConstraintPool &conPool)
Select and apply constraints.
virtual std::vector< CoinTriple< AlpsNodeDesc *, AlpsNodeStatus, double > > branch()
Takes the explicit description of the current active node and creates the children's descriptions,...
void init()
Initilize member data when constructing a node.
virtual void convertToExplicit()
Convert explicit description to difference, and vise-vesa.
int callHeuristics(BlisModel *model, bool onlyBeforeRoot=false)
Call heuristic to search solutions.
virtual AlpsEncoded * encode() const
Encode this node for message passing.
#define BLISLIB_EXPORT
Definition config.h:5