84 typedef std::map<vertex_type, neighbours_list, vertex_compare>
93 class graph_vertex_iterator
101 typedef ptrdiff_t difference_type;
103 typedef std::bidirectional_iterator_tag iterator_category;
106 graph_vertex_iterator();
108 graph_vertex_iterator& operator++();
109 graph_vertex_iterator operator++(
int);
110 graph_vertex_iterator& operator--();
111 graph_vertex_iterator operator--(
int);
112 reference operator*()
const;
113 pointer operator->()
const;
114 bool operator==(
const graph_vertex_iterator& it)
const;
115 bool operator!=(
const graph_vertex_iterator& it)
const;
118 explicit graph_vertex_iterator(
119 typename graph_content::const_iterator it);
123 typename graph_content::const_iterator m_iterator;
130 class graph_edge_iterator
140 friend class graph_edge_iterator;
159 typedef const edge value_type;
160 typedef const edge& reference;
161 typedef const edge*
const pointer;
162 typedef ptrdiff_t difference_type;
164 typedef std::bidirectional_iterator_tag iterator_category;
167 graph_edge_iterator();
169 graph_edge_iterator& operator++();
170 graph_edge_iterator operator++(
int);
171 graph_edge_iterator& operator--();
172 graph_edge_iterator operator--(
int);
173 reference operator*()
const;
174 pointer operator->()
const;
175 bool operator==(
const graph_edge_iterator& it)
const;
176 bool operator!=(
const graph_edge_iterator& it)
const;
179 explicit graph_edge_iterator(
180 typename graph_content::const_iterator it_begin,
181 typename graph_content::const_iterator it_end,
182 typename graph_content::const_iterator it_s,
183 typename neighbours_list::const_iterator it_d);
187 typename graph_content::const_iterator m_vertex_begin;
190 typename graph_content::const_iterator m_vertex_end;
193 typename graph_content::const_iterator m_vertex_iterator;
196 typename neighbours_list::const_iterator m_neighbours_iterator;
205 typedef std::reverse_iterator<vertex_iterator> reverse_vertex_iterator;
206 typedef std::reverse_iterator<edge_iterator> reverse_edge_iterator;
216 void neighbours(
const vertex_type& s, std::vector<vertex_type>& v)
const;
217 void vertices(std::vector<vertex_type>& v)
const;
219 vertex_iterator vertex_begin()
const;
220 vertex_iterator vertex_end()
const;
221 vertex_iterator vertex_begin(
const vertex_type& s)
const;
223 reverse_vertex_iterator vertex_rbegin()
const;
224 reverse_vertex_iterator vertex_rend()
const;
225 reverse_vertex_iterator vertex_rbegin(
const vertex_type& s)
const;
227 edge_iterator edge_begin()
const;
228 edge_iterator edge_end()
const;
232 reverse_edge_iterator edge_rbegin()
const;
233 reverse_edge_iterator edge_rend()
const;
234 reverse_edge_iterator edge_rbegin(
const vertex_type& s1,
239 std::size_t outer_degree(
const vertex_type& s)
const;
240 std::size_t inner_degree(
const vertex_type& s)
const;
241 std::size_t vertices_count()
const;
242 std::size_t edges_count()
const;
249 std::map<vertex_type, std::size_t, vertex_compare> m_inner_degrees;
252 std::size_t m_edges_count;
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.