Claw
1.7.3
|
A class to represent a graph. More...
#include <graph.hpp>
Classes | |
class | graph_edge_iterator |
Iterator on the graph's edges. More... | |
class | graph_vertex_iterator |
Iterator on the graph's vertices. More... |
Public Types | |
typedef S | vertex_type |
Type of the vertices. | |
typedef A | edge_type |
Type of the edges. | |
typedef Comp | vertex_compare |
Binary predicate to compare vertices. | |
typedef std::map< vertex_type, edge_type, vertex_compare > | neighbours_list |
The adjacency list of a vertex. vertex_type is the target vertex, edge_type is the label on the edge. | |
typedef std::map< vertex_type, neighbours_list, vertex_compare > | graph_content |
The whole graph: an adjacency list for each vertex. | |
typedef claw::graph < vertex_type, edge_type, vertex_compare > | self_type |
Type of the current structure. | |
typedef graph_vertex_iterator | vertex_iterator |
typedef graph_edge_iterator | edge_iterator |
typedef std::reverse_iterator < vertex_iterator > | reverse_vertex_iterator |
typedef std::reverse_iterator < edge_iterator > | reverse_edge_iterator |
Public Member Functions | |
graph () | |
Constructor. | |
void | add_edge (const vertex_type &s1, const vertex_type &s2, const edge_type &e=edge_type()) |
Add an edge in the graph. | |
void | add_vertex (const vertex_type &s) |
Add a vertex. | |
bool | edge_exists (const vertex_type &s, const vertex_type &r) const |
Check if there is an edge linking to vertices. | |
void | neighbours (const vertex_type &s, std::vector< vertex_type > &v) const |
Get the neighbors of a vertex. | |
void | vertices (std::vector< vertex_type > &v) const |
Get all the vertices. | |
vertex_iterator | vertex_begin () const |
Get a node iterator on the first node. | |
vertex_iterator | vertex_end () const |
Get a node iterator past the last node. | |
vertex_iterator | vertex_begin (const vertex_type &s) const |
Get a node iterator on a particular node. | |
reverse_vertex_iterator | vertex_rbegin () const |
Get a reverse node iterator on the first node. | |
reverse_vertex_iterator | vertex_rend () const |
Get a reverse node iterator past the last node. | |
reverse_vertex_iterator | vertex_rbegin (const vertex_type &s) const |
Get a reverse node iterator just after a particular node. | |
edge_iterator | edge_begin () const |
Get an edge iterator on the first edge. | |
edge_iterator | edge_end () const |
Get an edge iterator after the last edge. | |
edge_iterator | edge_begin (const vertex_type &s1, const vertex_type &s2) const |
Get en iterator on a particular edge . | |
reverse_edge_iterator | edge_rbegin () const |
Get a reverse edge iterator on the first edge. | |
reverse_edge_iterator | edge_rend () const |
Get a reverse edge iterator after the last edge. | |
reverse_edge_iterator | edge_rbegin (const vertex_type &s1, const vertex_type &s2) const |
Get a reverse edge iterator on a particular edge. | |
const edge_type & | label (const vertex_type &s, const vertex_type &r) const |
Get the label of an edge. | |
std::size_t | outer_degree (const vertex_type &s) const |
Get the outter degree of a vertex. | |
std::size_t | inner_degree (const vertex_type &s) const |
Get the inner degree of a vertex. | |
std::size_t | vertices_count () const |
Get the number of vertices. | |
std::size_t | edges_count () const |
Get the number of edges. |
A class to represent a graph.
Constraints on the template parameters:
void claw::graph< S, A, Comp >::add_edge | ( | const vertex_type & | s1, |
const vertex_type & | s2, | ||
const edge_type & | e = edge_type() |
||
) |
void claw::graph< S, A, Comp >::add_vertex | ( | const vertex_type & | s | ) |
claw::graph< S, A, Comp >::edge_iterator claw::graph< S, A, Comp >::edge_begin | ( | ) | const |
Get an edge iterator on the first edge.
claw::graph< S, A, Comp >::edge_iterator claw::graph< S, A, Comp >::edge_begin | ( | const vertex_type & | s1, |
const vertex_type & | s2 | ||
) | const |
Get en iterator on a particular edge .
bool claw::graph< S, A, Comp >::edge_exists | ( | const vertex_type & | s, |
const vertex_type & | r | ||
) | const |
claw::graph< S, A, Comp >::reverse_edge_iterator claw::graph< S, A, Comp >::edge_rbegin | ( | ) | const |
claw::graph< S, A, Comp >::reverse_edge_iterator claw::graph< S, A, Comp >::edge_rbegin | ( | const vertex_type & | s1, |
const vertex_type & | s2 | ||
) | const |
std::size_t claw::graph< S, A, Comp >::inner_degree | ( | const vertex_type & | s | ) | const |
const claw::graph< S, A, Comp >::edge_type & claw::graph< S, A, Comp >::label | ( | const vertex_type & | s, |
const vertex_type & | r | ||
) | const |
void claw::graph< S, A, Comp >::neighbours | ( | const vertex_type & | s, |
std::vector< vertex_type > & | v | ||
) | const |
std::size_t claw::graph< S, A, Comp >::outer_degree | ( | const vertex_type & | s | ) | const |
claw::graph< S, A, Comp >::vertex_iterator claw::graph< S, A, Comp >::vertex_begin | ( | ) | const |
Get a node iterator on the first node.
claw::graph< S, A, Comp >::vertex_iterator claw::graph< S, A, Comp >::vertex_begin | ( | const vertex_type & | s | ) | const |
Get a node iterator on a particular node.
claw::graph< S, A, Comp >::reverse_vertex_iterator claw::graph< S, A, Comp >::vertex_rbegin | ( | ) | const |
Get a reverse node iterator on the first node.
claw::graph< S, A, Comp >::reverse_vertex_iterator claw::graph< S, A, Comp >::vertex_rbegin | ( | const vertex_type & | s | ) | const |
Get a reverse node iterator just after a particular node.
void claw::graph< S, A, Comp >::vertices | ( | std::vector< vertex_type > & | v | ) | const |