62 for (
int j = 0; j < n; ++j) {
63 for (
int k = j + 1; k < n; ++k) {
71 bool nodes_resize_policy,
73 bool arcs_resize_policy) :
94 std::string strBuff =
"digraph {\n";
96 for (
const auto node:
nodes())
97 strBuff += std::format(
" {}{};\n", node,
dotNodeLabel(node));
101 for (
const auto& arc:
arcs())
102 strBuff += std::format(
" {} -> {};\n", arc.tail(), arc.head());
ArcGraphPart(Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
std::string toString() const
to friendly display the content of the ArcGraphPart
Base class for all oriented graphs.
bool hasDirectedPath(NodeId from, NodeId to) const
checks whether there exists a directed path from from to to
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
void addArc(const NodeId tail, const NodeId head) override
insert a new arc into the directed 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
~DiGraph() override
destructor
std::string toString() const override
to friendly display the content of the graph
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
virtual std::string toString() const
a function to display the set of nodes
std::string dotNodeLabel(NodeId id) const
returns " [label=\"...\"]" with DOT-escaped name, or "" if no name
NodeGraphPart(Size holes_size=HashTableConst::default_size, bool holes_resize_policy=true)
default constructor
std::vector< NodeId > addNodes(Size n)
insert n nodes
Base classes for oriented graphs.
Inline implementation of Base classes for oriented graphs.
some utils for topology : NodeId, Edge, Arc and consorts ...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
bool hasDirectedPath(const G &g, NodeId from, NodeId to)
Returns true if there is a directed path from from to to.
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
Generic BFS-based path-finding algorithms for aGrUM graphs.