libDAI
Public Types | Public Member Functions | Private Attributes | List of all members
dai::greedyVariableElimination Class Reference

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...
 

Detailed Description

Helper object for dai::ClusterGraph::VarElim()

Chooses the next variable to eliminate greedily by taking the one that minimizes a given heuristic cost function.

Member Typedef Documentation

typedef size_t(* dai::greedyVariableElimination::eliminationCostFunction) (const ClusterGraph &, size_t)

Type of cost functions to be used for greedy variable elimination.

Constructor & Destructor Documentation

dai::greedyVariableElimination::greedyVariableElimination ( eliminationCostFunction  h)
inline

Construct from cost function.

Note
Examples of cost functions are eliminationCost_MinFill() and eliminationCost_WeightedMinFill().

Member Function Documentation

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.

Member Data Documentation

eliminationCostFunction dai::greedyVariableElimination::heuristic
private

Pointer to the cost function used.


The documentation for this class was generated from the following files: