49#ifndef GUM_SEARCHSTRATEGY_H
50#define GUM_SEARCHSTRATEGY_H
62 template < GUM_Numeric GUM_SCALAR >
66 template < GUM_Numeric GUM_SCALAR >
80 template < GUM_Numeric GUM_SCALAR >
106 void setTree(DFSTree< GUM_SCALAR >* tree);
132 template < GUM_Numeric GUM_SCALAR >
182 template < GUM_Numeric GUM_SCALAR >
254 Set< Tensor< GUM_SCALAR >* >& pool,
257 Set< Tensor< GUM_SCALAR >* >& pool);
269 template < GUM_Numeric GUM_SCALAR >
312#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
313# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
314# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
315# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
321#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
322# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
323# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
324# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
330#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
331# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
332# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
333# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
339#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
340# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
341# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
342# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
The class for generic Hash Tables.
The generic class for storing (ordered) sequences of objects.
Base class for undirected graphs.
This class discovers pattern in a PRM<GUM_SCALAR>'s PRMSystem<GUM_SCALAR> to speed up structured infe...
PRMAttribute is a member of a Class in a PRM.
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph.
This class is used to define an edge growth of a pattern in this DFSTree.
This is class is an implementation of a simple serach strategy for the gspan algorithm: it accept a g...
bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth) override
FrequenceSearch(Size freq)
Default constructor.
bool accept_root(const Pattern *r) override
bool operator()(LabelData *i, LabelData *j) override
FrequenceSearch & operator=(const FrequenceSearch &from)
Copy operator.
~FrequenceSearch() override
Destructor.
This contains all the information we want for a node in a DFSTree.
This is an abstract class used to tune search strategies in the gspan algorithm.
double computeCost_(const Pattern &p)
virtual bool operator()(LabelData *i, LabelData *j)=0
virtual ~SearchStrategy()
Destructor.
SearchStrategy< GUM_SCALAR > & operator=(const SearchStrategy< GUM_SCALAR > &from)
Copy operator.
virtual bool operator()(Pattern *i, Pattern *j)=0
DFSTree< GUM_SCALAR > * tree_
void setTree(DFSTree< GUM_SCALAR > *tree)
SearchStrategy()
Default constructor.
virtual bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth)=0
virtual bool accept_root(const Pattern *r)=0
This is class is an implementation of a strict strategy for the GSpan algorithm.
StrictSearch(Size freq=2)
Default constructor.
bool accept_root(const Pattern *r) override
bool operator()(LabelData *i, LabelData *j) override
HashTable< const Pattern *, std::pair< double, double > > _map_
double _inner_cost_(const Pattern *p)
StrictSearch & operator=(const StrictSearch &from)
Copy operator.
~StrictSearch() override
Destructor.
void _buildPatternGraph_(typename StrictSearch< GUM_SCALAR >::PData &data, Set< Tensor< GUM_SCALAR > * > &pool, const Sequence< PRMInstance< GUM_SCALAR > * > &match)
void _compute_costs_(const Pattern *p)
std::pair< Size, Size > _elimination_cost_(typename StrictSearch< GUM_SCALAR >::PData &data, Set< Tensor< GUM_SCALAR > * > &pool)
bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth) override
double _outer_cost_(const Pattern *p)
std::string _str_(const PRMInstance< GUM_SCALAR > *i, const PRMAttribute< GUM_SCALAR > *a) const
A growth is accepted if and only if the new growth has a tree width less large or equal than its fath...
TreeWidthSearch()
Default constructor.
~TreeWidthSearch() override
Destructor.
HashTable< const Pattern *, double > _map_
TreeWidthSearch & operator=(const TreeWidthSearch &from)
Copy operator.
bool accept_root(const Pattern *r) override
bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth) override
double cost(const Pattern &p)
bool operator()(LabelData *i, LabelData *j) override
Headers of the DFSTree class.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities
Inline implementation of the SearchStrategy class.
Inner class to handle data about labels in this interface graph.
Private structure to represent data about a pattern.
Bijection< NodeId, std::string > node2attr
A bijection to easily keep track between graph and attributes, its of the form instance_name DOT attr...
NodeProperty< Size > mod
The pattern's variables modalities.
UndiGraph graph
A yet to be triangulated undigraph.
NodeSet outputs
Returns the set of outputs nodes given all the matches of pattern.
NodeSet inners
Returns the set of inner nodes.
Bijection< NodeId, const DiscreteVariable * > vars
Bijection between graph's nodes and their corresponding DiscreteVariable, for inference purpose.