#include <graph.h>
Inheritance diagram for gtc::wgraph< K, W, T >:
Public Methods | |
wgraph () | |
Create a graph with no nodes (see _base_graph for more details). | |
wgraph (size_t n) | |
Create a graph with n nodes (see _base_graph for more details). | |
wgraph (size_t n, const K &k) | |
Create a graph with n nodes (see _base_graph for more details). | |
template<typename F> | wgraph (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, const W &w) |
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... | |
W & | weight (const K &k1, const K &k2) |
Returns reference to the weight of the first edge between k1 and k2. More... |
Represents a weighted, undirected 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. Type W is used for the weight. 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, W, 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. |
|
Returns reference to the weight of the first edge between k1 and k2. < Removes all edges between nodes with key values k1 and k2. Note: Nodes with key values k1 and k2 must exist. |