25template <
typename NodeT,
typename EdgeT =
void,
typename IDT = std::
string>
35 NodeT
node(IDT
id)
const;
45 void removeNode(IDT
id,
bool keep_edge =
false);
47 void insertEdge(IDT from_id, IDT to_id, [[maybe_unused]]
bool to_exists =
true)
48 requires std::is_void_v<EdgeT>;
50 void insertEdge(IDT from_id, IDT to_id,
EdgeT_CR data, [[maybe_unused]]
bool to_exists = true)
53 NodeT operator[](IDT
id) const;
55 NodeT& operator[](IDT
id);
57 bool operator==(const
DGraph&
dg) const;
59 bool operator!=(const
DGraph&
dg) const;
65template <typename EdgeT, typename IDT>
68template <
typename NodeT,
typename EdgeT,
typename IDT>
73template <
typename NodeT,
typename EdgeT,
typename IDT>
78template <
typename NodeT,
typename EdgeT,
typename IDT>
82 [](
auto a,
auto b) { return a.first == b.first; });
85template <
typename NodeT,
typename EdgeT,
typename IDT>
91template <
typename NodeT,
typename EdgeT,
typename IDT>
97template <
typename NodeT,
typename EdgeT,
typename IDT>
103template <
typename NodeT,
typename EdgeT,
typename IDT>
105 requires std::is_void_v<EdgeT> {
109template <
typename NodeT,
typename EdgeT,
typename IDT>
115template <
typename NodeT,
typename EdgeT,
typename IDT>
120template <
typename NodeT,
typename EdgeT,
typename IDT>
125template <
typename NodeT,
typename EdgeT,
typename IDT>
130template <
typename NodeT,
typename EdgeT,
typename IDT>
Directed Graph Base Class.
Directed graph base class.
Definition: base.hpp:44
size_t size() const noexcept
The total number of nodes in the graph.
Definition: base.hpp:605
const std::map< IDT, _CN > & graph() const
Return the const reference to the graph map.
Definition: base.hpp:948
void removeNode(IDT id, bool keep_edge=false)
Remove the node from the graph.
Definition: base.hpp:699
bool strictCheck() const
Check if the graph is strictly valid.
Definition: base.hpp:651
bool operator==(const DGraphBase< EdgeT, IDT > &dg) const
Check if two graphs are identical.
Definition: base.hpp:913
void insertNode(IDT id)
Insert a node.
Definition: base.hpp:678
void insertEdgeToExists(IDT from_id, IDT to_id)
Definition: base.hpp:711
bool operator!=(const DGraphBase< EdgeT, IDT > &dg) const
Check if two graphs are different.
Definition: base.hpp:918
Directed graph class.
Definition: core.hpp:26
bool operator==(const DGraph &dg) const
Definition: core.hpp:126
NodeT operator[](IDT id) const
Definition: core.hpp:116
std::map< IDT, NodeT > node_data
Definition: core.hpp:62
NodeT node(IDT id) const
Definition: core.hpp:69
typename DGraphBase< EdgeT, IDT >::_CN _CN
Definition: core.hpp:28
void insertEdge(IDT from_id, IDT to_id, bool to_exists=true)
Definition: core.hpp:104
void insertNode(IDT id, const NodeT &data)
Definition: core.hpp:86
void removeNode(IDT id, bool keep_edge=false)
Definition: core.hpp:98
typename DGraphBase< EdgeT, IDT >::EdgeT_CR EdgeT_CR
Definition: core.hpp:29
bool strictCheck() const
Definition: core.hpp:79
bool operator!=(const DGraph &dg) const
Definition: core.hpp:131
Definition: common.hpp:25
Directed Graph namespace.
Definition: base.hpp:35