#include <graph.h>
Inheritance diagram for gtc::digraph< K, T >:
Public Methods | |
digraph () | |
Create a graph with no nodes (see _base_graph for more details). | |
digraph (size_t n) | |
Create a graph with n nodes (see _base_graph for more details). | |
digraph (size_t n, const K &k) | |
Create a graph with n nodes (see _base_graph for more details). | |
template<typename F> | digraph (size_t n, F f) |
Create a graph with n nodes (see _base_graph for more details). | |
void | add_edge (const K &k1, const K &k2) |
Adds an edge to the graph, given key values of two nodes. | |
bool | is_edge (const K &k1, const K &k2) |
Determines if an edge exists given key values of two nodes. More... | |
void | remove_edge (const K &k1, const K &k2) |
Removes an edge from the graph, given key values of two nodes. More... |
Represents a unweighted, directed graph. Type K is used as the type for the node keys, and type T is the type of the data associated with the node. The default type for T is void*, effectively meaning that there is no associated data with a node, or you are just working with the key values.
|
Determines if an edge exists given key values of two nodes. < Adds an edge between nodes with key values k1 and k2. Notes: Nodes with key values k1 and k2 must exist. Also, more than one edge may be added between the same two nodes. Implements gtc::_base_graph< K, void *, T >. |
|
Removes an edge from the graph, given key values of two nodes. < Returns true if an edge exists between nodes with key values k1 and k2, false otherwise. Note: Nodes with key values k1 and k2 must exist. |