1 // (C) Copyright 2007-2009 Andrew Sutton
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0 (See accompanying file
5 // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_GRAPH_DIRECTED_GRAPH_HPP
8 #define BOOST_GRAPH_DIRECTED_GRAPH_HPP
10 #include <boost/graph/adjacency_list.hpp>
11 #include <boost/graph/properties.hpp>
12 #include <boost/pending/property.hpp>
13 #include <boost/property_map/transform_value_property_map.hpp>
14 #include <boost/type_traits.hpp>
15 #include <boost/mpl/if.hpp>
19 struct directed_graph_tag { };
22 * The directed_graph class template is a simplified version of the BGL
23 * adjacency list. This class is provided for ease of use, but may not
24 * perform as well as custom-defined adjacency list classes. Instances of
25 * this template model the BidirectionalGraph, VertexIndexGraph, and
26 * EdgeIndexGraph concepts. The graph is also fully mutable, supporting
27 * both insertions and removals of vertices and edges.
29 * @note Special care must be taken when removing vertices or edges since
30 * those operations can invalidate the numbering of vertices.
33 typename VertexProp = no_property,
34 typename EdgeProp = no_property,
35 typename GraphProp = no_property>
39 typedef GraphProp graph_property_type;
40 typedef VertexProp vertex_property_type;
41 typedef EdgeProp edge_property_type;
42 typedef typename lookup_one_property<GraphProp, graph_bundle_t>::type graph_bundled;
43 typedef typename lookup_one_property<VertexProp, vertex_bundle_t>::type vertex_bundled;
44 typedef typename lookup_one_property<EdgeProp, edge_bundle_t>::type edge_bundled;
47 // Embed indices into the vertex type.
48 typedef property<vertex_index_t, unsigned, vertex_property_type> internal_vertex_property;
49 typedef property<edge_index_t, unsigned, edge_property_type> internal_edge_property;
51 typedef adjacency_list<
52 listS, listS, bidirectionalS,
53 internal_vertex_property, internal_edge_property, GraphProp,
59 typedef typename graph_type::vertex_list_selector vertex_list_selector;
60 typedef typename graph_type::edge_list_selector edge_list_selector;
61 typedef typename graph_type::out_edge_list_selector out_edge_list_selector;
62 typedef typename graph_type::directed_selector directed_selector;
65 // more commonly used graph types
66 typedef typename graph_type::stored_vertex stored_vertex;
67 typedef typename graph_type::vertices_size_type vertices_size_type;
68 typedef typename graph_type::edges_size_type edges_size_type;
69 typedef typename graph_type::degree_size_type degree_size_type;
70 typedef typename graph_type::vertex_descriptor vertex_descriptor;
71 typedef typename graph_type::edge_descriptor edge_descriptor;
74 typedef typename graph_type::vertex_iterator vertex_iterator;
75 typedef typename graph_type::edge_iterator edge_iterator;
76 typedef typename graph_type::out_edge_iterator out_edge_iterator;
77 typedef typename graph_type::in_edge_iterator in_edge_iterator;
78 typedef typename graph_type::adjacency_iterator adjacency_iterator;
80 // miscellaneous types
81 typedef directed_graph_tag graph_tag;
82 typedef typename graph_type::directed_category directed_category;
83 typedef typename graph_type::edge_parallel_category edge_parallel_category;
84 typedef typename graph_type::traversal_category traversal_category;
86 typedef std::size_t vertex_index_type;
87 typedef std::size_t edge_index_type;
89 directed_graph(GraphProp const& p = GraphProp())
90 : m_graph(p), m_num_vertices(0), m_num_edges(0), m_max_vertex_index(0)
94 directed_graph(directed_graph const& x)
95 : m_graph(x.m_graph), m_num_vertices(x.m_num_vertices), m_num_edges(x.m_num_edges)
96 , m_max_vertex_index(x.m_max_vertex_index), m_max_edge_index(x.m_max_edge_index)
99 directed_graph(vertices_size_type n, GraphProp const& p = GraphProp())
100 : m_graph(n, p), m_num_vertices(n), m_num_edges(0), m_max_vertex_index(n)
101 , m_max_edge_index(0)
102 { renumber_vertex_indices(); }
104 template <typename EdgeIterator>
105 directed_graph(EdgeIterator f,
107 vertices_size_type n,
108 edges_size_type m = 0,
109 GraphProp const& p = GraphProp())
110 : m_graph(f, l, n, m, p), m_num_vertices(n), m_num_edges(0)
111 , m_max_vertex_index(n), m_max_edge_index(0)
113 // Unfortunately, we have to renumber the entire graph.
116 // Can't always guarantee that the number of edges is actually
117 // m if distance(f, l) != m (or is undefined).
118 m_num_edges = m_max_edge_index = boost::num_edges(m_graph);
121 directed_graph& operator=(directed_graph const& g) {
124 m_num_vertices = g.m_num_vertices;
125 m_num_edges = g.m_num_edges;
126 m_max_vertex_index = g.m_max_vertex_index;
127 m_max_edge_index = g.m_max_edge_index;
132 // The impl_() methods are not part of the public interface.
136 graph_type const& impl() const
139 // The following methods are not part of the public interface
140 vertices_size_type num_vertices() const
141 { return m_num_vertices; }
145 // This helper function manages the attribution of vertex indices.
146 vertex_descriptor make_index(vertex_descriptor v) {
147 boost::put(vertex_index, m_graph, v, m_max_vertex_index);
149 m_max_vertex_index++;
153 vertex_descriptor add_vertex()
154 { return make_index(boost::add_vertex(m_graph)); }
156 vertex_descriptor add_vertex(vertex_property_type const& p)
157 { return make_index(boost::add_vertex(internal_vertex_property(0u, p), m_graph)); }
159 void clear_vertex(vertex_descriptor v)
161 m_num_edges -= boost::degree(v, m_graph);
162 boost::clear_vertex(v, m_graph);
165 void remove_vertex(vertex_descriptor v)
167 boost::remove_vertex(v, m_graph);
171 edges_size_type num_edges() const
172 { return m_num_edges; }
175 // A helper function for managing edge index attributes.
176 std::pair<edge_descriptor, bool> const&
177 make_index(std::pair<edge_descriptor, bool> const& x)
180 boost::put(edge_index, m_graph, x.first, m_max_edge_index);
187 std::pair<edge_descriptor, bool>
188 add_edge(vertex_descriptor u, vertex_descriptor v)
189 { return make_index(boost::add_edge(u, v, m_graph)); }
191 std::pair<edge_descriptor, bool>
192 add_edge(vertex_descriptor u, vertex_descriptor v, edge_property_type const& p)
193 { return make_index(boost::add_edge(u, v, internal_edge_property(0u, p), m_graph)); }
195 void remove_edge(vertex_descriptor u, vertex_descriptor v)
197 // find all edges, (u, v)
198 std::vector<edge_descriptor> edges;
199 out_edge_iterator i, i_end;
200 for(boost::tie(i, i_end) = boost::out_edges(u, m_graph); i != i_end; ++i) {
201 if(boost::target(*i, m_graph) == v) {
205 // remove all edges, (u, v)
206 typename std::vector<edge_descriptor>::iterator
207 j = edges.begin(), j_end = edges.end();
208 for( ; j != j_end; ++j) {
213 void remove_edge(edge_iterator i)
218 void remove_edge(edge_descriptor e)
220 boost::remove_edge(e, m_graph);
224 vertex_index_type max_vertex_index() const
225 { return m_max_vertex_index; }
228 renumber_vertex_indices()
230 vertex_iterator i, end;
231 boost::tie(i, end) = vertices(m_graph);
232 m_max_vertex_index = renumber_vertex_indices(i, end, 0);
236 remove_vertex_and_renumber_indices(vertex_iterator i)
238 vertex_iterator j = next(i), end = vertices(m_graph).second;
239 vertex_index_type n = get(vertex_index, m_graph, *i);
241 // remove the offending vertex and renumber everything after
243 m_max_vertex_index = renumber_vertex_indices(j, end, n);
247 max_edge_index() const
248 { return m_max_edge_index; }
251 renumber_edge_indices()
253 edge_iterator i, end;
254 boost::tie(i, end) = edges(m_graph);
255 m_max_edge_index = renumber_edge_indices(i, end, 0);
259 remove_edge_and_renumber_indices(edge_iterator i)
261 edge_iterator j = next(i), end = edges(m_graph).second;
262 edge_index_type n = get(edge_index, m_graph, *i);
264 // remove the offending edge and renumber everything after
266 m_max_edge_index = renumber_edge_indices(j, end, n);
272 renumber_vertex_indices();
273 renumber_edge_indices();
276 // bundled property support
277 #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
278 vertex_bundled& operator[](vertex_descriptor v)
279 { return m_graph[v]; }
281 vertex_bundled const& operator[](vertex_descriptor v) const
282 { return m_graph[v]; }
284 edge_bundled& operator[](edge_descriptor e)
285 { return m_graph[e]; }
287 edge_bundled const& operator[](edge_descriptor e) const
288 { return m_graph[e]; }
290 graph_bundled& operator[](graph_bundle_t)
291 { return get_property(*this); }
293 graph_bundled const& operator[](graph_bundle_t) const
294 { return get_property(*this); }
298 static vertex_descriptor null_vertex()
299 { return graph_type::null_vertex(); }
304 m_num_vertices = m_max_vertex_index = 0;
305 m_num_edges = m_max_edge_index = 0;
308 void swap(directed_graph& g)
310 m_graph.swap(g.m_graph);
311 std::swap(m_num_vertices, g.m_num_vertices);
312 std::swap(m_max_vertex_index, g.m_max_vertex_index);
313 std::swap(m_num_edges, g.m_num_edges);
314 std::swap(m_max_edge_index, g.m_max_edge_index);
319 renumber_vertex_indices(vertex_iterator i,
321 vertices_size_type n)
323 typedef typename property_map<graph_type, vertex_index_t>::type IndexMap;
324 IndexMap indices = get(vertex_index, m_graph);
325 for( ; i != end; ++i) {
332 renumber_edge_indices(edge_iterator i,
334 vertices_size_type n)
336 typedef typename property_map<graph_type, edge_index_t>::type IndexMap;
337 IndexMap indices = get(edge_index, m_graph);
338 for( ; i != end; ++i) {
345 vertices_size_type m_num_vertices;
346 edges_size_type m_num_edges;
347 vertex_index_type m_max_vertex_index;
348 edge_index_type m_max_edge_index;
351 #define DIRECTED_GRAPH_PARAMS typename VP, typename EP, typename GP
352 #define DIRECTED_GRAPH directed_graph<VP,EP,GP>
354 // IncidenceGraph concepts
355 template <DIRECTED_GRAPH_PARAMS>
356 inline typename DIRECTED_GRAPH::vertex_descriptor
357 source(typename DIRECTED_GRAPH::edge_descriptor e, DIRECTED_GRAPH const& g)
358 { return source(e, g.impl()); }
360 template <DIRECTED_GRAPH_PARAMS>
361 inline typename DIRECTED_GRAPH::vertex_descriptor
362 target(typename DIRECTED_GRAPH::edge_descriptor e, DIRECTED_GRAPH const& g)
363 { return target(e, g.impl()); }
365 template <DIRECTED_GRAPH_PARAMS>
366 inline typename DIRECTED_GRAPH::degree_size_type
367 out_degree(typename DIRECTED_GRAPH::vertex_descriptor v, DIRECTED_GRAPH const& g)
368 { return out_degree(v, g.impl()); }
370 template <DIRECTED_GRAPH_PARAMS>
372 typename DIRECTED_GRAPH::out_edge_iterator,
373 typename DIRECTED_GRAPH::out_edge_iterator
375 out_edges(typename DIRECTED_GRAPH::vertex_descriptor v,
376 DIRECTED_GRAPH const& g)
377 { return out_edges(v, g.impl()); }
379 // BidirectionalGraph concepts
380 template <DIRECTED_GRAPH_PARAMS>
381 inline typename DIRECTED_GRAPH::degree_size_type
382 in_degree(typename DIRECTED_GRAPH::vertex_descriptor v, DIRECTED_GRAPH const& g)
383 { return in_degree(v, g.impl()); }
385 template <DIRECTED_GRAPH_PARAMS>
387 typename DIRECTED_GRAPH::in_edge_iterator,
388 typename DIRECTED_GRAPH::in_edge_iterator
390 in_edges(typename DIRECTED_GRAPH::vertex_descriptor v,
391 DIRECTED_GRAPH const& g)
392 { return in_edges(v, g.impl()); }
395 template <DIRECTED_GRAPH_PARAMS>
396 inline typename DIRECTED_GRAPH::degree_size_type
397 degree(typename DIRECTED_GRAPH::vertex_descriptor v, DIRECTED_GRAPH const& g)
398 { return degree(v, g.impl()); }
400 // AdjacencyGraph concepts
401 template <DIRECTED_GRAPH_PARAMS>
403 typename DIRECTED_GRAPH::adjacency_iterator,
404 typename DIRECTED_GRAPH::adjacency_iterator
406 adjacent_vertices(typename DIRECTED_GRAPH::vertex_descriptor v,
407 DIRECTED_GRAPH const& g)
408 { return adjacent_vertices(v, g.impl()); }
410 template <DIRECTED_GRAPH_PARAMS>
411 typename DIRECTED_GRAPH::vertex_descriptor
412 vertex(typename DIRECTED_GRAPH::vertices_size_type n,
413 DIRECTED_GRAPH const& g)
414 { return vertex(n, g.impl()); }
416 template <DIRECTED_GRAPH_PARAMS>
417 std::pair<typename DIRECTED_GRAPH::edge_descriptor, bool>
418 edge(typename DIRECTED_GRAPH::vertex_descriptor u,
419 typename DIRECTED_GRAPH::vertex_descriptor v,
420 DIRECTED_GRAPH const& g)
421 { return edge(u, v, g.impl()); }
423 // VertexListGraph concepts
424 template <DIRECTED_GRAPH_PARAMS>
425 inline typename DIRECTED_GRAPH::vertices_size_type
426 num_vertices(DIRECTED_GRAPH const& g)
427 { return g.num_vertices(); }
429 template <DIRECTED_GRAPH_PARAMS>
431 typename DIRECTED_GRAPH::vertex_iterator,
432 typename DIRECTED_GRAPH::vertex_iterator
434 vertices(DIRECTED_GRAPH const& g)
435 { return vertices(g.impl()); }
437 // EdgeListGraph concepts
438 template <DIRECTED_GRAPH_PARAMS>
439 inline typename DIRECTED_GRAPH::edges_size_type
440 num_edges(DIRECTED_GRAPH const& g)
441 { return g.num_edges(); }
443 template <DIRECTED_GRAPH_PARAMS>
445 typename DIRECTED_GRAPH::edge_iterator,
446 typename DIRECTED_GRAPH::edge_iterator
448 edges(DIRECTED_GRAPH const& g)
449 { return edges(g.impl()); }
451 // MutableGraph concepts
452 template <DIRECTED_GRAPH_PARAMS>
453 inline typename DIRECTED_GRAPH::vertex_descriptor
454 add_vertex(DIRECTED_GRAPH& g)
455 { return g.add_vertex(); }
457 template <DIRECTED_GRAPH_PARAMS>
458 inline typename DIRECTED_GRAPH::vertex_descriptor
459 add_vertex(typename DIRECTED_GRAPH::vertex_property_type const& p,
461 { return g.add_vertex(p); }
463 template <DIRECTED_GRAPH_PARAMS>
465 clear_vertex(typename DIRECTED_GRAPH::vertex_descriptor v,
467 { return g.clear_vertex(v); }
469 template <DIRECTED_GRAPH_PARAMS>
471 remove_vertex(typename DIRECTED_GRAPH::vertex_descriptor v,
473 { return g.remove_vertex(v); }
475 template <DIRECTED_GRAPH_PARAMS>
476 inline std::pair<typename DIRECTED_GRAPH::edge_descriptor, bool>
477 add_edge(typename DIRECTED_GRAPH::vertex_descriptor u,
478 typename DIRECTED_GRAPH::vertex_descriptor v,
480 { return g.add_edge(u, v); }
482 template <DIRECTED_GRAPH_PARAMS>
483 inline std::pair<typename DIRECTED_GRAPH::edge_descriptor, bool>
484 add_edge(typename DIRECTED_GRAPH::vertex_descriptor u,
485 typename DIRECTED_GRAPH::vertex_descriptor v,
486 typename DIRECTED_GRAPH::edge_property_type const& p,
488 { return g.add_edge(u, v, p); }
490 template <DIRECTED_GRAPH_PARAMS>
491 inline void remove_edge(typename DIRECTED_GRAPH::vertex_descriptor u,
492 typename DIRECTED_GRAPH::vertex_descriptor v,
494 { return g.remove_edge(u, v); }
497 template <DIRECTED_GRAPH_PARAMS>
498 inline void remove_edge(typename DIRECTED_GRAPH::edge_descriptor e, DIRECTED_GRAPH& g)
499 { return g.remove_edge(e); }
501 template <DIRECTED_GRAPH_PARAMS>
502 inline void remove_edge(typename DIRECTED_GRAPH::edge_iterator i, DIRECTED_GRAPH& g)
503 { return g.remove_edge(i); }
505 template <DIRECTED_GRAPH_PARAMS, class Predicate>
506 inline void remove_edge_if(Predicate pred, DIRECTED_GRAPH& g)
507 { return remove_edge_if(pred, g.impl()); }
509 template <DIRECTED_GRAPH_PARAMS, class Predicate>
511 remove_out_edge_if(typename DIRECTED_GRAPH::vertex_descriptor v,
514 { return remove_out_edge_if(v, pred, g.impl()); }
516 template <DIRECTED_GRAPH_PARAMS, class Predicate>
518 remove_in_edge_if(typename DIRECTED_GRAPH::vertex_descriptor v,
521 { return remove_in_edge_if(v, pred, g.impl()); }
523 template <DIRECTED_GRAPH_PARAMS, typename Property>
524 struct property_map<DIRECTED_GRAPH, Property>: property_map<typename DIRECTED_GRAPH::graph_type, Property> {};
526 template <DIRECTED_GRAPH_PARAMS>
527 struct property_map<DIRECTED_GRAPH, vertex_all_t> {
528 typedef transform_value_property_map<
529 detail::remove_first_property,
530 typename property_map<typename DIRECTED_GRAPH::graph_type, vertex_all_t>::const_type>
532 typedef transform_value_property_map<
533 detail::remove_first_property,
534 typename property_map<typename DIRECTED_GRAPH::graph_type, vertex_all_t>::type>
538 template <DIRECTED_GRAPH_PARAMS>
539 struct property_map<DIRECTED_GRAPH, edge_all_t> {
540 typedef transform_value_property_map<
541 detail::remove_first_property,
542 typename property_map<typename DIRECTED_GRAPH::graph_type, edge_all_t>::const_type>
544 typedef transform_value_property_map<
545 detail::remove_first_property,
546 typename property_map<typename DIRECTED_GRAPH::graph_type, edge_all_t>::type>
550 // PropertyGraph concepts
551 template <DIRECTED_GRAPH_PARAMS, typename Property>
552 inline typename property_map<DIRECTED_GRAPH, Property>::type
553 get(Property p, DIRECTED_GRAPH& g)
554 { return get(p, g.impl()); }
556 template <DIRECTED_GRAPH_PARAMS, typename Property>
557 inline typename property_map<DIRECTED_GRAPH, Property>::const_type
558 get(Property p, DIRECTED_GRAPH const& g)
559 { return get(p, g.impl()); }
561 template <DIRECTED_GRAPH_PARAMS>
562 inline typename property_map<DIRECTED_GRAPH, vertex_all_t>::type
563 get(vertex_all_t, DIRECTED_GRAPH& g)
564 { return typename property_map<DIRECTED_GRAPH, vertex_all_t>::type(detail::remove_first_property(), get(vertex_all, g.impl())); }
566 template <DIRECTED_GRAPH_PARAMS>
567 inline typename property_map<DIRECTED_GRAPH, vertex_all_t>::const_type
568 get(vertex_all_t, DIRECTED_GRAPH const& g)
569 { return typename property_map<DIRECTED_GRAPH, vertex_all_t>::const_type(detail::remove_first_property(), get(vertex_all, g.impl())); }
571 template <DIRECTED_GRAPH_PARAMS>
572 inline typename property_map<DIRECTED_GRAPH, edge_all_t>::type
573 get(edge_all_t, DIRECTED_GRAPH& g)
574 { return typename property_map<DIRECTED_GRAPH, edge_all_t>::type(detail::remove_first_property(), get(edge_all, g.impl())); }
576 template <DIRECTED_GRAPH_PARAMS>
577 inline typename property_map<DIRECTED_GRAPH, edge_all_t>::const_type
578 get(edge_all_t, DIRECTED_GRAPH const& g)
579 { return typename property_map<DIRECTED_GRAPH, edge_all_t>::const_type(detail::remove_first_property(), get(edge_all, g.impl())); }
581 template <DIRECTED_GRAPH_PARAMS, typename Property, typename Key>
582 inline typename property_traits<
583 typename property_map<
584 typename DIRECTED_GRAPH::graph_type, Property
587 get(Property p, DIRECTED_GRAPH const& g, Key const& k)
588 { return get(p, g.impl(), k); }
590 template <DIRECTED_GRAPH_PARAMS, typename Key>
591 inline typename property_traits<
592 typename property_map<
593 typename DIRECTED_GRAPH::graph_type, vertex_all_t
596 get(vertex_all_t, DIRECTED_GRAPH const& g, Key const& k)
597 { return get(vertex_all, g.impl(), k).m_base; }
599 template <DIRECTED_GRAPH_PARAMS, typename Key>
600 inline typename property_traits<
601 typename property_map<
602 typename DIRECTED_GRAPH::graph_type, edge_all_t
605 get(edge_all_t, DIRECTED_GRAPH const& g, Key const& k)
606 { return get(edge_all, g.impl(), k).m_base; }
608 template <DIRECTED_GRAPH_PARAMS, typename Property, typename Key, typename Value>
609 inline void put(Property p, DIRECTED_GRAPH& g, Key const& k, Value const& v)
610 { put(p, g.impl(), k, v); }
612 template <DIRECTED_GRAPH_PARAMS, typename Key, typename Value>
613 inline void put(vertex_all_t, DIRECTED_GRAPH& g, Key const& k, Value const& v)
614 { put(vertex_all, g.impl(), k,
615 typename DIRECTED_GRAPH::internal_vertex_property(get(vertex_index, g.impl(), k), v));
618 template <DIRECTED_GRAPH_PARAMS, typename Key, typename Value>
619 inline void put(edge_all_t, DIRECTED_GRAPH& g, Key const& k, Value const& v)
620 { put(edge_all, g.impl(), k,
621 typename DIRECTED_GRAPH::internal_vertex_property(get(edge_index, g.impl(), k), v));
624 template <DIRECTED_GRAPH_PARAMS, class Property>
625 typename graph_property<DIRECTED_GRAPH, Property>::type&
626 get_property(DIRECTED_GRAPH& g, Property p)
627 { return get_property(g.impl(), p); }
629 template <DIRECTED_GRAPH_PARAMS, class Property>
630 typename graph_property<DIRECTED_GRAPH, Property>::type const&
631 get_property(DIRECTED_GRAPH const& g, Property p)
632 { return get_property(g.impl(), p); }
634 template <DIRECTED_GRAPH_PARAMS, class Property, class Value>
636 set_property(DIRECTED_GRAPH& g, Property p, Value v)
637 { return set_property(g.impl(), p, v); }
639 // Vertex index management
641 template <DIRECTED_GRAPH_PARAMS>
642 inline typename DIRECTED_GRAPH::vertex_index_type
643 get_vertex_index(typename DIRECTED_GRAPH::vertex_descriptor v,
644 DIRECTED_GRAPH const& g)
645 { return get(vertex_index, g, v); }
647 template <DIRECTED_GRAPH_PARAMS>
648 typename DIRECTED_GRAPH::vertex_index_type
649 max_vertex_index(DIRECTED_GRAPH const& g)
650 { return g.max_vertex_index(); }
652 template <DIRECTED_GRAPH_PARAMS>
654 renumber_vertex_indices(DIRECTED_GRAPH& g)
655 { g.renumber_vertex_indices(); }
657 template <DIRECTED_GRAPH_PARAMS>
659 remove_vertex_and_renumber_indices(typename DIRECTED_GRAPH::vertex_iterator i,
661 { g.remove_vertex_and_renumber_indices(i); }
663 // Edge index management
664 template <DIRECTED_GRAPH_PARAMS>
665 inline typename DIRECTED_GRAPH::edge_index_type
666 get_edge_index(typename DIRECTED_GRAPH::edge_descriptor v, DIRECTED_GRAPH const& g)
667 { return get(edge_index, g, v); }
669 template <DIRECTED_GRAPH_PARAMS>
670 typename DIRECTED_GRAPH::edge_index_type
671 max_edge_index(DIRECTED_GRAPH const& g)
672 { return g.max_edge_index(); }
674 template <DIRECTED_GRAPH_PARAMS>
675 inline void renumber_edge_indices(DIRECTED_GRAPH& g)
676 { g.renumber_edge_indices(); }
678 template <DIRECTED_GRAPH_PARAMS>
680 remove_edge_and_renumber_indices(typename DIRECTED_GRAPH::edge_iterator i,
682 { g.remove_edge_and_renumber_indices(i); }
685 template <DIRECTED_GRAPH_PARAMS>
687 renumber_indices(DIRECTED_GRAPH& g)
688 { g.renumber_indices(); }
691 template <DIRECTED_GRAPH_PARAMS>
692 struct graph_mutability_traits<DIRECTED_GRAPH> {
693 typedef mutable_property_graph_tag category;
696 #undef DIRECTED_GRAPH_PARAMS
697 #undef DIRECTED_GRAPH
699 } /* namespace boost */