|
NodeT | node (IDT id) const |
|
NodeT & | node (IDT id) |
|
bool | strictCheck () const |
|
void | insertNode (IDT id, const NodeT &data) |
|
void | insertNode (IDT id, const NodeT &data, const _CN &cn) |
|
void | removeNode (IDT id, bool keep_edge=false) |
|
void | insertEdge (IDT from_id, IDT to_id, bool to_exists=true) |
|
void | insertEdge (IDT from_id, IDT to_id, EdgeT_CR data, bool to_exists=true) |
|
NodeT | operator[] (IDT id) const |
|
NodeT & | operator[] (IDT id) |
|
bool | operator== (const DGraph &dg) const |
|
bool | operator!= (const DGraph &dg) const |
|
| DGraphBase ()=default |
| Construct a new DGraphBase object. More...
|
|
bool | hasNode (IDT id) const noexcept |
| Check if the graph has a node with id. More...
|
|
bool | hasEdge (IDT from_id, IDT to_id) const noexcept |
| Check if the graph has an edge linking from_id and to_id. More...
|
|
size_t | numNodes () const noexcept |
| The total number of nodes in the graph. More...
|
|
size_t | numEdges () const noexcept |
| The total number of edges in the graph. More...
|
|
size_t | size () const noexcept |
| The total number of nodes in the graph. More...
|
|
void | edge (IDT from_id, IDT to_id) const |
| Get the edge data between two nodes. More...
|
|
EdgeT_R | edge (IDT from_id, IDT to_id) |
| Get the edge data reference between two nodes. More...
|
|
Ret | edge (IDT from_id, IDT to_id, Fn func, Args... args) const |
| Get the edge data after processing with a Lambda expression. More...
|
|
Ret | edge (IDT from_id, IDT to_id, std::function< Ret(EdgeT_, Args...)> func, Args... args) const |
| Get the edge data after processing with a std::function . More...
|
|
bool | strictCheck () const |
| Check if the graph is strictly valid. More...
|
|
std::vector< IDT > | nodesID () const |
| Get all nodes IS in the graph. More...
|
|
std::vector< std::pair< IDT, IDT > > | edges () const |
| Get all edge connections in the graph. More...
|
|
void | insertNode (IDT id) |
| Insert a node. More...
|
|
void | insertNode (IDT id, const std::map< IDT, void > &map, bool nodes_exist=false) |
| Insert a node with edge data. More...
|
|
void | removeNode (IDT id, bool keep_edge=false) |
| Remove the node from the graph. More...
|
|
void | removeNodeIfExists (IDT id, bool keep_edge=false) |
| Remove the node from the graph if it exists. More...
|
|
void | insertEdgeToExists (IDT from_id, IDT to_id) |
|
void | insertEdgeToExists (IDT from_id, IDT to_id, EdgeT_CR data) |
|
void | insertEdge (IDT from_id, IDT to_id, bool to_exists=false) |
| Insert an edge to the graph without data. More...
|
|
void | insertEdge (IDT from_id, IDT to_id, EdgeT_CR data, bool to_exists=false) |
| Insert an edge to the graph with data. More...
|
|
bool | isConnected (IDT from_id, IDT to_id) const |
| Check whether to node are connected. More...
|
|
std::pair< EdgeT_, std::vector< IDT > > | maxWeightPath (IDT from_id, IDT to_id) const |
| Obtain the maximum weight and its corresponding path between two nodes. More...
|
|
std::pair< Ret, std::vector< IDT > > | maxWeightPath (IDT from_id, IDT to_id, Fn func, Args... args) const |
| Obtain the maximum weight and its corresponding path between two nodes. More...
|
|
std::pair< Ret, std::vector< IDT > > | maxWeightPath (IDT from_id, IDT to_id, std::function< Ret(EdgeT_, Args...)> func, Args... args) const |
| Obtain the maximum weight and its corresponding path between two nodes. More...
|
|
std::pair< EdgeT_, std::vector< IDT > > | minWeightPath (IDT from_id, IDT to_id) const |
| Obtain the minimum weight and its corresponding path between two nodes. More...
|
|
std::pair< Ret, std::vector< IDT > > | minWeightPath (IDT from_id, IDT to_id, Fn func, Args... args) const |
| Obtain the minimum weight and its corresponding path between two nodes. More...
|
|
std::pair< Ret, std::vector< IDT > > | minWeightPath (IDT from_id, IDT to_id, std::function< Ret(EdgeT_, Args...)> func, Args... args) const |
| Obtain the minimum weight and its corresponding path between two nodes. More...
|
|
void | insertSubGraph (const DGraphBase< void, IDT > &dg) |
| Insert subgraph into the main graph. More...
|
|
void | insertSubGraph (const DGraphBase< void, IDT > &dg, IDT id) |
| Insert a subgraph at a node. More...
|
|
void | merge (const DGraphBase< void, IDT > &dg) |
| Merge a graph into the main graph. More...
|
|
void | clear () |
| Clear the whole graph. More...
|
|
void | clearEdges () |
| Clear all edges of the graph. More...
|
|
bool | operator== (const DGraphBase< void, IDT > &dg) const |
| Check if two graphs are identical. More...
|
|
bool | operator!= (const DGraphBase< void, IDT > &dg) const |
| Check if two graphs are different. More...
|
|
DGraphBase & | operator+= (const DGraphBase< void, IDT > &dg) |
| Merge two graphs. More...
|
|
void | operator() (IDT from_id, IDT to_id) const |
| Get the edge data between two nodes. More...
|
|
EdgeT_R | operator() (IDT from_id, IDT to_id) |
| Get the edge data reference between two nodes. More...
|
|
template<typename NodeT, typename EdgeT = void, typename IDT = std::string>
class dg::DGraph< NodeT, EdgeT, IDT >
Directed graph class.
- Template Parameters
-
NodeT | Node type. |
EdgeT | Edge type. |
IDT | ID type (should not be void and should be comparable). |