libDAI
|
Helper object for dai::ClusterGraph::VarElim() More...
#include <dai/clustergraph.h>
Public Types | |
typedef size_t(* | eliminationCostFunction) (const ClusterGraph &, size_t) |
Type of cost functions to be used for greedy variable elimination. More... | |
Public Member Functions | |
greedyVariableElimination (eliminationCostFunction h) | |
Construct from cost function. More... | |
size_t | operator() (const ClusterGraph &cl, const std::set< size_t > &remainingVars) |
Returns the best variable from remainingVars to eliminate in the cluster graph cl by greedily minimizing the cost function. More... | |
Private Attributes | |
eliminationCostFunction | heuristic |
Pointer to the cost function used. More... | |
Helper object for dai::ClusterGraph::VarElim()
Chooses the next variable to eliminate greedily by taking the one that minimizes a given heuristic cost function.
typedef size_t(* dai::greedyVariableElimination::eliminationCostFunction) (const ClusterGraph &, size_t) |
Type of cost functions to be used for greedy variable elimination.
|
inline |
Construct from cost function.
size_t dai::greedyVariableElimination::operator() | ( | const ClusterGraph & | cl, |
const std::set< size_t > & | remainingVars | ||
) |
Returns the best variable from remainingVars to eliminate in the cluster graph cl by greedily minimizing the cost function.
This function calculates the cost for eliminating each variable in remaingVars and returns the variable which has lowest cost.
|
private |
Pointer to the cost function used.