re-enable all elimination heuristics
This commit is contained in:
parent
7a3d39551b
commit
4af5a90b8b
packages/CLPBN/horus
@ -184,26 +184,43 @@ ElimGraph::getLowestCostNode (void) const
|
|||||||
{
|
{
|
||||||
EgNode* bestNode = 0;
|
EgNode* bestNode = 0;
|
||||||
unsigned minCost = std::numeric_limits<unsigned>::max();
|
unsigned minCost = std::numeric_limits<unsigned>::max();
|
||||||
unsigned cost = 0;
|
|
||||||
EGNeighs::const_iterator it;
|
EGNeighs::const_iterator it;
|
||||||
switch (elimHeuristic) {
|
switch (elimHeuristic) {
|
||||||
case MIN_NEIGHBORS: {
|
case MIN_NEIGHBORS: {
|
||||||
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
cost = getNeighborsCost (*it);
|
unsigned cost = getNeighborsCost (*it);
|
||||||
if (cost < minCost) {
|
if (cost < minCost) {
|
||||||
bestNode = *it;
|
bestNode = *it;
|
||||||
minCost = cost;
|
minCost = cost;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
break;
|
break;
|
||||||
case MIN_WEIGHT:
|
case MIN_WEIGHT: {
|
||||||
//cost = getWeightCost (unmarked_[i]);
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
|
unsigned cost = getWeightCost (*it);
|
||||||
|
if (cost < minCost) {
|
||||||
|
bestNode = *it;
|
||||||
|
minCost = cost;
|
||||||
|
}
|
||||||
|
}}
|
||||||
break;
|
break;
|
||||||
case MIN_FILL:
|
case MIN_FILL: {
|
||||||
//cost = getFillCost (unmarked_[i]);
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
|
unsigned cost = getFillCost (*it);
|
||||||
|
if (cost < minCost) {
|
||||||
|
bestNode = *it;
|
||||||
|
minCost = cost;
|
||||||
|
}
|
||||||
|
}}
|
||||||
break;
|
break;
|
||||||
case WEIGHTED_MIN_FILL:
|
case WEIGHTED_MIN_FILL: {
|
||||||
//cost = getWeightedFillCost (unmarked_[i]);
|
for (it = unmarked_.begin(); it != unmarked_.end(); ++ it) {
|
||||||
|
unsigned cost = getWeightedFillCost (*it);
|
||||||
|
if (cost < minCost) {
|
||||||
|
bestNode = *it;
|
||||||
|
minCost = cost;
|
||||||
|
}
|
||||||
|
}}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert (false);
|
assert (false);
|
||||||
|
@ -130,9 +130,9 @@ class ElimGraph
|
|||||||
|
|
||||||
void connectAllNeighbors (const EgNode*);
|
void connectAllNeighbors (const EgNode*);
|
||||||
|
|
||||||
vector<EgNode*> nodes_;
|
vector<EgNode*> nodes_;
|
||||||
TinySet<EgNode*> unmarked_;
|
TinySet<EgNode*> unmarked_;
|
||||||
unordered_map<VarId, EgNode*> varMap_;
|
unordered_map<VarId, EgNode*> varMap_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HORUS_ELIMGRAPH_H
|
#endif // HORUS_ELIMGRAPH_H
|
||||||
|
Reference in New Issue
Block a user