38 #include <agrum/tools/core/timer.h> 40 #include <agrum/BN/inference/variableElimination.h> 42 #include <agrum/PRM/PRM.h> 43 #include <agrum/PRM/gspan/DFSTree.h> 44 #include <agrum/PRM/gspan/interfaceGraph.h> 69 template <
typename GUM_SCALAR >
85 GSpan(
const PRM< GUM_SCALAR >& prm,
86 const PRMSystem< GUM_SCALAR >& sys,
87 gspan::SearchStrategy< GUM_SCALAR >* strategy = 0);
103 Size getMaxDFSDepth()
const;
111 void setMaxDFSDepth(Size depth);
117 gspan::DFSTree< GUM_SCALAR >& tree();
123 const gspan::DFSTree< GUM_SCALAR >& tree()
const;
129 gspan::InterfaceGraph< GUM_SCALAR >& interfaceGraph();
135 const gspan::InterfaceGraph< GUM_SCALAR >& interfaceGraph()
const;
150 void discoverPatterns();
158 std::vector< gspan::Pattern* >& patterns();
166 const std::vector< gspan::Pattern* >& patterns()
const;
169 typedef Set< Sequence< PRMInstance< GUM_SCALAR >* >* > MatchedInstances;
177 MatchedInstances& matches(
const gspan::Pattern& p);
185 const MatchedInstances& matches(
const gspan::Pattern& p)
const;
215 gspan::InterfaceGraph< GUM_SCALAR >* graph__;
218 gspan::DFSTree< GUM_SCALAR > tree__;
224 std::vector< gspan::Pattern* > patterns__;
227 std::vector< gspan::LabelData* > nodes__;
230 std::vector< gspan::LabelData* > edges__;
233 HashTable< gspan::LabelData*, Idx > cost__;
237 HashTable< gspan::Pattern*, MatchedInstances* > matched_instances__;
240 Set< PRMInstance< GUM_SCALAR >* > chosen__;
249 void sortNodesAndEdges__();
254 void subgraph_mining__(gspan::InterfaceGraph< GUM_SCALAR >& graph,
262 Size cost_func__(Size interface_size, Size frequency);
265 void sortPatterns__();
270 bool isEdgeEligible__(
typename gspan::EdgeData< GUM_SCALAR >* e);
289 LabelSort(GSpan* my_gspan);
295 LabelSort(
const LabelSort& source);
308 bool operator()(gspan::LabelData* i, gspan::LabelData* j);
324 PatternSort(GSpan* my_gspan);
330 PatternSort(
const PatternSort& source);
343 bool operator()(gspan::Pattern* i, gspan::Pattern* j);
353 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS 354 extern template class GSpan<
double >;
361 #include <agrum/PRM/inference/gspan_tpl.h>