166 while (r_path.front() != 1) {
167 for (
const auto par:
parents(r_path.front())) {
168 if (par < r_path.front()) {
169 r_path.push_front(par);
bool existsArc(const Arc &arc) const
indicates whether a given arc exists
Size sizeArcs() const
indicates the number of arcs stored within the ArcGraphPart
const NodeSet & parents(NodeId id) const
returns the set of nodes with arc ingoing to a given node
NodeSet children(const NodeSet &ids) const
returns the set of children of a set of nodes
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
The base class for all directed edges.
virtual void eraseNode(const NodeId id)
remove a node and its adjacent arcs from the graph
DiGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
virtual void addArc(const NodeId tail, const NodeId head)
insert a new arc into the directed graph
Size size() const
alias for sizeNodes
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
bool exists(const NodeId id) const
alias for existsNode
bool empty() const
alias for emptyNodes
NodeGraphPart(Size holes_size=HashTableConst::default_size, bool holes_resize_policy=true)
default constructor
virtual void addNodeWithId(const NodeId id)
try to insert a node with the given id
Exception : the element we looked for cannot be found.
Exception : operation not allowed.
Reprensent a Depth First Search coding of a graph.
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
static bool validNeighbors(EdgeCode *e1, EdgeCode *e2)
Returns true of e2 is a valid neighbor for e1 (i.e.
void rightmostPath(std::list< NodeId > &r_path) const
Fill r_path with the rightmost path of this Pattern. The list is supposed empty.
const ArcSet & arcs() const
NodeProperty< LabelData * > _node_map_
Mapping between nodes in this Pattern and their respective LabelData.
LabelData * _last_
The last LabelData added to this pattern.
NodeId addNodeWithLabel(LabelData &l)
Insert a node with the given LabelData.
Size size() const
Returns the number of nodes in this Pattern.
void pop_back()
Remove the last EdgeCode of this pattern.
DFSCode & code()
Returns the DFSCode of this Pattern.
ArcProperty< std::pair< LabelData *, EdgeCode * > > _arc_map_
Mapping between edges in this Pattern and their respective LabelData.
Size sizeArcs() const
Returns the number of arcs in this Pattern.
DFSCode _code_
The DFSCode of this Pattern.
Pattern()
Default constructor.
void remove(NodeId node)
Remove a node if it has no neighbors, raise an OperationNotAllowed otherwise.
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.
const NodeGraphPart & nodes() const
LabelData & lastAdded()
Insert a node with the given LabelData.
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
EdgeCode & edgeCode(NodeId tail, NodeId head)
Returns the EdgeCode of an edge of this Pattern.
#define GUM_ERROR(type, msg)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Set< Arc > ArcSet
Some typdefs and define for shortcuts ...
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities
represent a DFS code used by gspan.
NodeId i
The DFS subscript of the first node in the code.
bool isForward() const
Returns true if this EdgeCode is a forward edge.
NodeId j
The DFS subscript of the second node in the code.
Inner class to handle data about labels in this interface graph.
Idx id
An unique identifier for this label.