58 bool nodes_resize_policy,
60 bool arcs_resize_policy,
62 bool edges_resize_policy) :
67 DiGraph(arcs_size, arcs_resize_policy) {
110 for (
const auto& edge:
edges()) {
112 attributes.insert(attributes.begin(), {
"dir",
"none"});
113 writer.
edge(edge.first(), edge.second(), attributes);
116 for (
const auto& arc:
arcs())
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
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
const EdgeSet & edges() const
returns the set of edges stored within the EdgeGraphPart
virtual std::string toString() const
to friendly display the content of the EdgeGraphPart
Base class for mixed graphs.
std::string toString() const override
to friendly display the content of the MixedGraph
std::string toDot() const override
to friendly display mixed graph in DOT format
MixedGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true, Size edges_size=HashTableConst::default_size, bool edges_resize_policy=true)
default constructor
~MixedGraph() override
destructor
Class for node sets in 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
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
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
const DotArcOptions * edge(Size a, Size b) const
the options of the undirected edge between a and b, given for (a, b) or for (b, a),...
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.
The statements common to the graphs drawn with graphviz : preamble, attributes of nodes and arcs.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Base classes for mixed directed/undirected graphs.
Inline implementation of Base classes for mixed graphs.
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,...
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
static DotStyle read()
the style of the graphs of the section notebook