void unvirtualizedEraseNeighbours(NodeId id)
same function as eraseNeighbours but without any virtual call to an erase
EdgeGraphPart & operator=(const EdgeGraphPart &s)
copy operator
bool operator==(const EdgeGraphPart &p) const
tests whether two EdgeGraphParts contain the same edges
virtual void addEdge(NodeId n1, NodeId n2)
insert a new edge into the EdgeGraphPart
virtual void clearEdges()
removes all the edges from the EdgeGraphPart
Exception : node does not exist.
virtual void eraseNode(const NodeId id)
erase the node with the given id
NodeGraphPart & operator=(const NodeGraphPart &p)
copy operator
bool exists(const NodeId id) const
alias for existsNode
virtual void clearNodes()
remove all the nodes from the NodeGraphPart
bool operator==(const NodeGraphPart &p) const
check whether two NodeGraphParts contain the same nodes
bool operator==(const UndiGraph &g) const
tests whether two UndiGraphs are identical (same nodes, same edges)
UndiGraph & operator=(const UndiGraph &g)
copy operator
void clear() override
removes all the nodes and edges from the graph
NodeProperty< NodeId > chainComponents() const
returns a property {node:id of chain component} (edges only)
void addEdge(NodeId first, NodeId second) override
insert a new edge into the undirected graph
bool hasUndirectedPath(NodeId n1, NodeId n2) const
returns true if n1 and n2 are connected by an undirected path
bool hasUndirectedCycle() const
checks whether the graph contains cycles
NodeProperty< NodeId > connectedComponents() const
returns a property {node:id of weakly connected component}
std::optional< std::vector< NodeId > > undirectedPath(NodeId node1, NodeId node2) const
returns a shortest undirected path from node1 to node2, or std::nullopt if none
void eraseNode(NodeId id) override
remove a node and its adjacent edges from the graph
UndiGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true)
default constructor
Generic cycle-detection algorithms for aGrUM graphs.
#define GUM_ERROR(type, msg)
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
bool hasUndirectedCycle(const G &g)
Returns true if g contains at least one undirected cycle.
std::optional< std::vector< NodeId > > undirectedPath(const G &g, NodeId n1, NodeId n2)
Shortest undirected path from n1 to n2 (BFS).
NodeProperty< NodeId > chainComponents(const G &g)
Returns a node-to-component-id mapping for the chain components of g (connected components of the edg...
bool hasUndirectedPath(const G &g, NodeId n1, NodeId n2)
Returns true if an undirected path exists between n1 and n2.
NodeProperty< NodeId > connectedComponents(const G &g)
Returns a node-to-component-id mapping for the (weakly) connected components of g.
gum is the global namespace for all aGrUM entities
Generic BFS-based path-finding algorithms for aGrUM graphs.
Generic node-reachability algorithms for aGrUM graphs.
Base classes for undirected graphs.