aGrUM  0.16.0
gum::prm::gspan::EdgeGrowth< GUM_SCALAR > Class Template Reference

This class is used to define an edge growth of a pattern in this DFSTree. More...

#include <agrum/PRM/DFSTree.h>

+ Collaboration diagram for gum::prm::gspan::EdgeGrowth< GUM_SCALAR >:

Public Attributes

NodeId u
 The id of the node from which we grow an edge. More...
 
LabelDataedge
 The LabelData over the edge of this edge growth. More...
 
LabelDatal_v
 The LabelData over the node of this edge growth. More...
 
NodeId v
 If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that subscripts start from 1) More...
 
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > *> > matches
 The mapping between the u and v for each match in the interface graph. More...
 

Public Member Functions

 EdgeGrowth (NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
 Constructor. More...
 
 EdgeGrowth (const EdgeGrowth &from)
 Copy constructor. More...
 
 ~EdgeGrowth ()
 Destructor. More...
 
void insert (PRMInstance< GUM_SCALAR > *u, PRMInstance< GUM_SCALAR > *v)
 Add the pair (u,v) as a match for the current growth. More...
 
std::string toString ()
 Return a string representation of this. More...
 

Friends

class DFSTree< GUM_SCALAR >
 

Detailed Description

template<typename GUM_SCALAR>
class gum::prm::gspan::EdgeGrowth< GUM_SCALAR >

This class is used to define an edge growth of a pattern in this DFSTree.

Definition at line 63 of file edgeGrowth.h.

Constructor & Destructor Documentation

◆ EdgeGrowth() [1/2]

template<typename GUM_SCALAR >
INLINE gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::EdgeGrowth ( NodeId  a_u,
LabelData an_edge,
LabelData a_l_v,
NodeId  a_v = 0 
)

Constructor.

Definition at line 37 of file edgeGrowth_tpl.h.

40  :
41  u(a_u),
42  edge(an_edge), l_v(a_l_v), v(a_v),
43  degree_list(new std::vector< NodeId >()) {
44  GUM_CONSTRUCTOR(EdgeGrowth);
45  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:80
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:78
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:98
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:76
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:83
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.

◆ EdgeGrowth() [2/2]

template<typename GUM_SCALAR >
INLINE gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::EdgeGrowth ( const EdgeGrowth< GUM_SCALAR > &  from)

Copy constructor.

Definition at line 48 of file edgeGrowth_tpl.h.

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list.

49  :
50  u(from.u),
51  edge(from.edge), v(from.v), matches(from.matches),
52  iso_graph(from.iso_graph), degree_list(0),
53  max_indep_set(from.max_indep_set) {
54  GUM_CONS_CPY(EdgeGrowth);
55 
56  if (from.degree_list != 0) {
57  degree_list = new std::vector< NodeId >(*(from.degree_list));
58  }
59  }
Set< NodeId > max_indep_set
The max indep set of matches.
Definition: edgeGrowth.h:100
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > *> > matches
The mapping between the u and v for each match in the interface graph.
Definition: edgeGrowth.h:90
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:78
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:98
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:76
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:83
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:96
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.

◆ ~EdgeGrowth()

template<typename GUM_SCALAR >
INLINE gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::~EdgeGrowth ( )

Destructor.

Definition at line 62 of file edgeGrowth_tpl.h.

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list.

62  {
63  GUM_DESTRUCTOR(EdgeGrowth);
64 
65  if (degree_list != 0) { delete degree_list; }
66  }
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:98
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.

Member Function Documentation

◆ insert()

template<typename GUM_SCALAR >
void gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert ( PRMInstance< GUM_SCALAR > *  u,
PRMInstance< GUM_SCALAR > *  v 
)

Add the pair (u,v) as a match for the current growth.

Definition at line 76 of file edgeGrowth_tpl.h.

References gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNode(), gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::iso_graph, and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::matches.

Referenced by gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining().

77  {
78  NodeId id = iso_graph.addNode();
79  degree_list->push_back(id);
80 
81  for (const auto& elt : matches) {
82  if ((elt.second.first == u) || (elt.second.second == u)
83  || (elt.second.first == v) || (elt.second.second == v)) {
84  iso_graph.addEdge(elt.first, id);
85  }
86  }
87 
88  // The order between u and v is important ! DO NOT INVERSE IT !
89  matches.insert(id, std::make_pair(u, v));
90  }
virtual void addEdge(const NodeId first, const NodeId second)
insert a new edge into the undirected graph
Definition: undiGraph_inl.h:35
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > *> > matches
The mapping between the u and v for each match in the interface graph.
Definition: edgeGrowth.h:90
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:98
virtual NodeId addNode()
insert a new node and return its id
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:76
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:83
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:96
Size NodeId
Type for node ids.
Definition: graphElements.h:98
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toString()

template<typename GUM_SCALAR >
INLINE std::string gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::toString ( )

Return a string representation of this.

Definition at line 69 of file edgeGrowth_tpl.h.

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::edge, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::l_v, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::u, and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::v.

Referenced by gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining().

69  {
70  std::stringstream str;
71  str << u << "-" << edge << "-" << l_v << "-" << v;
72  return str.str();
73  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:80
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:78
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:76
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:83
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ DFSTree< GUM_SCALAR >

template<typename GUM_SCALAR>
friend class DFSTree< GUM_SCALAR >
friend

Definition at line 65 of file edgeGrowth.h.

Member Data Documentation

◆ degree_list

template<typename GUM_SCALAR>
std::vector< NodeId >* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list
private

◆ edge

template<typename GUM_SCALAR>
LabelData* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::edge

◆ iso_graph

template<typename GUM_SCALAR>
UndiGraph gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::iso_graph
private

The iso graph for computing the maximum independent set of matches.

Definition at line 96 of file edgeGrowth.h.

Referenced by gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert().

◆ l_v

template<typename GUM_SCALAR>
LabelData* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::l_v

◆ matches

template<typename GUM_SCALAR>
NodeProperty< std::pair< PRMInstance< GUM_SCALAR >*, PRMInstance< GUM_SCALAR >* > > gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::matches

The mapping between the u and v for each match in the interface graph.

Definition at line 90 of file edgeGrowth.h.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert().

◆ max_indep_set

template<typename GUM_SCALAR>
Set< NodeId > gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::max_indep_set
private

The max indep set of matches.

Definition at line 100 of file edgeGrowth.h.

◆ u

template<typename GUM_SCALAR>
NodeId gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::u

The id of the node from which we grow an edge.

Definition at line 76 of file edgeGrowth.h.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth(), gum::prm::gspan::operator<<(), and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::toString().

◆ v

template<typename GUM_SCALAR>
NodeId gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::v

If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that subscripts start from 1)

Definition at line 83 of file edgeGrowth.h.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth(), gum::prm::gspan::operator<<(), and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::toString().


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