claw::graph< S, A, Comp > Class Template Reference

A class to represent a graph. More...

`#include <graph.hpp>`

## Classes

class | graph_vertex_iterator
| Iterator on the graph's vertices. More...
class | graph_edge_iterator
| Iterator on the graph's edges. 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

void | add_edge (const vertex_type &s1, const vertex_type &s2, const edge_type &e=edge_type())
void | add_vertex (const vertex_type &s)
bool | edge_exists (const vertex_type &s, const vertex_type &r) const
void | neighbours (const vertex_type &s, std::vector< vertex_type > &v) const
void | vertices (std::vector< vertex_type > &v) const
vertex_iterator | vertex_begin () const
vertex_iterator | vertex_end () const
vertex_iterator | vertex_begin (const vertex_type &s) const
reverse_vertex_iterator | vertex_rbegin () const
reverse_vertex_iterator | vertex_rend () const
reverse_vertex_iterator | vertex_rbegin (const vertex_type &s) const
edge_iterator | edge_begin () const
edge_iterator | edge_end () const
edge_iterator | edge_begin (const vertex_type &s1, const vertex_type &s2) const
reverse_edge_iterator | edge_rbegin () const
reverse_edge_iterator | edge_rend () const
reverse_edge_iterator | edge_rbegin (const vertex_type &s1, const vertex_type &s2) const
const edge_type & | label (const vertex_type &s, const vertex_type &r) const
std::size_t | outer_degree (const vertex_type &s) const
std::size_t | inner_degree (const vertex_type &s) const
std::size_t | vertices_count () const
std::size_t | edges_count () const

## Detailed Description

template<class S, class A = meta::no_type, class Comp = std::less<S>>
class claw::graph< S, A, Comp >

A class to represent a graph.

Constraints on the template parameters:

- S is LessThanComparable,
- A is any Assignable and Default Constructible,
- Comp is a binary predicate such that Comp(S a, S b) == true if and only if a < b.

Author
  Julien Jorge

Definition at line 79 of file graph.hpp.

## Member Typedef Documentation

## edge_iterator

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef graph_edge_iterator claw::graph< S, A, Comp >::edge_iterator

Definition at line 221 of file graph.hpp.

## edge_type

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef A claw::graph< S, A, Comp >::edge_type

Type of the edges.

Definition at line 86 of file graph.hpp.

## graph_content

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef std::map<vertex_type, neighbours_list, vertex_compare> claw::graph< S, A, Comp >::graph_content

The whole graph: an adjacency list for each vertex.

Definition at line 98 of file graph.hpp.

## neighbours_list

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef std::map<vertex_type, edge_type, vertex_compare> claw::graph< S, A, Comp >::neighbours_list

The adjacency list of a vertex. vertex_type is the target vertex, edge_type is the label on the edge.

Definition at line 94 of file graph.hpp.

## reverse_edge_iterator

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef std::reverse_iterator<edge_iterator> claw::graph< S, A, Comp >::reverse_edge_iterator

Definition at line 223 of file graph.hpp.

## reverse_vertex_iterator

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef std::reverse_iterator<vertex_iterator> claw::graph< S, A, Comp >::reverse_vertex_iterator

Definition at line 222 of file graph.hpp.

## self_type

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef claw::graph<vertex_type, edge_type, vertex_compare> claw::graph< S, A, Comp >::self_type

Type of the current structure.

Definition at line 101 of file graph.hpp.

## vertex_compare

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef Comp claw::graph< S, A, Comp >::vertex_compare

Binary predicate to compare vertices.

Definition at line 89 of file graph.hpp.

## vertex_iterator

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef graph_vertex_iterator claw::graph< S, A, Comp >::vertex_iterator

Definition at line 220 of file graph.hpp.

## vertex_type

template<class S, class A = meta::no_type, class Comp = std::less<S>>

typedef S claw::graph< S, A, Comp >::vertex_type

Type of the vertices.

Definition at line 83 of file graph.hpp.

The documentation for this class was generated from the following file:

- graph.hpp