145 bool nodes_resize_policy =
true,
147 bool arcs_resize_policy =
true);
212 void clear()
override;
215 std::string
toString()
const override;
220 virtual std::string
toDot()
const;
ArcGraphPart(Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
Base class for all oriented graphs.
NodeSet ancestors(NodeId id) const
returns the set of all ancestors of id (nodes from which id is reachable)
NodeSet family(NodeId id) const
returns { id } ∪ parents(id)
bool hasDirectedPath(NodeId from, NodeId to) const
checks whether there exists a directed path from from to to
std::optional< std::vector< NodeId > > directedPath(NodeId node1, NodeId node2) const
returns a directed path from node1 to node2, or std::nullopt if none
static DiGraph completeGraph(int n)
Build a complete DiGraph with n nodes.
virtual std::string toDot() const
to friendly display the content of the graph in the DOT syntax
DiGraph & operator=(const DiGraph &g)
copy operator
void clear() override
removes all the nodes and arcs from the graph
void addArc(const NodeId tail, const NodeId head) override
insert a new arc into the directed graph
NodeProperty< NodeId > connectedComponents() const
returns a property {node:id of weakly connected component}
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
void eraseNode(const NodeId id) override
remove a node and its adjacent arcs from the graph
Sequence< NodeId > topologicalOrder() const
Build and return a topological order.
bool operator==(const DiGraph &g) const
tests whether two DiGraphs are identical (same nodes, same arcs)
NodeSet descendants(NodeId id) const
returns the set of all descendants of id (nodes reachable from id)
~DiGraph() override
destructor
std::optional< std::vector< NodeId > > directedUnorientedPath(NodeId node1, NodeId node2) const
returns a shortest path from node1 to node2 ignoring arc orientation, or std::nullopt if none
std::string toString() const override
to friendly display the content of the graph
NodeGraphPart(Size holes_size=HashTableConst::default_size, bool holes_resize_policy=true)
default constructor
Concept for directed graphs (arcs with parents/children).
Inline implementation of Base classes for oriented graphs.
C++20 concepts for aGrUM graph interfaces.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
Base node set class for graphs.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects.
static constexpr Size default_size
The default number of slots in hashtables.