63 for (
int j = 0; j < n; ++j) {
64 for (
int k = j + 1; k < n; ++k) {
72 bool nodes_resize_policy,
74 bool arcs_resize_policy) :
102 for (
const auto& arc:
arcs())
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
void writeDotNodes(dot::DotWriter &writer, const dot::DotStyle &style, const dot::DotOptions &options) const
writes the nodes in the dot language, see writeDotNode()
virtual std::string toString() const
a function to display the set of nodes
NodeGraphPart(Size holes_size=HashTableConst::default_size, bool holes_resize_policy=true)
default constructor
std::vector< NodeId > addNodes(Size n)
insert n nodes
The options given to a toDot(const DotOptions&).
const DotArcOptions * arc(Size tail, Size head) const
the options of the arc from tail to head, or nullptr if none was given for it
Writes a graph in the dot language, statement after statement, in the order of the calls.
void edge(std::string_view from, std::string_view to, const DotAttributes &attributes={})
an edge from from to to (-> in a directed graph, -- in an undirected one).
std::string str() const
The graph written so far, closed. It can be called at any moment, and the writer can be used after.
Base classes for oriented graphs.
Inline implementation of Base classes for oriented graphs.
The statements common to the graphs drawn with graphviz : preamble, attributes of nodes and arcs.
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.
void writePreamble(DotWriter &writer, const DotStyle &style, const DotOptions &options, std::string_view defaultLabel)
Writes the beginning of a graph, as pyAgrum displays it.
DotAttributes arcAttributes(const DotArcOptions *options)
The attributes of an arc or an edge given by the options : color, penwidth, label,...
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.
static DotStyle read()
the style of the graphs of the section notebook