126 if ((
code().codes.size() == 0)
134 "illegal arc considering neighborhood restriction");
156 while (r_path.front() != 1) {
157 for (
const auto par :
parents(r_path.front())) {
158 if (par < r_path.front()) {
159 r_path.push_front(par);
EdgeCode & edgeCode(NodeId tail, NodeId head)
Returns the EdgeCode of an edge of this Pattern.
virtual void addNodeWithId(const NodeId id)
try to insert a node with the given id
virtual void addArc(const NodeId tail, const NodeId head)
insert a new arc into the directed graph
NodeId i
The DFS subscript of the first node in the code.
Inner class to handle data about labels in this interface graph.
Pattern()
Default constructor.
ArcProperty< std::pair< LabelData *, EdgeCode *> > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
NodeId j
The DFS subscript of the second node in the code.
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
DFSCode & code()
Returns the DFSCode of this Pattern.
Size size() const
alias for sizeNodes
NodeId addNodeWithLabel(LabelData &l)
Insert a node with the given LabelData.
Reprensent a Depth First Search coding of a graph.
bool exists(const NodeId id) const
alias for existsNode
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::vector< EdgeCode *> codes
The vector containing the EdgeCode composing this DFSCode.
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
bool empty() const
alias for emptyNodes
represent a DFS code used by gspan.
Size size() const
Returns the number of nodes in this Pattern.
Size sizeArcs() const
indicates the number of arcs stored within the ArcGraphPart
The base class for all directed edgesThis class is used as a basis for manipulating all directed edge...
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
Base class for all oriented graphs.
NodeProperty< LabelData *> __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Class for node sets in graph.
LabelData & lastAdded()
Insert a node with the given LabelData.
const NodeGraphPart & nodes() const
void rightmostPath(std::list< NodeId > &r_path) const
Fill r_path with the rightmost path of this Pattern. The list is supposed empty.
LabelData * __last
The last LabelData added to this pattern.
const ArcSet & arcs() const
Idx id
An unique identifier for this label.
void pop_back()
Remove the last EdgeCode of this pattern.
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
bool isForward() const
Returns true if this EdgeCode is a forward edge.
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
DFSCode __code
The DFSCode of this Pattern.
static bool validNeighbors(EdgeCode *e1, EdgeCode *e2)
Returns true of e2 is a valid neighbor for e1 (i.e.
void addArc(NodeId i, NodeId j, LabelData &l)
Add an arc to this Pattern.
bool exists(NodeId id) const
Returns true if id is a node in this Pattern.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
void remove(NodeId node)
Remove a node if it has no neighbors, raise an OperationNotAllowed otherwise.
Size sizeArcs() const
Returns the number of arcs in this Pattern.
This contains all the information we want for a node in a DFSTree.
bool existsArc(const Arc &arc) const
indicates whether a given arc exists
virtual void eraseNode(const NodeId id)
remove a node and its adjacent arcs from the graph
Size NodeId
Type for node ids.
#define GUM_ERROR(type, msg)